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

35 lines
975 B
Nix
Raw Normal View History

2018-09-05 17:11:47 +01:00
{ stdenv, fetchurl, ocaml, findlib, dune, 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";
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;
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 [];
};
}