2020-05-12 20:14:39 +01:00
|
|
|
{ lib, fetchFromGitHub, buildDunePackage, ocaml
|
2020-12-08 20:50:04 +00:00
|
|
|
, version ? "0.13.0"
|
2018-07-05 20:40:30 +01:00
|
|
|
, ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio
|
|
|
|
}:
|
|
|
|
|
2020-12-08 20:50:04 +00:00
|
|
|
let param = {
|
|
|
|
"0.8.1" = {
|
2020-05-12 20:14:39 +01:00
|
|
|
sha256 = "0vm0jajmg8135scbg0x60ivyy5gzv4abwnl7zls2mrw23ac6kml6";
|
2020-12-08 20:50:04 +00:00
|
|
|
max_version = "4.10";
|
|
|
|
};
|
|
|
|
"0.13.0" = {
|
|
|
|
sha256 = "0c54g22pm6lhfh3f7s5wbah8y48lr5lj3cqsbvgi99bly1b5vqvl";
|
|
|
|
};
|
|
|
|
}."${version}"; in
|
2020-05-12 20:14:39 +01:00
|
|
|
|
2020-12-08 20:50:04 +00:00
|
|
|
if param ? max_version && lib.versionAtLeast ocaml.version param.max_version
|
|
|
|
|| param ? min_version && !lib.versionAtLeast ocaml.version param.min_version
|
2020-05-12 20:14:39 +01:00
|
|
|
then throw "ppxlib-${param.version} is not available for OCaml ${ocaml.version}"
|
|
|
|
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;
|
|
|
|
|
|
|
|
useDune2 = param.useDune2 or false;
|
2018-07-05 20:40:30 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml-ppx";
|
2018-11-05 10:21:46 +00:00
|
|
|
repo = pname;
|
2018-07-05 20:40:30 +01:00
|
|
|
rev = version;
|
2020-05-12 20:14:39 +01:00
|
|
|
inherit (param) sha256;
|
2018-07-05 20:40:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
ocaml-compiler-libs ocaml-migrate-parsetree ppx_derivers stdio
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Comprehensive ppx tool set";
|
2020-05-12 20:14:39 +01:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2018-07-05 20:40:30 +01:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
};
|
|
|
|
}
|