summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/cmdliner/0.9.nix11
-rw-r--r--pkgs/development/ocaml-modules/eliom/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/functory/default.nix18
-rw-r--r--pkgs/development/ocaml-modules/gg/default.nix9
-rw-r--r--pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/js-build-tools.nix6
-rw-r--r--pkgs/development/ocaml-modules/lambda-term/default.nix5
-rw-r--r--pkgs/development/ocaml-modules/linenoise/default.nix29
-rw-r--r--pkgs/development/ocaml-modules/mstruct/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/nocrypto/default.nix5
-rw-r--r--pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/ppx_import/default.nix9
-rw-r--r--pkgs/development/ocaml-modules/reactivedata/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/topkg/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/uchar/default.nix12
-rw-r--r--pkgs/development/ocaml-modules/xmlm/default.nix30
16 files changed, 84 insertions, 90 deletions
diff --git a/pkgs/development/ocaml-modules/cmdliner/0.9.nix b/pkgs/development/ocaml-modules/cmdliner/0.9.nix
index e8824f318071..345d56d21707 100644
--- a/pkgs/development/ocaml-modules/cmdliner/0.9.nix
+++ b/pkgs/development/ocaml-modules/cmdliner/0.9.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }:
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }:
 
 let
   pname = "cmdliner";
@@ -17,17 +17,12 @@ stdenv.mkDerivation rec {
   };
 
   unpackCmd = "tar xjf $src";
-  nativeBuildInputs = [ ocamlbuild opam ];
+  nativeBuildInputs = [ ocamlbuild opaline ];
   buildInputs = [ ocaml findlib ];
 
-  createFindlibDestdir = true;
-
   configurePhase = "ocaml pkg/git.ml";
   buildPhase     = "ocaml pkg/build.ml native=true native-dynlink=true";
-  installPhase   = ''
-    opam-installer --script --prefix=$out | sh
-    ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
-  '';
+  installPhase   = "opaline -libdir $OCAMLFIND_DESTDIR";
 
   meta = with stdenv.lib; {
     homepage = http://erratique.ch/software/cmdliner;
diff --git a/pkgs/development/ocaml-modules/eliom/default.nix b/pkgs/development/ocaml-modules/eliom/default.nix
index da9383c4e95b..8b304aadd9ef 100644
--- a/pkgs/development/ocaml-modules/eliom/default.nix
+++ b/pkgs/development/ocaml-modules/eliom/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, which, ocsigen_server, ocsigen_deriving, ocaml, camlp4,
   js_of_ocaml, lwt_react, cryptokit,
   ipaddr, ocamlnet, lwt_ssl, ocaml_pcre,
-  opam, ppx_tools, ppx_deriving, findlib
+  opaline, ppx_tools, ppx_deriving, findlib
 , js_of_ocaml-ocamlbuild, js_of_ocaml-ppx, js_of_ocaml-ppx_deriving_json
 , js_of_ocaml-lwt
 , js_of_ocaml-tyxml
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec
 
   patches = [ ./camlp4.patch ];
 
-  buildInputs = [ ocaml which findlib js_of_ocaml-ocamlbuild js_of_ocaml-ppx_deriving_json opam ppx_tools
+  buildInputs = [ ocaml which findlib js_of_ocaml-ocamlbuild js_of_ocaml-ppx_deriving_json opaline ppx_tools
     ocsigen_deriving
   ];
 
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec
     ppx_deriving
   ];
 
-  installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
+  installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
 
   setupHook = [ ./setup-hook.sh ];
 
diff --git a/pkgs/development/ocaml-modules/functory/default.nix b/pkgs/development/ocaml-modules/functory/default.nix
index 6d4deac38c47..c8b29759b97c 100644
--- a/pkgs/development/ocaml-modules/functory/default.nix
+++ b/pkgs/development/ocaml-modules/functory/default.nix
@@ -1,14 +1,24 @@
-{stdenv, fetchurl, ocaml, findlib}:
+{ stdenv, fetchurl, ocaml, findlib }:
 
 assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "3.11";
 
+let param =
+  if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
+    version = "0.6";
+    sha256 = "18wpyxblz9jh5bfp0hpffnd0q8cq1b0dqp0f36vhqydfknlnpx8y";
+  } else {
+    version = "0.5";
+    sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3";
+  };
+in
+
 stdenv.mkDerivation {
 
-  name = "ocaml-functory-0.5";
+  name = "ocaml${ocaml.version}-functory-${param.version}";
 
   src = fetchurl {
-    url = https://www.lri.fr/~filliatr/functory/download/functory-0.5.tar.gz;
-    sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3";
+    url = "https://www.lri.fr/~filliatr/functory/download/functory-${param.version}.tar.gz";
+    inherit (param) sha256;
   };
 
   buildInputs = [ ocaml findlib ];
diff --git a/pkgs/development/ocaml-modules/gg/default.nix b/pkgs/development/ocaml-modules/gg/default.nix
index 0839ff361aea..0c80f39d9d7d 100644
--- a/pkgs/development/ocaml-modules/gg/default.nix
+++ b/pkgs/development/ocaml-modules/gg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }:
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }:
 
 let
   inherit (stdenv.lib) getVersion versionAtLeast;
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     sha256 = "0czj41sr8jsivl3z8wyblf9k971j3kx2wc3s0c1nhzcc8allg9i2";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild opam ];
+  buildInputs = [ ocaml findlib ocamlbuild opaline ];
 
   createFindlibDestdir = true;
 
