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

35 lines
975 B
Nix
Raw Normal View History

2018-09-05 18:11:47 +02:00
{ stdenv, fetchurl, ocaml, findlib, dune, cstruct }:
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
stdenv.mkDerivation {
2017-12-05 06:51:44 +01:00
name = "ocaml${ocaml.version}-hex-${version}";
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";
};
2017-12-05 06:51:44 +01:00
unpackCmd = "tar -xjf $curSrc";
2018-09-05 18:11:47 +02:00
buildInputs = [ ocaml findlib dune ];
2015-06-01 20:41:50 +02:00
propagatedBuildInputs = [ cstruct ];
2017-12-05 06:51:44 +01:00
2018-09-05 18:11:47 +02:00
buildPhase = "dune build -p hex";
2015-12-15 22:02:15 +01:00
doCheck = true;
2017-12-05 06:51:44 +01:00
checkPhase = "jbuilder runtest";
2018-09-05 18:11:47 +02: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 [];
};
}