summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/ppx_deriving
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2018-07-14 08:26:50 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2018-07-14 17:17:51 +0000
commit1c58618fd12182ef081f187e0b1a1136b85c4a53 (patch)
tree197d0d3bb4ed807d4df7db29ea2c8b5355a5434e /pkgs/development/ocaml-modules/ppx_deriving
parentba612369e7f83db6b14ab93a6af9c7db3201fa1f (diff)
ocamlPackages.ppx_deriving: remove spurious dependency to camlp4
Diffstat (limited to 'pkgs/development/ocaml-modules/ppx_deriving')
-rw-r--r--pkgs/development/ocaml-modules/ppx_deriving/default.nix20
1 files changed, 11 insertions, 9 deletions
diff --git a/pkgs/development/ocaml-modules/ppx_deriving/default.nix b/pkgs/development/ocaml-modules/ppx_deriving/default.nix
index 3afe4149fa34..24cfbcf5b7af 100644
--- a/pkgs/development/ocaml-modules/ppx_deriving/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_deriving/default.nix
@@ -1,7 +1,11 @@
-{ stdenv, buildOcaml, ocaml, fetchzip
+{ stdenv, ocaml, findlib, ocamlbuild, fetchzip
, cppo, ppx_tools, ppx_derivers, result, ounit, ocaml-migrate-parsetree
}:
+if !stdenv.lib.versionAtLeast ocaml.version "4.02"
+then throw "ppx_deriving is not available for OCaml ${ocaml.version}"
+else
+
let param =
if ocaml.version == "4.03.0"
then {
@@ -14,23 +18,21 @@ let param =
extraPropagatedBuildInputs = [ ocaml-migrate-parsetree ppx_derivers ];
}; in
-buildOcaml rec {
- name = "ppx_deriving";
+stdenv.mkDerivation rec {
+ name = "ocaml${ocaml.version}-ppx_deriving-${version}";
inherit (param) version;
- minimumSupportedOcamlVersion = "4.02";
-
src = fetchzip {
- url = "https://github.com/whitequark/${name}/archive/v${version}.tar.gz";
+ url = "https://github.com/ocaml-ppx/ppx_deriving/archive/v${version}.tar.gz";
inherit (param) sha256;
};
- hasSharedObjects = true;
-
- buildInputs = [ cppo ounit ];
+ buildInputs = [ ocaml findlib ocamlbuild cppo ounit ];
propagatedBuildInputs = param.extraPropagatedBuildInputs ++
[ ppx_tools result ];
+ createFindlibDestdir = true;
+
installPhase = "OCAMLPATH=$OCAMLPATH:`ocamlfind printconf destdir` make install";
meta = with stdenv.lib; {