summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/lwt
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-07-02 11:06:16 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-07-02 11:59:17 +0000
commitd3a29b393a45b63815d0e3374ec0cf9f54200ef9 (patch)
tree42aa4489d305e5f59a96bdd0c9d373d492952893 /pkgs/development/ocaml-modules/lwt
parente8c0e8a04bf0772bd7a4a92557ce90106854c383 (diff)
downloadnixlib-d3a29b393a45b63815d0e3374ec0cf9f54200ef9.tar
nixlib-d3a29b393a45b63815d0e3374ec0cf9f54200ef9.tar.gz
nixlib-d3a29b393a45b63815d0e3374ec0cf9f54200ef9.tar.bz2
nixlib-d3a29b393a45b63815d0e3374ec0cf9f54200ef9.tar.lz
nixlib-d3a29b393a45b63815d0e3374ec0cf9f54200ef9.tar.xz
nixlib-d3a29b393a45b63815d0e3374ec0cf9f54200ef9.tar.zst
nixlib-d3a29b393a45b63815d0e3374ec0cf9f54200ef9.zip
ocamlPackages.lwt: 2.7.1 -> 3.0.0
Diffstat (limited to 'pkgs/development/ocaml-modules/lwt')
-rw-r--r--pkgs/development/ocaml-modules/lwt/default.nix30
1 files changed, 16 insertions, 14 deletions
diff --git a/pkgs/development/ocaml-modules/lwt/default.nix b/pkgs/development/ocaml-modules/lwt/default.nix
index d450a877517e..531378c19a4f 100644
--- a/pkgs/development/ocaml-modules/lwt/default.nix
+++ b/pkgs/development/ocaml-modules/lwt/default.nix
@@ -2,36 +2,38 @@
 , ocaml_react, ocaml_ssl, libev, pkgconfig, ncurses, ocaml_oasis, 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"
 }:
 
-let param =
-  if stdenv.lib.versionAtLeast ocaml.version "4.02"
-  then {
-    version = "2.7.1";
-    sha256 = "0w7f59havrl2fsnvs84lm7wlqpsrldg80gy5afpnpr21zkw22g8w";
-  } else {
-    version = "2.6.0";
-    sha256 = "0f1h83zh60rspm4fxd96z9h5bkhq1n1q968hgq92sq4a6bfi1c2w";
-  };
-in
+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 (param) version;
+  inherit version;
 
   src = fetchzip {
     url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
-    inherit (param) sha256;
+    inherit sha256;
   };
 
   buildInputs = [ ocaml_oasis pkgconfig which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
   ++ stdenv.lib.optional ppxSupport ppx_tools;
 
-  propagatedBuildInputs = [ result ocaml_react ocaml_ssl libev ];
+  propagatedBuildInputs = [ result ]
+  ++ optionals [ ocaml_react ocaml_ssl ]
+  ++ [ libev ];
 
   configureScript = "ocaml setup.ml -configure";
   prefixKey = "--prefix ";
-  configureFlags = [ "--enable-glib" "--enable-ssl" "--enable-react" "--enable-camlp4" ]
+  configureFlags =
+  optionals [ "--enable-glib" "--enable-ssl" "--enable-react" ]
+  ++ [ "--enable-camlp4" ]
   ++ [ (if ppxSupport then "--enable-ppx" else "--disable-ppx") ];
 
   createFindlibDestdir = true;