2017-12-05 06:51:44 +01:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, jbuilder, cstruct }:
|
2015-01-23 09:15:08 +01:00
|
|
|
|
2017-12-05 06:51:44 +01:00
|
|
|
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
|
2015-01-23 09:15:08 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2017-12-05 06:51:44 +01:00
|
|
|
name = "ocaml${ocaml.version}-hex-${version}";
|
2015-01-23 09:15:08 +01:00
|
|
|
|
2017-12-05 06:51:44 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/mirage/ocaml-hex/releases/download/v1.2.0/hex-1.2.0.tbz";
|
|
|
|
sha256 = "17hqf7z5afp2z2c55fk5myxkm7cm74259rqm94hcxkqlpdaqhm8h";
|
2015-01-23 09:15:08 +01:00
|
|
|
};
|
|
|
|
|
2017-12-05 06:51:44 +01:00
|
|
|
unpackCmd = "tar -xjf $curSrc";
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib jbuilder ];
|
2015-06-01 20:41:50 +02:00
|
|
|
propagatedBuildInputs = [ cstruct ];
|
2017-12-05 06:51:44 +01:00
|
|
|
|
|
|
|
buildPhase = "jbuilder build -p hex";
|
2015-12-15 22:02:15 +01:00
|
|
|
doCheck = true;
|
2017-12-05 06:51:44 +01:00
|
|
|
checkPhase = "jbuilder runtest";
|
|
|
|
inherit (jbuilder) installPhase;
|
2015-01-23 09:15:08 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Mininal OCaml library providing hexadecimal converters";
|
|
|
|
homepage = https://github.com/mirage/ocaml-hex;
|
|
|
|
license = stdenv.lib.licenses.isc;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ vbgl ];
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-01-23 09:15:08 +01:00
|
|
|
};
|
|
|
|
}
|