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

36 lines
1 KiB
Nix
Raw Normal View History

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