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

36 lines
1.0 KiB
Nix
Raw Normal View History

2018-02-22 17:30:56 +00:00
{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, alcotest, result }:
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-02-22 17:30:56 +00:00
version = "0.8.1";
name = "ocaml${ocaml.version}-angstrom-${version}";
2017-02-17 22:18:48 +00:00
src = fetchFromGitHub {
owner = "inhabitedtype";
repo = "angstrom";
rev = "${version}";
2018-02-22 17:30:56 +00:00
sha256 = "067r3vy5lac1bfx947gy722amna3dbcak54nlh24vx87pmcq31qc";
2017-02-17 22:18:48 +00:00
};
2018-02-22 17:30:56 +00:00
buildInputs = [ ocaml findlib jbuilder alcotest ];
propagatedBuildInputs = [ result ];
buildPhase = "jbuilder build -p angstrom";
doCheck = true;
checkPhase = "jbuilder runtest -p angstrom";
2017-02-17 22:18:48 +00:00
2018-02-22 17:30:56 +00:00
inherit (jbuilder) 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;
};
}