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

38 lines
1.0 KiB
Nix
Raw Normal View History

2018-09-05 16:11:47 +00:00
{ stdenv, fetchFromGitHub, ocaml, findlib, dune, alcotest, result
, bigstringaf
}:
2018-02-22 17:30:56 +00:00
if !stdenv.lib.versionAtLeast ocaml.version "4.03"
then throw "angstrom is not available for OCaml ${ocaml.version}"
else
2017-06-27 17:28:25 +00:00
2017-02-17 22:18:48 +00:00
stdenv.mkDerivation rec {
version = "0.10.0";
2018-02-22 17:30:56 +00:00
name = "ocaml${ocaml.version}-angstrom-${version}";
2017-02-17 22:18:48 +00:00
src = fetchFromGitHub {
owner = "inhabitedtype";
repo = "angstrom";
rev = "${version}";
sha256 = "0lh6024yf9ds0nh9i93r9m6p5psi8nvrqxl5x7jwl13zb0r9xfpw";
2017-02-17 22:18:48 +00:00
};
2018-09-05 16:11:47 +00:00
buildInputs = [ ocaml findlib dune alcotest ];
propagatedBuildInputs = [ bigstringaf result ];
2018-02-22 17:30:56 +00:00
2018-09-05 16:11:47 +00:00
buildPhase = "dune build -p angstrom";
2018-02-22 17:30:56 +00:00
doCheck = true;
2018-09-05 16:11:47 +00:00
checkPhase = "dune runtest -p angstrom";
2017-02-17 22:18:48 +00:00
2018-09-05 16:11:47 +00:00
inherit (dune) installPhase;
2017-02-17 22:18:48 +00:00
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;
};
}