summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2018-03-25 18:26:39 +0000
committerVincent Laporte <vbgl@users.noreply.github.com>2018-03-27 22:32:55 +0200
commit0b53d63dad1ea50512dde126c3c3b46de59c4cce (patch)
treee003fdb301bc712acfc9db48cf0b5a7a4b0a5195 /pkgs/development/ocaml-modules
parent73a7d67795654d35647d217d6d1d3cb0f9cf0899 (diff)
downloadnixlib-0b53d63dad1ea50512dde126c3c3b46de59c4cce.tar
nixlib-0b53d63dad1ea50512dde126c3c3b46de59c4cce.tar.gz
nixlib-0b53d63dad1ea50512dde126c3c3b46de59c4cce.tar.bz2
nixlib-0b53d63dad1ea50512dde126c3c3b46de59c4cce.tar.lz
nixlib-0b53d63dad1ea50512dde126c3c3b46de59c4cce.tar.xz
nixlib-0b53d63dad1ea50512dde126c3c3b46de59c4cce.tar.zst
nixlib-0b53d63dad1ea50512dde126c3c3b46de59c4cce.zip
ocamlPackages.lwt3: 3.0.0 -> 3.3.0
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/lwt/default.nix73
-rw-r--r--pkgs/development/ocaml-modules/lwt/legacy.nix57
2 files changed, 83 insertions, 47 deletions
diff --git a/pkgs/development/ocaml-modules/lwt/default.nix b/pkgs/development/ocaml-modules/lwt/default.nix
index 53ba904f628e..37bcff375ea9 100644
--- a/pkgs/development/ocaml-modules/lwt/default.nix
+++ b/pkgs/development/ocaml-modules/lwt/default.nix
@@ -1,57 +1,36 @@
-{ stdenv, buildOcaml, fetchzip, which, cryptopp, ocaml, findlib, ocamlbuild, camlp4
-, react, ssl, libev, pkgconfig, ncurses, glib
-, ppx_tools, result, cppo
-, ppxSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
-, version ? if stdenv.lib.versionAtLeast ocaml.version "4.02" then "2.7.1" else "2.6.0"
+{ stdenv, fetchzip, pkgconfig, ncurses, libev, jbuilder
+, ocaml, findlib, camlp4, cppo
+, ocaml-migrate-parsetree, ppx_tools_versioned, result
 }:
 
-if !stdenv.lib.versionAtLeast ocaml.version "4"
-then throw "lwt is not available for OCaml ${ocaml.version}"
-else
-
-let sha256 = {
-  "3.0.0" = "0wwhnl9hppixcsdisinj1wmffx0nv6hkpm01z9qvkngkrazi3i88";
-  "2.7.1" = "0w7f59havrl2fsnvs84lm7wlqpsrldg80gy5afpnpr21zkw22g8w";
-  "2.6.0" = "0f1h83zh60rspm4fxd96z9h5bkhq1n1q968hgq92sq4a6bfi1c2w";
-}."${version}"; in
-
-let optionals = stdenv.lib.optionals (!stdenv.lib.versionAtLeast version "3"); in
-
-buildOcaml rec {
-  name = "lwt";
-  inherit version;
+stdenv.mkDerivation rec {
+  version = "3.3.0";
+  name = "ocaml${ocaml.version}-lwt-${version}";
 
   src = fetchzip {
     url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
-    inherit sha256;
+    sha256 = "0n87hcyl4svy0risj439wyfq6bl77qxq3nraqgdr1qbz5lskbq2j";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
-  ++ stdenv.lib.optional ppxSupport ppx_tools;
-
-  propagatedBuildInputs = [ result ]
-  ++ optionals [ react ssl ]
-  ++ [ libev ];
+  preConfigure = ''
+    ocaml src/util/configure.ml -use-libev true -use-camlp4 true
+  '';
 
-  configureScript = "ocaml setup.ml -configure";
-  prefixKey = "--prefix ";
-  configureFlags =
-  optionals [ "--enable-glib" "--enable-ssl" "--enable-react" ]
-  ++ [ "--enable-camlp4" ]
-  ++ [ (if ppxSupport then "--enable-ppx" else "--disable-ppx") ];
-
-  createFindlibDestdir = true;
-
-  hasSharedObjects = true;
-
-  meta = with stdenv.lib; {
-    homepage = http://ocsigen.org/lwt;
-    description = "Lightweight thread library for Objective Caml";
-    license = licenses.lgpl21;
-    platforms = ocaml.meta.platforms or [];
-    maintainers = with maintainers; [
-      z77z vbgl gal_bolle
-    ];
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ ncurses ocaml findlib jbuilder camlp4 cppo
+    ocaml-migrate-parsetree ppx_tools_versioned ];
+  propagatedBuildInputs = [ libev result ];
+
+  installPhase = ''
+    ocaml src/util/install_filter.ml
+    ${jbuilder.installPhase}
+  '';
+
+  meta = {
+    homepage = "https://ocsigen.org/lwt/";
+    description = "A cooperative threads library for OCaml";
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    license = stdenv.lib.licenses.lgpl21;
+    inherit (ocaml.meta) platforms;
   };
 }
diff --git a/pkgs/development/ocaml-modules/lwt/legacy.nix b/pkgs/development/ocaml-modules/lwt/legacy.nix
new file mode 100644
index 000000000000..53ba904f628e
--- /dev/null
+++ b/pkgs/development/ocaml-modules/lwt/legacy.nix
@@ -0,0 +1,57 @@
+{ stdenv, buildOcaml, fetchzip, which, cryptopp, ocaml, findlib, ocamlbuild, camlp4
+, react, ssl, libev, pkgconfig, ncurses, glib
+, ppx_tools, result, cppo
+, ppxSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
+, version ? if stdenv.lib.versionAtLeast ocaml.version "4.02" then "2.7.1" else "2.6.0"
+}:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4"
+then throw "lwt is not available for OCaml ${ocaml.version}"
+else
+
+let sha256 = {
+  "3.0.0" = "0wwhnl9hppixcsdisinj1wmffx0nv6hkpm01z9qvkngkrazi3i88";
+  "2.7.1" = "0w7f59havrl2fsnvs84lm7wlqpsrldg80gy5afpnpr21zkw22g8w";
+  "2.6.0" = "0f1h83zh60rspm4fxd96z9h5bkhq1n1q968hgq92sq4a6bfi1c2w";
+}."${version}"; in
+
+let optionals = stdenv.lib.optionals (!stdenv.lib.versionAtLeast version "3"); in
+
+buildOcaml rec {
+  name = "lwt";
+  inherit version;
+
+  src = fetchzip {
+    url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
+    inherit sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
+  ++ stdenv.lib.optional ppxSupport ppx_tools;
+
+  propagatedBuildInputs = [ result ]
+  ++ optionals [ react ssl ]
+  ++ [ libev ];
+
+  configureScript = "ocaml setup.ml -configure";
+  prefixKey = "--prefix ";
+  configureFlags =
+  optionals [ "--enable-glib" "--enable-ssl" "--enable-react" ]
+  ++ [ "--enable-camlp4" ]
+  ++ [ (if ppxSupport then "--enable-ppx" else "--disable-ppx") ];
+
+  createFindlibDestdir = true;
+
+  hasSharedObjects = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://ocsigen.org/lwt;
+    description = "Lightweight thread library for Objective Caml";
+    license = licenses.lgpl21;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [
+      z77z vbgl gal_bolle
+    ];
+  };
+}