summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-04-04 20:59:24 +0100
committerGitHub <noreply@github.com>2018-04-04 20:59:24 +0100
commit5a4a3a6433c2e8f555f77a2cb841ba386ced7f78 (patch)
treed2f50bd84d11a7dda0ed1cacacc04d0c3d2072fc /pkgs
parente0d86e5bf0c879ebf17e9121bcf653fd64bab8a8 (diff)
parent8aa1e53a98c35a9612b22d2f251ed50d5b29a9a8 (diff)
downloadnixpkgs-5a4a3a6433c2e8f555f77a2cb841ba386ced7f78.tar
nixpkgs-5a4a3a6433c2e8f555f77a2cb841ba386ced7f78.tar.gz
nixpkgs-5a4a3a6433c2e8f555f77a2cb841ba386ced7f78.tar.bz2
nixpkgs-5a4a3a6433c2e8f555f77a2cb841ba386ced7f78.tar.lz
nixpkgs-5a4a3a6433c2e8f555f77a2cb841ba386ced7f78.tar.xz
nixpkgs-5a4a3a6433c2e8f555f77a2cb841ba386ced7f78.tar.zst
nixpkgs-5a4a3a6433c2e8f555f77a2cb841ba386ced7f78.zip
Merge pull request #38438 from vbgl/ocaml-ocsigen-deriving-0.8.1
ocamlPackages.ocsigen_deriving: 0.7.1 -> 0.8.1
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/ocaml-modules/ocsigen-deriving/default.nix25
-rw-r--r--pkgs/development/ocaml-modules/optcomp/META12
-rw-r--r--pkgs/development/ocaml-modules/optcomp/default.nix24
3 files changed, 55 insertions, 6 deletions
diff --git a/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix b/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix
index 65344561795..569f5081355 100644
--- a/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix
+++ b/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix
@@ -1,15 +1,30 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, oasis, ocaml_optcomp, camlp4 }:
+{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, oasis, ocaml_optcomp, camlp4
+, num
+}:
 
-let version = "0.7.1"; in
+let param =
+  if stdenv.lib.versionAtLeast ocaml.version "4.03"
+  then {
+    version = "0.8.1";
+    sha256 = "03vzrybdpjydbpil97zmir71kpsn2yxkjnzysma7fvybk8ll4zh9";
+    buildInputs = [ num ];
+  } else {
+    version = "0.7.1";
+    sha256 = "0gg3nr3iic4rwqrcc0qvfm9x0x57zclvdsnpy0z8rv2fl5isbzms";
+  };
+in
+
+let inherit (param) version; in
 
 stdenv.mkDerivation {
   name = "ocsigen-deriving-${version}";
   src = fetchzip {
     url = "https://github.com/ocsigen/deriving/archive/${version}.tar.gz";
-    sha256 = "0gg3nr3iic4rwqrcc0qvfm9x0x57zclvdsnpy0z8rv2fl5isbzms";
-    };
+    inherit (param) sha256;
+  };
 
-  buildInputs = [ ocaml findlib ocamlbuild oasis ocaml_optcomp camlp4 ];
+  buildInputs = [ ocaml findlib ocamlbuild oasis ocaml_optcomp camlp4 ]
+  ++ (param.buildInputs or []);
 
   createFindlibDestdir = true;
 
diff --git a/pkgs/development/ocaml-modules/optcomp/META b/pkgs/development/ocaml-modules/optcomp/META
new file mode 100644
index 00000000000..8a942288f75
--- /dev/null
+++ b/pkgs/development/ocaml-modules/optcomp/META
@@ -0,0 +1,12 @@
+# OASIS_START
+# DO NOT EDIT (digest: ec844fa3189acb2a866b89a69d111ba4)
+version = "1.6"
+description = "Optional compilation with cpp-like directives"
+requires = "camlp4"
+archive(syntax, preprocessor) = "optcomp.cma"
+archive(syntax, toploop) = "optcomp.cma"
+archive(syntax, preprocessor, native) = "optcomp.cmxa"
+archive(syntax, preprocessor, native, plugin) = "optcomp.cmxs"
+exists_if = "optcomp.cma"
+# OASIS_STOP
+
diff --git a/pkgs/development/ocaml-modules/optcomp/default.nix b/pkgs/development/ocaml-modules/optcomp/default.nix
index 8953373954a..5b566137747 100644
--- a/pkgs/development/ocaml-modules/optcomp/default.nix
+++ b/pkgs/development/ocaml-modules/optcomp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, camlp4 }:
+{ stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, camlp4 }:
 
 stdenv.mkDerivation {
   name = "ocaml-optcomp-1.6";
@@ -6,11 +6,33 @@ stdenv.mkDerivation {
     url = https://github.com/diml/optcomp/archive/1.6.tar.gz;
     sha256 = "0hhhb2gisah1h22zlg5iszbgqxdd7x85cwd57bd4mfkx9l7dh8jh";
   };
+
+  patches =
+    let inherit (stdenv.lib) optional versionAtLeast; in
+    optional (versionAtLeast ocaml.version "4.02") (fetchpatch {
+      url = "https://github.com/diml/optcomp/commit/b7f809360c9794b383a4bc0492f6df381276b429.patch";
+      sha256 = "1n095lk94jq1rwi0l24g2wbgms7249wdd31n0ji895dr6755s93y";
+    })
+  ;
   
   createFindlibDestdir = true;
 
   buildInputs = [ ocaml findlib ocamlbuild camlp4 ];
 
+  configurePhase = ''
+    cp ${./META} META
+  '';
+
+  buildPhase = ''
+    ocamlbuild src/optcomp.cmxs src/optcomp.cma src/optcomp_o.native src/optcomp_r.native
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp _build/src/optcomp_o.native $out/bin/optcomp-o
+    cp _build/src/optcomp_r.native $out/bin/optcomp-r
+    ocamlfind install optcomp META _build/src/optcomp.{a,cma,cmxa,cmxs} _build/src/pa_optcomp.{cmi,cmx,mli}
+  '';
 
   meta =  {
     homepage = https://github.com/diml/optcomp;