From 124071cacdd324ec0ec0dfd21f569d8388c18599 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 12 Jul 2018 21:25:52 +0000 Subject: [PATCH] ocamlPackages.lwt3: make dependency to camlp4 optional --- pkgs/development/ocaml-modules/lwt/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/ocaml-modules/lwt/default.nix b/pkgs/development/ocaml-modules/lwt/default.nix index 37bcff375ea9..345ca037fec9 100644 --- a/pkgs/development/ocaml-modules/lwt/default.nix +++ b/pkgs/development/ocaml-modules/lwt/default.nix @@ -1,6 +1,8 @@ { stdenv, fetchzip, pkgconfig, ncurses, libev, jbuilder -, ocaml, findlib, camlp4, cppo +, ocaml, findlib, cppo , ocaml-migrate-parsetree, ppx_tools_versioned, result +, withP4 ? !stdenv.lib.versionAtLeast ocaml.version "4.07" +, camlp4 ? null }: stdenv.mkDerivation rec { @@ -13,12 +15,13 @@ stdenv.mkDerivation rec { }; preConfigure = '' - ocaml src/util/configure.ml -use-libev true -use-camlp4 true + ocaml src/util/configure.ml -use-libev true -use-camlp4 ${if withP4 then "true" else "false"} ''; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ ncurses ocaml findlib jbuilder camlp4 cppo - ocaml-migrate-parsetree ppx_tools_versioned ]; + buildInputs = [ ncurses ocaml findlib jbuilder cppo + ocaml-migrate-parsetree ppx_tools_versioned ] + ++ stdenv.lib.optional withP4 camlp4; propagatedBuildInputs = [ libev result ]; installPhase = ''