1{stdenv, fetchFromGitHub, buildOcaml, ocaml, opam,
2 cppo, ppx_tools, ounit, ppx_deriving}:
3
4buildOcaml rec {
5 name = "ppx_import";
6
7 version = "1.1";
8
9 minimumSupportedOcamlVersion = "4.02";
10
11 src = fetchFromGitHub {
12 owner = "whitequark";
13 repo = "ppx_import";
14 rev = "v${version}";
15 sha256 = "1hfvbc81dg58q7kkpn808b3j0xazrqfrr4v71sd1yvmnk71wak6k";
16 };
17
18 buildInputs = [ cppo ounit ppx_deriving opam ];
19
20 doCheck = true;
21 checkTarget = "test";
22
23 installPhase = ''
24 opam-installer --script --prefix=$out ppx_import.install | sh
25 ln -s $out/lib/ppx_import $out/lib/ocaml/${ocaml.version}/site-lib
26 '';
27
28 meta = with stdenv.lib; {
29 description = "A syntax extension that allows to pull in types or signatures from other compiled interface files";
30 license = licenses.mit;
31 };
32}