ocamlPackages.lwt3: make dependency to camlp4 optional

This commit is contained in:
Vincent Laporte 2018-07-12 21:25:52 +00:00
parent b26c224293
commit 124071cacd
No known key found for this signature in database
GPG Key ID: EBD582ADDDB1F81F

View File

@ -1,6 +1,8 @@
{ stdenv, fetchzip, pkgconfig, ncurses, libev, jbuilder { stdenv, fetchzip, pkgconfig, ncurses, libev, jbuilder
, ocaml, findlib, camlp4, cppo , ocaml, findlib, cppo
, ocaml-migrate-parsetree, ppx_tools_versioned, result , ocaml-migrate-parsetree, ppx_tools_versioned, result
, withP4 ? !stdenv.lib.versionAtLeast ocaml.version "4.07"
, camlp4 ? null
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -13,12 +15,13 @@ stdenv.mkDerivation rec {
}; };
preConfigure = '' 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 ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ ncurses ocaml findlib jbuilder camlp4 cppo buildInputs = [ ncurses ocaml findlib jbuilder cppo
ocaml-migrate-parsetree ppx_tools_versioned ]; ocaml-migrate-parsetree ppx_tools_versioned ]
++ stdenv.lib.optional withP4 camlp4;
propagatedBuildInputs = [ libev result ]; propagatedBuildInputs = [ libev result ];
installPhase = '' installPhase = ''