From 39af54f10344285a86bcf4153ecd20d52f75e1b1 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 5 Dec 2017 05:51:44 +0000 Subject: ocamlPackages.hex: 1.0.0 -> 1.2.0 --- pkgs/development/ocaml-modules/hex/default.nix | 27 ++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'pkgs/development/ocaml-modules') 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"; -- cgit 1.4.1