1{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, cstruct, result, findlib, ocaml_oasis }:
2
3let param =
4 if stdenv.lib.versionAtLeast ocaml.version "4.03"
5 then {
6 version = "0.5.1";
7 sha256 = "0rm79xyszy9aqvflcc13y9xiya82z31fzmr3b3hx91pmqviymhgc";
8 } else {
9 version = "0.4.0";
10 sha256 = "019s3jwhnswa914bgj1fa6q67k0bl2ahqdaqfnavcbyii8763kh2";
11 };
12in
13
14stdenv.mkDerivation rec {
15 inherit (param) version;
16 name = "ocaml-angstrom-${version}";
17
18 src = fetchFromGitHub {
19 owner = "inhabitedtype";
20 repo = "angstrom";
21 rev = "${version}";
22 inherit (param) sha256;
23 };
24
25 createFindlibDestdir = true;
26
27 buildInputs = [ ocaml ocaml_oasis findlib ocamlbuild ];
28 propagatedBuildInputs = [ result cstruct ];
29
30 meta = {
31 homepage = https://github.com/inhabitedtype/angstrom;
32 description = "OCaml parser combinators built for speed and memory efficiency";
33 license = stdenv.lib.licenses.bsd3;
34 maintainers = with stdenv.lib.maintainers; [ sternenseemann ];
35 inherit (ocaml.meta) platforms;
36 };
37}