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/alcotest/default.nix27
-rw-r--r--pkgs/development/ocaml-modules/lablgtk/default.nix22
-rw-r--r--pkgs/development/ocaml-modules/lwt/default.nix4
3 files changed, 37 insertions, 16 deletions
diff --git a/pkgs/development/ocaml-modules/alcotest/default.nix b/pkgs/development/ocaml-modules/alcotest/default.nix
index bf0ae24ff03d..90ee8d905a6e 100644
--- a/pkgs/development/ocaml-modules/alcotest/default.nix
+++ b/pkgs/development/ocaml-modules/alcotest/default.nix
@@ -1,20 +1,35 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, topkg, opam, cmdliner, astring, fmt, result }:
+{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, topkg, opam, jbuilder
+, cmdliner, astring, fmt, result
+}:
+
+let param =
+  if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
+    version = "0.8.1";
+    sha256 = "1bjhgwmshlaz9xncrrkknys7prigf8vlg1kqvfx9l8kn92mlf10b";
+    buildInputs = [ jbuilder ];
+    buildPhase = "jbuilder build -p alcotest";
+    inherit (jbuilder) installPhase;
+  } else {
+    version = "0.7.2";
+    sha256 = "1qgsz2zz5ky6s5pf3j3shc4fjc36rqnjflk8x0wl1fcpvvkr52md";
+    buildInputs = [ ocamlbuild opam topkg ];
+    inherit (topkg) buildPhase installPhase;
+  };
+in
 
 stdenv.mkDerivation rec {
   name = "ocaml${ocaml.version}-alcotest-${version}";
-  version = "0.7.2";
+  inherit (param) version buildPhase installPhase;
 
   src = fetchzip {
     url = "https://github.com/mirage/alcotest/archive/${version}.tar.gz";
-    sha256 = "1qgsz2zz5ky6s5pf3j3shc4fjc36rqnjflk8x0wl1fcpvvkr52md";
+    inherit (param) sha256;
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild opam topkg ];
+  buildInputs = [ ocaml findlib ] ++ param.buildInputs;
 
   propagatedBuildInputs = [ cmdliner astring fmt result ];
 
-  inherit (topkg) buildPhase installPhase;
-
   createFindlibDestdir = true;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/ocaml-modules/lablgtk/default.nix b/pkgs/development/ocaml-modules/lablgtk/default.nix
index 9d01b73479a4..ff42af0c0e40 100644
--- a/pkgs/development/ocaml-modules/lablgtk/default.nix
+++ b/pkgs/development/ocaml-modules/lablgtk/default.nix
@@ -1,18 +1,24 @@
 { stdenv, fetchurl, ocaml, findlib, pkgconfig, gtk2, libgnomecanvas, libglade, gtksourceview }:
 
-let
-  pname = "lablgtk";
+let param =
+  let check = stdenv.lib.versionAtLeast ocaml.version; in
+  if check "4.06" then {
+    version = "2.18.6";
+    url = https://forge.ocamlcore.org/frs/download.php/1726/lablgtk-2.18.6.tar.gz;
+    sha256 = "1y38fdvswy6hmppm65qvgdk4pb3ghhnvz7n4ialf46340r1s5p2d";
+  } else if check "3.12" then {
+    version = "2.18.5";
+    url = https://forge.ocamlcore.org/frs/download.php/1627/lablgtk-2.18.5.tar.gz;
+    sha256 = "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib";
+  } else throw "lablgtk is not available for OCaml ${ocaml.version}";
 in
 
-assert stdenv.lib.versionAtLeast ocaml.version "3.12";
-
 stdenv.mkDerivation rec {
-  name = "${pname}-${version}";
-  version = "2.18.5";
+  name = "lablgtk-${version}";
+  inherit (param) version;
 
   src = fetchurl {
-    url = https://forge.ocamlcore.org/frs/download.php/1627/lablgtk-2.18.5.tar.gz;
-    sha256 = "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib";
+    inherit (param) url sha256;
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/ocaml-modules/lwt/default.nix b/pkgs/development/ocaml-modules/lwt/default.nix
index c3acdcf5bdb4..53ba904f628e 100644
--- a/pkgs/development/ocaml-modules/lwt/default.nix
+++ b/pkgs/development/ocaml-modules/lwt/default.nix
@@ -1,5 +1,5 @@
 { stdenv, buildOcaml, fetchzip, which, cryptopp, ocaml, findlib, ocamlbuild, camlp4
-, react, ssl, libev, pkgconfig, ncurses, ocaml_oasis, glib
+, 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"
@@ -27,7 +27,7 @@ buildOcaml rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ ocaml_oasis which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
+  buildInputs = [ which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
   ++ stdenv.lib.optional ppxSupport ppx_tools;
 
   propagatedBuildInputs = [ result ]