2020-05-12 19:14:39 +00:00
|
|
|
{ lib, fetchFromGitHub, buildDunePackage, ocaml
|
2021-03-23 19:43:19 +00:00
|
|
|
, version ?
|
|
|
|
if lib.versionAtLeast ocaml.version "4.07"
|
|
|
|
then if lib.versionAtLeast ocaml.version "4.08"
|
2022-11-09 19:41:22 +00:00
|
|
|
then if lib.versionAtLeast ocaml.version "4.11"
|
|
|
|
then "0.28.0" else "0.24.0" else "0.15.0" else "0.13.0"
|
2018-07-05 19:40:30 +00:00
|
|
|
, ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio
|
2021-06-21 15:59:07 +00:00
|
|
|
, stdlib-shims, ocaml-migrate-parsetree-2
|
2018-07-05 19:40:30 +00:00
|
|
|
}:
|
|
|
|
|
2020-12-08 20:50:04 +00:00
|
|
|
let param = {
|
|
|
|
"0.8.1" = {
|
2020-05-12 19:14:39 +00:00
|
|
|
sha256 = "0vm0jajmg8135scbg0x60ivyy5gzv4abwnl7zls2mrw23ac6kml6";
|
2020-12-08 20:50:04 +00:00
|
|
|
max_version = "4.10";
|
2021-01-13 15:09:33 +00:00
|
|
|
useDune2 = false;
|
|
|
|
useOMP2 = false;
|
2020-12-08 20:50:04 +00:00
|
|
|
};
|
|
|
|
"0.13.0" = {
|
|
|
|
sha256 = "0c54g22pm6lhfh3f7s5wbah8y48lr5lj3cqsbvgi99bly1b5vqvl";
|
2021-01-13 15:09:33 +00:00
|
|
|
useDune2 = false;
|
|
|
|
useOMP2 = false;
|
2020-12-08 20:50:04 +00:00
|
|
|
};
|
2020-12-08 20:50:14 +00:00
|
|
|
"0.15.0" = {
|
|
|
|
sha256 = "1p037kqj5858xrhh0dps6vbf4fnijla6z9fjz5zigvnqp4i2xkrn";
|
|
|
|
min_version = "4.07";
|
2021-03-23 19:43:14 +00:00
|
|
|
max_version = "4.12";
|
2021-01-13 15:09:33 +00:00
|
|
|
useOMP2 = false;
|
|
|
|
};
|
|
|
|
"0.18.0" = {
|
|
|
|
sha256 = "1ciy6va2gjrpjs02kha83pzh0x1gkmfsfsdgabbs1v14a8qgfibm";
|
|
|
|
min_version = "4.07";
|
2021-03-23 19:43:14 +00:00
|
|
|
max_version = "4.12";
|
2020-12-08 20:50:14 +00:00
|
|
|
};
|
2021-03-06 21:07:48 +00:00
|
|
|
"0.22.0" = {
|
|
|
|
sha256 = "0kf7lgcwygf6zlx7rwddqpqvasa6v7xiq0bqal8vxlib6lpg074q";
|
|
|
|
min_version = "4.07";
|
|
|
|
};
|
2021-06-27 12:31:31 +00:00
|
|
|
"0.22.2" = {
|
|
|
|
sha256 = "0fysjqcpv281n52wl3h0dy2lzf9d61wdzk90ldv3p63a4i3mr1j2";
|
|
|
|
min_version = "4.07";
|
|
|
|
};
|
2021-10-14 16:29:21 +00:00
|
|
|
"0.23.0" = {
|
|
|
|
sha256 = "0jg5v4pssbl66hn5davpin1i57a0r3r54l96vpz5y99xk5w70xi1";
|
|
|
|
min_version = "4.07";
|
|
|
|
};
|
2022-01-23 20:24:16 +00:00
|
|
|
"0.24.0" = {
|
|
|
|
sha256 = "sha256-wuG7cUZiVP2PdM+nZloip7lGGiWn6Wpkh2YoF/Fuc9o=";
|
|
|
|
min_version = "4.07";
|
|
|
|
};
|
2022-10-11 11:31:29 +00:00
|
|
|
"0.28.0" = {
|
|
|
|
sha256 = "sha256-i/U++sosKQUjyxu9GscPb1Gfv2a3Hbmj+UgIZlewnCo=";
|
|
|
|
min_version = "4.07";
|
|
|
|
};
|
2020-12-08 20:50:04 +00:00
|
|
|
}."${version}"; in
|
2020-05-12 19:14:39 +00:00
|
|
|
|
2020-12-08 20:50:04 +00:00
|
|
|
if param ? max_version && lib.versionAtLeast ocaml.version param.max_version
|
2022-04-25 20:35:24 +00:00
|
|
|
|| param ? min_version && lib.versionOlder ocaml.version param.min_version
|
2020-12-19 17:33:55 +00:00
|
|
|
then throw "ppxlib-${version} is not available for OCaml ${ocaml.version}"
|
2020-05-12 19:14:39 +00:00
|
|
|
else
|
2020-03-06 06:42:04 +00:00
|
|
|
|
2018-11-05 10:21:46 +00:00
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "ppxlib";
|
2020-12-08 20:50:04 +00:00
|
|
|
inherit version;
|
|
|
|
|
2021-01-13 15:09:33 +00:00
|
|
|
useDune2 = param.useDune2 or true;
|
2018-07-05 19:40:30 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml-ppx";
|
2018-11-05 10:21:46 +00:00
|
|
|
repo = pname;
|
2018-07-05 19:40:30 +00:00
|
|
|
rev = version;
|
2020-05-12 19:14:39 +00:00
|
|
|
inherit (param) sha256;
|
2018-07-05 19:40:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-01-13 15:09:33 +00:00
|
|
|
ocaml-compiler-libs
|
|
|
|
(if param.useOMP2 or true
|
2021-06-21 15:59:07 +00:00
|
|
|
then ocaml-migrate-parsetree-2
|
2021-01-13 15:09:33 +00:00
|
|
|
else ocaml-migrate-parsetree)
|
|
|
|
ppx_derivers
|
|
|
|
stdio
|
2020-12-08 20:50:14 +00:00
|
|
|
stdlib-shims
|
2018-07-05 19:40:30 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Comprehensive ppx tool set";
|
2020-05-12 19:14:39 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2018-07-05 19:40:30 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
};
|
|
|
|
}
|