about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-12-05 05:51:44 +0000
committerVincent Laporte <vbgl@users.noreply.github.com>2017-12-06 07:59:20 +0100
commit39af54f10344285a86bcf4153ecd20d52f75e1b1 (patch)
tree1900664a002cb926e4ac8a0e0bf287985b0e82db /pkgs/development/ocaml-modules
parent6334a85cee89dd2fe89beeb17f0128f6081b4d87 (diff)
downloadnixlib-39af54f10344285a86bcf4153ecd20d52f75e1b1.tar
nixlib-39af54f10344285a86bcf4153ecd20d52f75e1b1.tar.gz
nixlib-39af54f10344285a86bcf4153ecd20d52f75e1b1.tar.bz2
nixlib-39af54f10344285a86bcf4153ecd20d52f75e1b1.tar.lz
nixlib-39af54f10344285a86bcf4153ecd20d52f75e1b1.tar.xz
nixlib-39af54f10344285a86bcf4153ecd20d52f75e1b1.tar.zst
nixlib-39af54f10344285a86bcf4153ecd20d52f75e1b1.zip
ocamlPackages.hex: 1.0.0 -> 1.2.0
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/hex/default.nix27
1 files changed, 17 insertions, 10 deletions
diff --git a/pkgs/development/ocaml-modules/hex/default.nix b/pkgs/development/ocaml-modules/hex/default.nix
index 56d5e07f1d19..596f6a0fa531 100644
--- a/pkgs/development/ocaml-modules/hex/default.nix
+++ b/pkgs/development/ocaml-modules/hex/default.nix
@@ -1,21 +1,28 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, cstruct }:
+{ stdenv, fetchurl, ocaml, findlib, jbuilder, cstruct }:
 
-let version = "1.0.0"; in
+if !stdenv.lib.versionAtLeast ocaml.version "4.02"
+then throw "hex is not available for OCaml ${ocaml.version}"
+else
+
+let version = "1.2.0"; in
 
 stdenv.mkDerivation {
-  name = "ocaml-hex-${version}";
+  name = "ocaml${ocaml.version}-hex-${version}";
 
-  src = fetchzip {
-    url = "https://github.com/mirage/ocaml-hex/archive/${version}.tar.gz";
-    sha256 = "0g4cq4bsksga15fa5ln083gkglawknbnhi2s4k8yk0yi5xngvwm4";
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-hex/releases/download/v1.2.0/hex-1.2.0.tbz";
+    sha256 = "17hqf7z5afp2z2c55fk5myxkm7cm74259rqm94hcxkqlpdaqhm8h";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild ];
+  unpackCmd = "tar -xjf $curSrc";
+
+  buildInputs = [ ocaml findlib jbuilder ];
   propagatedBuildInputs = [ cstruct ];
-  configureFlags = "--enable-tests";
+
+  buildPhase = "jbuilder build -p hex";
   doCheck = true;
-  checkTarget = "test";
-  createFindlibDestdir = true;
+  checkPhase = "jbuilder runtest";
+  inherit (jbuilder) installPhase;
 
   meta = {
     description = "Mininal OCaml library providing hexadecimal converters";