lol

ocamlPackages.hex: 1.0.0 -> 1.2.0

authored by

Vincent Laporte and committed by
Vincent Laporte
39af54f1 6334a85c

+17 -10
+17 -10
pkgs/development/ocaml-modules/hex/default.nix
··· 1 - { stdenv, fetchzip, ocaml, findlib, ocamlbuild, cstruct }: 1 + { stdenv, fetchurl, ocaml, findlib, jbuilder, cstruct }: 2 2 3 - let version = "1.0.0"; in 3 + if !stdenv.lib.versionAtLeast ocaml.version "4.02" 4 + then throw "hex is not available for OCaml ${ocaml.version}" 5 + else 6 + 7 + let version = "1.2.0"; in 4 8 5 9 stdenv.mkDerivation { 6 - name = "ocaml-hex-${version}"; 10 + name = "ocaml${ocaml.version}-hex-${version}"; 7 11 8 - src = fetchzip { 9 - url = "https://github.com/mirage/ocaml-hex/archive/${version}.tar.gz"; 10 - sha256 = "0g4cq4bsksga15fa5ln083gkglawknbnhi2s4k8yk0yi5xngvwm4"; 12 + src = fetchurl { 13 + url = "https://github.com/mirage/ocaml-hex/releases/download/v1.2.0/hex-1.2.0.tbz"; 14 + sha256 = "17hqf7z5afp2z2c55fk5myxkm7cm74259rqm94hcxkqlpdaqhm8h"; 11 15 }; 12 16 13 - buildInputs = [ ocaml findlib ocamlbuild ]; 17 + unpackCmd = "tar -xjf $curSrc"; 18 + 19 + buildInputs = [ ocaml findlib jbuilder ]; 14 20 propagatedBuildInputs = [ cstruct ]; 15 - configureFlags = "--enable-tests"; 21 + 22 + buildPhase = "jbuilder build -p hex"; 16 23 doCheck = true; 17 - checkTarget = "test"; 18 - createFindlibDestdir = true; 24 + checkPhase = "jbuilder runtest"; 25 + inherit (jbuilder) installPhase; 19 26 20 27 meta = { 21 28 description = "Mininal OCaml library providing hexadecimal converters";