summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/alcotest
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-10-31 01:06:17 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-10-31 01:06:17 +0000
commit33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738 (patch)
treeaacd006e80dbf1492a384fb7b07dbdd637a1f36f /pkgs/development/ocaml-modules/alcotest
parent54d1e1412b67a813a65b36bbe832bd97e9c4dbfc (diff)
downloadnixlib-33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738.tar
nixlib-33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738.tar.gz
nixlib-33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738.tar.bz2
nixlib-33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738.tar.lz
nixlib-33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738.tar.xz
nixlib-33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738.tar.zst
nixlib-33c0dcacd0d61a41e6fdfb3244dd1fd442cf0738.zip
ocamlPackages.alcotest: 0.7.2 -> 0.8.1
Diffstat (limited to 'pkgs/development/ocaml-modules/alcotest')
-rw-r--r--pkgs/development/ocaml-modules/alcotest/default.nix27
1 files changed, 21 insertions, 6 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; {