2021-03-12 07:09:13 +00:00
|
|
|
{ lib
|
|
|
|
, fetchurl
|
|
|
|
, buildDunePackage
|
2023-01-11 07:51:40 +00:00
|
|
|
, ocaml
|
2023-05-24 13:37:59 +00:00
|
|
|
, findlib
|
2021-03-12 07:09:13 +00:00
|
|
|
, cppo
|
|
|
|
, ppxlib
|
|
|
|
, ppx_derivers
|
|
|
|
, result
|
|
|
|
, ounit
|
2022-03-05 16:20:37 +00:00
|
|
|
, ounit2
|
2021-03-12 07:09:13 +00:00
|
|
|
, ocaml-migrate-parsetree
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
let params =
|
2021-03-12 07:09:13 +00:00
|
|
|
if lib.versionAtLeast ppxlib.version "0.20" then {
|
|
|
|
version = "5.2.1";
|
|
|
|
sha256 = "11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9";
|
|
|
|
} else if lib.versionAtLeast ppxlib.version "0.15" then {
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "5.1";
|
|
|
|
sha256 = "1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh";
|
|
|
|
} else {
|
|
|
|
version = "5.0";
|
|
|
|
sha256 = "0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3";
|
|
|
|
}
|
|
|
|
; in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "ppx_deriving";
|
2021-02-05 17:12:51 +00:00
|
|
|
inherit (params) version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-v${version}.tbz";
|
|
|
|
inherit (params) sha256;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
strictDeps = true;
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cppo ];
|
2023-05-24 13:37:59 +00:00
|
|
|
buildInputs = [ findlib ppxlib ];
|
2023-10-09 19:29:22 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
lib.optional (lib.versionOlder version "5.2") ocaml-migrate-parsetree ++ [
|
2021-03-12 07:09:13 +00:00
|
|
|
ppx_derivers
|
|
|
|
result
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.08"
|
|
|
|
&& lib.versionOlder ocaml.version "5.0";
|
2023-02-09 11:40:11 +00:00
|
|
|
checkInputs = [
|
2022-03-05 16:20:37 +00:00
|
|
|
(if lib.versionAtLeast version "5.2" then ounit2 else ounit)
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.maurer ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|