summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2014-09-22 23:24:28 +0100
committerVincent Laporte <Vincent.Laporte@gmail.com>2014-09-23 09:34:13 +0100
commitd274ee3f80d0d32a227fbabbc2e2b92b115fd760 (patch)
treeb38825dcb3bc94c8c2015bf7772984ef4e228dc8 /pkgs/development/tools/ocaml
parent27f3301650066cc70eff3fa56d17c4dc2e93c289 (diff)
Adds camlp4
Camlp4 is a software system for writing extensible parsers for
programming languages.

Camlp4 was part of the official OCaml distribution until its version
4.01.0.

Homepage: https://github.com/ocaml/camlp4
Diffstat (limited to 'pkgs/development/tools/ocaml')
-rw-r--r--pkgs/development/tools/ocaml/camlp4/default.nix46
-rw-r--r--pkgs/development/tools/ocaml/ocamlify/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/ocamlmod/default.nix4
3 files changed, 50 insertions, 4 deletions
diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix
new file mode 100644
index 0000000000000..bd2466c8854aa
--- /dev/null
+++ b/pkgs/development/tools/ocaml/camlp4/default.nix
@@ -0,0 +1,46 @@
+{stdenv, fetchurl, which, ocaml}:
+let
+  ocaml_version = (stdenv.lib.getVersion ocaml);
+in
+
+assert stdenv.lib.versionAtLeast ocaml_version "4.02";
+
+stdenv.mkDerivation {
+  name = "camlp4-4.02.0+1";
+  src = fetchurl {
+    url = https://github.com/ocaml/camlp4/archive/4.02.0+1.tar.gz;
+    sha256 = "0055f4jiz82rgn581xhq3mr4qgq2qgdxqppmp8i2x1xnsim4h9pn";
+  };
+
+  buildInputs = [ which ocaml ];
+
+  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
+    substituteInPlace camlp4/config/Camlp4_config.ml \
+    --replace \
+      "Filename.concat ocaml_standard_library" \
+      "Filename.concat \"$out/lib/ocaml/${ocaml_version}/site-lib\""
+  '';
+
+
+  makePhase = "make 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;
+  };
+}
diff --git a/pkgs/development/tools/ocaml/ocamlify/default.nix b/pkgs/development/tools/ocaml/ocamlify/default.nix
index 88b7451e0f00d..0a402d4ba4696 100644
--- a/pkgs/development/tools/ocaml/ocamlify/default.nix
+++ b/pkgs/development/tools/ocaml/ocamlify/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ocaml, findlib, ounit}:
+{stdenv, fetchurl, ocaml, findlib}:
 
 stdenv.mkDerivation {
   name = "ocamlify-0.0.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "1f0fghvlbfryf5h3j4as7vcqrgfjb4c8abl5y0y5h069vs4kp5ii";
   };
 
-  buildInputs = [ocaml findlib ounit];
+  buildInputs = [ocaml findlib];
 
   configurePhase = "ocaml setup.ml -configure --prefix $out";
   buildPhase     = "ocaml setup.ml -build";
diff --git a/pkgs/development/tools/ocaml/ocamlmod/default.nix b/pkgs/development/tools/ocaml/ocamlmod/default.nix
index d72df18f8992a..65359049a96d1 100644
--- a/pkgs/development/tools/ocaml/ocamlmod/default.nix
+++ b/pkgs/development/tools/ocaml/ocamlmod/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ocaml, findlib, ounit}:
+{stdenv, fetchurl, ocaml, findlib}:
 
 stdenv.mkDerivation {
   name = "ocamlmod-0.0.7";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "11kg7wh0gy492ma5c6bcjh6frv1a9lh9f26hiys2i0d1ky8s0ad3";
   };
 
-  buildInputs = [ocaml findlib ounit];
+  buildInputs = [ocaml findlib];
 
   configurePhase = "ocaml setup.ml -configure --prefix $out";
   buildPhase     = "ocaml setup.ml -build";