2017-08-03 19:39:25 +01:00
|
|
|
{ stdenv, buildOcaml, ocaml, fetchzip
|
2017-08-28 10:17:22 +01:00
|
|
|
, cppo, ppx_tools, ppx_derivers, result, ounit, ocaml-migrate-parsetree
|
2017-03-04 05:24:36 +00:00
|
|
|
}:
|
2016-09-13 22:50:18 +01:00
|
|
|
|
2017-08-28 10:17:22 +01:00
|
|
|
let param =
|
|
|
|
if ocaml.version == "4.03.0"
|
|
|
|
then {
|
|
|
|
version = "4.1";
|
|
|
|
sha256 = "0cy9p8d8cbcxvqyyv8fz2z9ypi121zrgaamdlp4ld9f3jnwz7my9";
|
|
|
|
extraPropagatedBuildInputs = [];
|
|
|
|
} else {
|
|
|
|
version = "4.2";
|
|
|
|
sha256 = "0scsg45wp6xdqj648fz155r4yngyl2xcd3hdszfzqwdpbax33914";
|
|
|
|
extraPropagatedBuildInputs = [ ocaml-migrate-parsetree ppx_derivers ];
|
|
|
|
}; in
|
|
|
|
|
2016-09-13 22:50:18 +01:00
|
|
|
buildOcaml rec {
|
|
|
|
name = "ppx_deriving";
|
2017-08-28 10:17:22 +01:00
|
|
|
inherit (param) version;
|
2016-09-13 22:50:18 +01:00
|
|
|
|
|
|
|
minimumSupportedOcamlVersion = "4.02";
|
|
|
|
|
2017-03-04 05:24:36 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/whitequark/${name}/archive/v${version}.tar.gz";
|
2017-08-28 10:17:22 +01:00
|
|
|
inherit (param) sha256;
|
2016-09-13 22:50:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
hasSharedObjects = true;
|
|
|
|
|
|
|
|
buildInputs = [ cppo ounit ];
|
2017-08-28 10:17:22 +01:00
|
|
|
propagatedBuildInputs = param.extraPropagatedBuildInputs ++
|
2016-09-13 22:50:18 +01:00
|
|
|
[ ppx_tools result ];
|
|
|
|
|
|
|
|
installPhase = "OCAMLPATH=$OCAMLPATH:`ocamlfind printconf destdir` make install";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02.";
|
|
|
|
maintainers = [ maintainers.maurer ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|