From 01910b18014f71a008089f4ebbfeb59af4daa7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Zimmermann?= Date: Thu, 3 Nov 2016 17:34:36 +0100 Subject: [PATCH] ocamlPackage.ppx_import: init at 1.1 --- .../ocaml-modules/ppx_import/default.nix | 32 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/ocaml-modules/ppx_import/default.nix diff --git a/pkgs/development/ocaml-modules/ppx_import/default.nix b/pkgs/development/ocaml-modules/ppx_import/default.nix new file mode 100644 index 000000000000..245fe3f76f66 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_import/default.nix @@ -0,0 +1,32 @@ +{stdenv, fetchFromGitHub, buildOcaml, ocaml, opam, + cppo, ppx_tools, ounit, ppx_deriving}: + +buildOcaml rec { + name = "ppx_import"; + + version = "1.1"; + + minimumSupportedOcamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "whitequark"; + repo = "ppx_import"; + rev = "v${version}"; + sha256 = "1hfvbc81dg58q7kkpn808b3j0xazrqfrr4v71sd1yvmnk71wak6k"; + }; + + buildInputs = [ cppo ounit ppx_deriving opam ]; + + doCheck = true; + checkTarget = "test"; + + installPhase = '' + opam-installer --script --prefix=$out ppx_import.install | sh + ln -s $out/lib/ppx_import $out/lib/ocaml/${ocaml.version}/site-lib + ''; + + meta = with stdenv.lib; { + description = "A syntax extension that allows to pull in types or signatures from other compiled interface files"; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index c8f36e14dfb7..92114a9d9235 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -416,6 +416,8 @@ let then callPackage ../development/ocaml-modules/ppx_deriving {} else null; + ppx_import = callPackage ../development/ocaml-modules/ppx_import {}; + ppx_tools = if lib.versionAtLeast ocaml.version "4.02" then callPackage ../development/ocaml-modules/ppx_tools {}