nixpkgs/pkgs/development/ocaml-modules/hex/default.nix

35 lines
991 B
Nix
Raw Normal View History

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