summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/tyxml/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/tyxml/default.nix')
-rw-r--r--pkgs/development/ocaml-modules/tyxml/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/development/ocaml-modules/tyxml/default.nix b/pkgs/development/ocaml-modules/tyxml/default.nix
index a965d6ed116..b34c9279c30 100644
--- a/pkgs/development/ocaml-modules/tyxml/default.nix
+++ b/pkgs/development/ocaml-modules/tyxml/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, camlp4, uutf, markup, ppx_tools_versioned, re
+{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, uutf, markup, ppx_tools_versioned, re
+, withP4 ? !stdenv.lib.versionAtLeast ocaml.version "4.07"
+, camlp4 ? null
 }:
 
 assert stdenv.lib.versionAtLeast ocaml.version "4.02";
@@ -13,13 +15,14 @@ stdenv.mkDerivation rec {
     sha256 = "1zrkrmxyj5a2cdh4b9zr9anwfk320wv3x0ynxnyxl5za2ix8sld8";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild camlp4 ppx_tools_versioned markup ];
+  buildInputs = [ ocaml findlib ocamlbuild ppx_tools_versioned markup ]
+  ++ stdenv.lib.optional withP4 camlp4;
 
   propagatedBuildInputs = [ uutf re ];
 
   createFindlibDestdir = true;
 
-  configureFlags = "--enable-syntax";
+  configureFlags = stdenv.lib.optional withP4 "--enable-syntax";
 
   meta = with stdenv.lib; {
     homepage = http://ocsigen.org/tyxml/;