2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage
|
|
|
|
, cppo, ppxlib, ppx_derivers, result, ounit, ocaml-migrate-parsetree
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
let params =
|
|
|
|
if lib.versionAtLeast ppxlib.version "0.15"
|
|
|
|
then {
|
|
|
|
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;
|
|
|
|
|
|
|
|
useDune2 = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
buildInputs = [ ppxlib cppo ];
|
|
|
|
propagatedBuildInputs = [ ocaml-migrate-parsetree ppx_derivers result ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2021-02-05 17:12:51 +00:00
|
|
|
checkInputs = [ ounit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02.";
|
|
|
|
maintainers = [ maintainers.maurer ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|