3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ocaml-modules/angstrom/default.nix
2018-07-29 07:47:21 +00:00

38 lines
1 KiB
Nix

{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, alcotest, result
, bigstringaf
}:
if !stdenv.lib.versionAtLeast ocaml.version "4.03"
then throw "angstrom is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
version = "0.10.0";
name = "ocaml${ocaml.version}-angstrom-${version}";
src = fetchFromGitHub {
owner = "inhabitedtype";
repo = "angstrom";
rev = "${version}";
sha256 = "0lh6024yf9ds0nh9i93r9m6p5psi8nvrqxl5x7jwl13zb0r9xfpw";
};
buildInputs = [ ocaml findlib jbuilder alcotest ];
propagatedBuildInputs = [ bigstringaf result ];
buildPhase = "jbuilder build -p angstrom";
doCheck = true;
checkPhase = "jbuilder runtest -p angstrom";
inherit (jbuilder) installPhase;
meta = {
homepage = https://github.com/inhabitedtype/angstrom;
description = "OCaml parser combinators built for speed and memory efficiency";
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ sternenseemann ];
inherit (ocaml.meta) platforms;
};
}