nixpkgs/pkgs/development/ocaml-modules/ppx_import/default.nix

35 lines
941 B
Nix
Raw Normal View History

2018-09-10 06:45:15 +01:00
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, opaline
, cppo, ounit, ppx_deriving
}:
2016-11-03 16:34:36 +00:00
2018-09-10 06:45:15 +01:00
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "ppx_import is not available for OCaml ${ocaml.version}"
else
2016-11-03 16:34:36 +00:00
2018-09-10 06:45:15 +01:00
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-ppx_import-${version}";
2016-11-03 16:34:36 +00:00
2018-09-10 06:45:15 +01:00
version = "1.5";
2016-11-03 16:34:36 +00:00
src = fetchFromGitHub {
2017-11-26 20:08:53 +00:00
owner = "ocaml-ppx";
2016-11-03 16:34:36 +00:00
repo = "ppx_import";
rev = "v${version}";
2018-09-10 06:45:15 +01:00
sha256 = "1lf5lfp6bl5g4gdszaa6k6pkyh3qyhbarg5m1j0ai3i8zh5qg09d";
2016-11-03 16:34:36 +00:00
};
2018-09-10 06:45:15 +01:00
buildInputs = [ ocaml findlib ocamlbuild cppo ounit ppx_deriving opaline ];
2016-11-03 16:34:36 +00:00
doCheck = true;
checkTarget = "test";
2018-05-28 07:50:17 +01:00
installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
2016-11-03 16:34:36 +00:00
meta = with stdenv.lib; {
description = "A syntax extension that allows to pull in types or signatures from other compiled interface files";
license = licenses.mit;
2018-09-10 06:45:15 +01:00
inherit (ocaml.meta) platforms;
inherit (src.meta) homepage;
2016-11-03 16:34:36 +00:00
};
2017-11-26 20:08:53 +00:00
}