2018-09-05 17:11:47 +01:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, dune, alcotest, result
|
2018-07-22 07:15:10 +01:00
|
|
|
, 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 18:28:25 +01:00
|
|
|
|
2017-02-17 22:18:48 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-07-22 07:15:10 +01:00
|
|
|
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}";
|
2018-07-22 07:15:10 +01:00
|
|
|
sha256 = "0lh6024yf9ds0nh9i93r9m6p5psi8nvrqxl5x7jwl13zb0r9xfpw";
|
2017-02-17 22:18:48 +00:00
|
|
|
};
|
|
|
|
|
2018-09-05 17:11:47 +01:00
|
|
|
buildInputs = [ ocaml findlib dune alcotest ];
|
2018-07-22 07:15:10 +01:00
|
|
|
propagatedBuildInputs = [ bigstringaf result ];
|
2018-02-22 17:30:56 +00:00
|
|
|
|
2018-09-05 17:11:47 +01:00
|
|
|
buildPhase = "dune build -p angstrom";
|
2018-02-22 17:30:56 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2018-09-05 17:11:47 +01:00
|
|
|
checkPhase = "dune runtest -p angstrom";
|
2017-02-17 22:18:48 +00:00
|
|
|
|
2018-09-05 17:11:47 +01: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;
|
|
|
|
};
|
|
|
|
}
|