2021-03-06 21:10:06 +00:00
|
|
|
{ lib
|
|
|
|
, fetchurl
|
|
|
|
, buildDunePackage
|
|
|
|
, cppo
|
|
|
|
, ppxlib
|
|
|
|
, ppx_derivers
|
|
|
|
, result
|
|
|
|
, ounit
|
|
|
|
, ocaml-migrate-parsetree
|
|
|
|
, ocaml-migrate-parsetree-2-1
|
2017-03-04 05:24:36 +00:00
|
|
|
}:
|
2016-09-13 22:50:18 +01:00
|
|
|
|
2021-01-31 13:15:46 +00:00
|
|
|
let params =
|
2021-03-06 21:10:06 +00:00
|
|
|
if lib.versionAtLeast ppxlib.version "0.20" then {
|
|
|
|
version = "5.2.1";
|
|
|
|
sha256 = "11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9";
|
|
|
|
useOMP2 = true;
|
|
|
|
} else if lib.versionAtLeast ppxlib.version "0.15" then {
|
2021-01-31 13:15:46 +00:00
|
|
|
version = "5.1";
|
|
|
|
sha256 = "1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh";
|
2021-03-06 21:10:06 +00:00
|
|
|
useOMP2 = false;
|
2021-01-31 13:15:46 +00:00
|
|
|
} else {
|
|
|
|
version = "5.0";
|
|
|
|
sha256 = "0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3";
|
2021-03-06 21:10:06 +00:00
|
|
|
useOMP2 = false;
|
2021-01-31 13:15:46 +00:00
|
|
|
}
|
|
|
|
; in
|
|
|
|
|
2019-08-14 16:35:33 +01:00
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "ppx_deriving";
|
2021-01-31 13:15:46 +00:00
|
|
|
inherit (params) version;
|
|
|
|
|
|
|
|
useDune2 = true;
|
2016-09-13 22:50:18 +01:00
|
|
|
|
2021-01-31 13:15:46 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-v${version}.tbz";
|
|
|
|
inherit (params) sha256;
|
2016-09-13 22:50:18 +01:00
|
|
|
};
|
|
|
|
|
2021-01-31 13:15:46 +00:00
|
|
|
buildInputs = [ ppxlib cppo ];
|
2021-03-06 21:10:06 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
(if params.useOMP2
|
|
|
|
then ocaml-migrate-parsetree-2-1
|
|
|
|
else ocaml-migrate-parsetree)
|
|
|
|
ppx_derivers
|
|
|
|
result
|
|
|
|
];
|
2018-07-14 09:26:50 +01:00
|
|
|
|
2019-08-14 16:35:33 +01:00
|
|
|
doCheck = true;
|
2021-01-31 13:15:46 +00:00
|
|
|
checkInputs = [ ounit ];
|
2016-09-13 22:50:18 +01:00
|
|
|
|
2019-08-14 16:35:33 +01:00
|
|
|
meta = with lib; {
|
2016-09-13 22:50:18 +01:00
|
|
|
description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02.";
|
|
|
|
maintainers = [ maintainers.maurer ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|