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/cppo/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/dune/2.nix31
-rw-r--r--pkgs/development/tools/ocaml/ocp-index/default.nix17
-rw-r--r--pkgs/development/tools/ocaml/utop/default.nix8
4 files changed, 43 insertions, 19 deletions
diff --git a/pkgs/development/tools/ocaml/cppo/default.nix b/pkgs/development/tools/ocaml/cppo/default.nix
index 27c608fc719..8aa446081b7 100644
--- a/pkgs/development/tools/ocaml/cppo/default.nix
+++ b/pkgs/development/tools/ocaml/cppo/default.nix
@@ -7,8 +7,8 @@ assert stdenv.lib.versionAtLeast ocaml.version "3.12";
 
 let param =
   if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
-    version = "1.6.5";
-    sha256 = "03c0amszy28shinvz61hm340jz446zz5763a1pdqlza36kwcj0p0";
+    version = "1.6.6";
+    sha256 = "1smcc0l6fh2n0y6bp96c69j5nw755jja99w0b206wx3yb2m4w2hs";
     buildInputs = [ dune ];
     extra = {
       inherit (dune) installPhase;
@@ -31,7 +31,7 @@ stdenv.mkDerivation ({
   name = "${pname}-${param.version}";
 
   src = fetchFromGitHub {
-    owner = "mjambon";
+    owner = "ocaml-community";
     repo = pname;
     rev = "v${param.version}";
     inherit (param) sha256;
diff --git a/pkgs/development/tools/ocaml/dune/2.nix b/pkgs/development/tools/ocaml/dune/2.nix
new file mode 100644
index 00000000000..3260068edcd
--- /dev/null
+++ b/pkgs/development/tools/ocaml/dune/2.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, ocaml, findlib }:
+
+if stdenv.lib.versionOlder ocaml.version "4.07"
+then throw "dune is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "dune";
+  version = "2.1.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/dune/releases/download/${version}/dune-${version}.tbz";
+    sha256 = "1hf8c0djx2v1jpjba0z096gw6qdr0igsljrf0qh0ggphg9valsmj";
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  buildFlags = "release";
+
+  dontAddPrefix = true;
+
+  installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
+
+  meta = {
+    homepage = "https://dune.build/";
+    description = "A composable build system";
+    maintainers = [ stdenv.lib.maintainers.vbgl stdenv.lib.maintainers.marsam ];
+    license = stdenv.lib.licenses.mit;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/pkgs/development/tools/ocaml/ocp-index/default.nix b/pkgs/development/tools/ocaml/ocp-index/default.nix
index 79be6a8170c..9ea01a8dca7 100644
--- a/pkgs/development/tools/ocaml/ocp-index/default.nix
+++ b/pkgs/development/tools/ocaml/ocp-index/default.nix
@@ -1,29 +1,24 @@
-{ stdenv, fetchFromGitHub, ocaml, findlib, dune, ocp-build, ocp-indent, cmdliner, re }:
-
-stdenv.mkDerivation rec {
+{ stdenv, fetchFromGitHub, buildDunePackage, ocp-build, ocp-indent, cmdliner, re,  }:
 
+buildDunePackage rec {
+  pname = "ocp-index";
   version = "1.1.9";
-  name = "ocaml${ocaml.version}-ocp-index-${version}";
 
   src = fetchFromGitHub {
     owner = "OCamlPro";
-    repo = "ocp-index";
+    repo = pname;
     rev = version;
     sha256 = "0dq1kap16xfajc6gg9hbiadax782winpvxnr3dkm2ncznnxds37p";
   };
 
-  buildInputs = [ ocaml findlib dune ocp-build cmdliner re ];
-  propagatedBuildInputs = [ ocp-indent ];
-
-  buildPhase = "dune build -p ocp-index";
+  buildInputs = [ ocp-build cmdliner re ];
 
-  inherit (dune) installPhase;
+  propagatedBuildInputs = [ ocp-indent ];
 
   meta = {
     homepage = http://typerex.ocamlpro.com/ocp-index.html;
     description = "A simple and light-weight documentation extractor for OCaml";
     license = stdenv.lib.licenses.lgpl3;
-    platforms = ocaml.meta.platforms or [];
     maintainers = with stdenv.lib.maintainers; [ vbgl ];
   };
 }
diff --git a/pkgs/development/tools/ocaml/utop/default.nix b/pkgs/development/tools/ocaml/utop/default.nix
index f154b94ae33..c0aa1d16374 100644
--- a/pkgs/development/tools/ocaml/utop/default.nix
+++ b/pkgs/development/tools/ocaml/utop/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ocaml, findlib, dune
-, lambdaTerm, cppo, makeWrapper
+, lambdaTerm, cppo, makeWrapper, buildDunePackage
 }:
 
 if !stdenv.lib.versionAtLeast ocaml.version "4.03"
 then throw "utop is not available for OCaml ${ocaml.version}"
 else
 
-stdenv.mkDerivation rec {
+buildDunePackage rec {
   pname = "utop";
   version = "2.4.2";
 
@@ -16,12 +16,10 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ ocaml findlib cppo dune ];
+  buildInputs = [ cppo ];
 
   propagatedBuildInputs = [ lambdaTerm ];
 
-  inherit (dune) installPhase;
-
   postFixup =
    let
      path = "etc/utop/env";