@@ -27,10 +27,7 @@ stdenv.mkDerivation rec {
 
   buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
 
-  installPhase = ''
-    opam-installer --script --prefix=$out ${pname}.install | sh
-    ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname}
-  '';
+  installPhase = "opaline -libdir $OCAMLFIND_DESTDIR";
 
   meta = with stdenv.lib; {
     description = "Basic types for computer graphics in OCaml";
diff --git a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
index 61b2038bfd29..fdb0d8034e69 100644
--- a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
+++ b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
@@ -1,4 +1,4 @@
-{ buildOcaml, opam, js_build_tools, ocaml_oasis, fetchurl } :
+{ buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } :
 
 { name, version ? "113.33.03", buildInputs ? [],
   hash ? "",
@@ -14,7 +14,7 @@ buildOcaml (args // {
 
   hasSharedObjects = true;
 
-  buildInputs = [ ocaml_oasis js_build_tools opam ] ++ buildInputs;
+  buildInputs = [ ocaml_oasis js_build_tools opaline ] ++ buildInputs;
 
   dontAddPrefix = true;
 
@@ -22,14 +22,6 @@ buildOcaml (args // {
 
   buildPhase = "OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make";
 
-  installPhase = ''
-    opam-installer -i --prefix $prefix --libdir `ocamlfind printconf destdir` --stubsdir `ocamlfind printconf destdir`/${name} ${name}.install
-    if [ -d $out/lib/${name} ]
-      then if [ "$(ls -A $out/lib/${name})" ]
-        then mv $out/lib/${name}/* `ocamlfind printconf destdir`/${name}
-      fi
-      rmdir $out/lib/${name}
-    fi
-  '';
+  installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install";
 
 })
diff --git a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix
index 2c314f3dbdea..f77b793bcaab 100644
--- a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix
+++ b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildOcaml, fetchurl, ocaml_oasis, opam }:
+{ stdenv, buildOcaml, fetchurl, ocaml_oasis, opaline }:
 
 buildOcaml rec {
   name = "js-build-tools";
@@ -13,11 +13,11 @@ buildOcaml rec {
 
   hasSharedObjects = true;
 
-  buildInputs = [ ocaml_oasis opam ];
+  buildInputs = [ ocaml_oasis opaline ];
 
   dontAddPrefix = true;
   configurePhase = "./configure --prefix $prefix";
-  installPhase = "opam-installer -i --prefix $prefix --libdir `ocamlfind printconf destdir` ${name}.install";
+  installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install";
 
   patches = [ ./js-build-tools-darwin.patch ];
 
diff --git a/pkgs/development/ocaml-modules/lambda-term/default.nix b/pkgs/development/ocaml-modules/lambda-term/default.nix
index 769b80ecddce..fdd30d28ed89 100644
--- a/pkgs/development/ocaml-modules/lambda-term/default.nix
+++ b/pkgs/development/ocaml-modules/lambda-term/default.nix
@@ -17,10 +17,7 @@ buildOcaml rec {
 
   buildPhase = "jbuilder build -p lambda-term";
 
-  installPhase = ''
-    ${jbuilder.installPhase}
-    mv $out/lib/ocaml/${ocaml.version}/site-lib/{stubslibs,lambda-term}/dlllambda_term_stubs.so
-  '';
+  inherit (jbuilder) installPhase;
 
   hasSharedObjects = true;
 
diff --git a/pkgs/development/ocaml-modules/linenoise/default.nix b/pkgs/development/ocaml-modules/linenoise/default.nix
new file mode 100644
index 000000000000..53ac918c47e6
--- /dev/null
+++ b/pkgs/development/ocaml-modules/linenoise/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, ocaml, jbuilder, findlib, result }:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.02"
+then throw "linenoise is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-linenoise-${version}";
+  version = "1.1.0";
+  src = fetchFromGitHub {
+    owner = "fxfactorial";
+    repo = "ocaml-linenoise";
+    rev = "v${version}";
+    sha256 = "1h6rqfgmhmd7p5z8yhk6zkbrk4yzw1v2fgwas2b7g3hqs6y0xj0q";
+  };
+
+  buildInputs = [ ocaml findlib jbuilder ];
+  propagatedBuildInputs = [ result ];
+
+  inherit (jbuilder) installPhase;
+
+  meta = {
+    description = "OCaml bindings to linenoise";
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/mstruct/default.nix b/pkgs/development/ocaml-modules/mstruct/default.nix
index 5aa57ba8fbb8..5682b75d6a14 100644
--- a/pkgs/development/ocaml-modules/mstruct/default.nix
+++ b/pkgs/development/ocaml-modules/mstruct/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, opam
+{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder
 , cstruct
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 		sha256 = "1p4ygwzs3n1fj4apfib0z0sabpph21bkq1dgjk4bsa59pq4prncm";
 	};
 
-	buildInputs = [ ocaml findlib jbuilder opam ];
+	buildInputs = [ ocaml findlib jbuilder ];
 
 	propagatedBuildInputs = [ cstruct ];
 
diff --git a/pkgs/development/ocaml-modules/nocrypto/default.nix b/pkgs/development/ocaml-modules/nocrypto/default.nix
index cfe3f37800de..6e68c87b5ff0 100644
--- a/pkgs/development/ocaml-modules/nocrypto/default.nix
+++ b/pkgs/development/ocaml-modules/nocrypto/default.nix
@@ -22,10 +22,7 @@ stdenv.mkDerivation rec {
     ppx_sexp_conv ];
   propagatedBuildInputs = [ cstruct zarith sexplib ] ++ optional withLwt cstruct-lwt;
 
-  buildPhase = ''
-    LD_LIBRARY_PATH=${cpuid}/lib/ocaml/${ocaml.version}/site-lib/stubslibs/ \
-    ${topkg.buildPhase} --with-lwt ${boolToString withLwt}
-  '';
+  buildPhase = "${topkg.buildPhase} --with-lwt ${boolToString withLwt}";
   inherit (topkg) installPhase;
 
   meta = {
diff --git a/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix b/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix
index 556c343241c3..37c8c8f76c95 100644
--- a/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix
+++ b/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, buildOcaml, ocaml, opam
+{ stdenv, fetchurl, buildOcaml, ocaml, opaline
 , calendar, eliom, js_of_ocaml-ppx_deriving_json
 }:
 
@@ -8,13 +8,13 @@ buildOcaml rec
  version = "1.1.0";
 
  propagatedBuildInputs = [ calendar eliom js_of_ocaml-ppx_deriving_json ];
- buildInputs = [ opam ];
+ buildInputs = [ opaline ];
 
  installPhase =
   ''
     export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH
     make install
-    opam-installer --prefix=$out
+    opaline -prefix $out
   '';
 
   src = fetchurl {
diff --git a/pkgs/development/ocaml-modules/ppx_import/default.nix b/pkgs/development/ocaml-modules/ppx_import/default.nix
index 991af1e41de1..3948cfce0e8e 100644
--- a/pkgs/development/ocaml-modules/ppx_import/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_import/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, buildOcaml, ocaml, opam,
+{stdenv, fetchFromGitHub, buildOcaml, ocaml, opaline,
  cppo, ppx_tools, ounit, ppx_deriving}:
 
 buildOcaml rec {
@@ -15,15 +15,12 @@ buildOcaml rec {
     sha256 = "14c2lp7r9080c4hsb1y1drbxxx3v44b7ib5wfh3kkh3f1jfsjwbk";
   };
 
-  buildInputs = [ cppo ounit ppx_deriving opam ];
+  buildInputs = [ cppo ounit ppx_deriving opaline ];
 
   doCheck = true;
   checkTarget = "test";
 
-  installPhase = ''
-    opam-installer --script --prefix=$out ppx_import.install | sh
-    ln -s $out/lib/ppx_import $out/lib/ocaml/${ocaml.version}/site-lib
-  '';
+  installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
 
   meta = with stdenv.lib; {
     description = "A syntax extension that allows to pull in types or signatures from other compiled interface files";
diff --git a/pkgs/development/ocaml-modules/reactivedata/default.nix b/pkgs/development/ocaml-modules/reactivedata/default.nix
index 1f1781f5a65b..fa85f2174688 100644
--- a/pkgs/development/ocaml-modules/reactivedata/default.nix
+++ b/pkgs/development/ocaml-modules/reactivedata/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, react, opam }:
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, react, opaline }:
 
 assert stdenv.lib.versionAtLeast ocaml.version "3.11";
 
@@ -9,12 +9,12 @@ stdenv.mkDerivation {
     sha256 = "0wcs0z50nia1cpk8mh6i5qbc6sff9cc8x7s7q1q89d7m73bnv4vf";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild opam ];
+  buildInputs = [ ocaml findlib ocamlbuild opaline ];
   propagatedBuildInputs = [ react ];
 
   buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
 
-  installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
+  installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
 
   meta = with stdenv.lib; {
     description = "An OCaml module for functional reactive programming (FRP) based on React";
diff --git a/pkgs/development/ocaml-modules/topkg/default.nix b/pkgs/development/ocaml-modules/topkg/default.nix
index 9a655e055131..3ff641ff93e5 100644
--- a/pkgs/development/ocaml-modules/topkg/default.nix
+++ b/pkgs/development/ocaml-modules/topkg/default.nix
@@ -5,7 +5,7 @@ The `buildPhase` and `installPhase` attributes can be reused directly
 in many cases. When more fine-grained control on how to run the “topkg”
 build system is required, the attribute `run` can be used.
 */
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opam }:
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opaline }:
 
 if !stdenv.lib.versionAtLeast ocaml.version "4.01"
 then throw "topkg is not available for OCaml ${ocaml.version}"
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   unpackCmd = "tar xjf ${src}";
   buildPhase = "${run} build";
   createFindlibDestdir = true;
-  installPhase = "${opam}/bin/opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
+  installPhase = "${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
 
   passthru = { inherit run; };
 
diff --git a/pkgs/development/ocaml-modules/uchar/default.nix b/pkgs/development/ocaml-modules/uchar/default.nix
index 6b27f00fb150..8fddf883da5d 100644
--- a/pkgs/development/ocaml-modules/uchar/default.nix
+++ b/pkgs/development/ocaml-modules/uchar/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, ocamlbuild, opam }:
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }:
 
 stdenv.mkDerivation {
   name = "ocaml${ocaml.version}-uchar-0.0.2";
@@ -9,15 +9,9 @@ stdenv.mkDerivation {
   };
 
   unpackCmd = "tar xjf $src";
-  buildInputs = [ ocaml ocamlbuild opam ];
+  buildInputs = [ ocaml ocamlbuild findlib opaline ];
   buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
-  installPhase = ''
-    opam-installer --script --prefix=$out uchar.install > install.sh
-    sh install.sh
-    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/
-    ln -s $out/lib/uchar $out/lib/ocaml/${ocaml.version}/site-lib/
-  '';
-
+  installPhase = "opaline -libdir $OCAMLFIND_DESTDIR";
 
   meta = {
     description = "Compatibility library for OCaml’s Uchar module";
diff --git a/pkgs/development/ocaml-modules/xmlm/default.nix b/pkgs/development/ocaml-modules/xmlm/default.nix
index 9d3a0b1bb4d0..a1765296d57d 100644
--- a/pkgs/development/ocaml-modules/xmlm/default.nix
+++ b/pkgs/development/ocaml-modules/xmlm/default.nix
@@ -4,38 +4,24 @@ let
   webpage = "http://erratique.ch/software/${pname}";
 in
 
-assert stdenv.lib.versionAtLeast ocaml.version "3.12";
-
-let param =
-  if stdenv.lib.versionAtLeast ocaml.version "4.02"
-  then {
-    version = "1.3.0";
-    sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n";
-    buildInputs = [ topkg ];
-    inherit (topkg) buildPhase;
-  } else {
-    version = "1.2.0";
-    sha256 = "1jywcrwn5z3gkgvicr004cxmdaqfmq8wh72f81jqz56iyn5024nh";
-    buildInputs = [];
-    buildPhase = "./pkg/build true";
-  };
-in
+if !stdenv.lib.versionAtLeast ocaml.version "4.02"
+then throw "xmlm is not available for OCaml ${ocaml.version}"
+else
 
 stdenv.mkDerivation rec {
-  name = "ocaml-${pname}-${version}";
-  inherit (param) version;
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "1.3.0";
 
   src = fetchurl {
     url = "${webpage}/releases/${pname}-${version}.tbz";
-    inherit (param) sha256;
+    sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild ] ++ param.buildInputs;
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
 
   unpackCmd = "tar xjf $src";
 
-  inherit (param) buildPhase;
-  inherit (topkg) installPhase;
+  inherit (topkg) buildPhase installPhase;
 
   meta = with stdenv.lib; {
     description = "An OCaml streaming codec to decode and encode the XML data format";