2018-09-05 17:11:47 +01:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, dune, cstruct }:
|
2015-01-23 08:15:08 +00:00
|
|
|
|
2017-12-05 05:51:44 +00: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 08:15:08 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2017-12-05 05:51:44 +00:00
|
|
|
name = "ocaml${ocaml.version}-hex-${version}";
|
2015-01-23 08:15:08 +00:00
|
|
|
|
2017-12-05 05:51:44 +00: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 08:15:08 +00:00
|
|
|
};
|
|
|
|
|
2017-12-05 05:51:44 +00:00
|
|
|
unpackCmd = "tar -xjf $curSrc";
|
|
|
|
|
2018-09-05 17:11:47 +01:00
|
|
|
buildInputs = [ ocaml findlib dune ];
|
2015-06-01 19:41:50 +01:00
|
|
|
propagatedBuildInputs = [ cstruct ];
|
2017-12-05 05:51:44 +00:00
|
|
|
|
2018-09-05 17:11:47 +01:00
|
|
|
buildPhase = "dune build -p hex";
|
2015-12-15 21:02:15 +00:00
|
|
|
doCheck = true;
|
2017-12-05 05:51:44 +00:00
|
|
|
checkPhase = "jbuilder runtest";
|
2018-09-05 17:11:47 +01:00
|
|
|
inherit (dune) installPhase;
|
2015-01-23 08:15:08 +00: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 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-01-23 08:15:08 +00:00
|
|
|
};
|
|
|
|
}
|