summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/ocaml')
-rw-r--r--pkgs/development/tools/ocaml/camlp4/4_03.nix42
-rw-r--r--pkgs/development/tools/ocaml/camlp4/default.nix21
2 files changed, 14 insertions, 49 deletions
diff --git a/pkgs/development/tools/ocaml/camlp4/4_03.nix b/pkgs/development/tools/ocaml/camlp4/4_03.nix
deleted file mode 100644
index a92f2491e46..00000000000
--- a/pkgs/development/tools/ocaml/camlp4/4_03.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{stdenv, fetchzip, which, ocaml, ocamlbuild}:
-
-assert stdenv.lib.versionAtLeast ocaml.version "4.02";
-
-stdenv.mkDerivation {
-  name = "camlp4-${version}";
-  version = "4.03+1";
-
-  src = fetchzip {
-    url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
-    sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq";
-  };
-
-  buildInputs = [ which ocaml ocamlbuild ];
-
-  dontAddPrefix = true;
-
-  preConfigure = ''
-    configureFlagsArray=(
-      --bindir=$out/bin
-      --libdir=$out/lib/ocaml/${ocaml.version}/site-lib
-      --pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib
-    )
-  '';
-
-  postConfigure = ''
-    substituteInPlace camlp4/META.in \
-    --replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4
-  '';
-
-
-  makeFlags = "all";
-
-  installTargets = "install install-META";
-
-  meta = with stdenv.lib; {
-    description = "A software system for writing extensible parsers for programming languages";
-    homepage = https://github.com/ocaml/camlp4;
-    platforms = ocaml.meta.platforms or [];
-  };
-}
-
diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix
index 145a3a2b54a..1e1d2eb68ea 100644
--- a/pkgs/development/tools/ocaml/camlp4/default.nix
+++ b/pkgs/development/tools/ocaml/camlp4/default.nix
@@ -1,17 +1,25 @@
-{stdenv, fetchzip, which, ocaml}:
-
-assert stdenv.lib.versionAtLeast ocaml.version "4.02";
+{ stdenv, fetchzip, which, ocaml, ocamlbuild }:
+
+let param = {
+  "4.02.3" = {
+     version = "4.02+6";
+     sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj"; };
+  "4.03.0" = {
+     version = "4.03+1";
+     sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq"; };
+  }."${ocaml.version}";
+in
 
 stdenv.mkDerivation rec {
   name = "camlp4-${version}";
-  version = "4.02+6";
+  inherit (param) version;
 
   src = fetchzip {
     url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
-    sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj";
+    inherit (param) sha256;
   };
 
-  buildInputs = [ which ocaml ];
+  buildInputs = [ which ocaml ocamlbuild ];
 
   dontAddPrefix = true;
 
@@ -28,7 +36,6 @@ stdenv.mkDerivation rec {
     --replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4
   '';
 
-
   makeFlags = "all";
 
   installTargets = "install install-META";