From 1c58618fd12182ef081f187e0b1a1136b85c4a53 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 14 Jul 2018 08:26:50 +0000 Subject: ocamlPackages.ppx_deriving: remove spurious dependency to camlp4 --- .../ocaml-modules/ppx_deriving/default.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'pkgs/development/ocaml-modules/ppx_deriving') 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; { -- cgit v1.2.3