2017-11-12 10:14:15 +00:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, cstruct, result, findlib }:
|
2017-02-17 22:18:48 +00:00
|
|
|
|
2017-06-27 18:28:25 +01:00
|
|
|
let param =
|
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.03"
|
|
|
|
then {
|
|
|
|
version = "0.5.1";
|
|
|
|
sha256 = "0rm79xyszy9aqvflcc13y9xiya82z31fzmr3b3hx91pmqviymhgc";
|
|
|
|
} else {
|
|
|
|
version = "0.4.0";
|
|
|
|
sha256 = "019s3jwhnswa914bgj1fa6q67k0bl2ahqdaqfnavcbyii8763kh2";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2017-02-17 22:18:48 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2017-06-27 18:28:25 +01:00
|
|
|
inherit (param) version;
|
2017-02-17 22:18:48 +00:00
|
|
|
name = "ocaml-angstrom-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "inhabitedtype";
|
|
|
|
repo = "angstrom";
|
|
|
|
rev = "${version}";
|
2017-06-27 18:28:25 +01:00
|
|
|
inherit (param) sha256;
|
2017-02-17 22:18:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2017-11-12 10:14:15 +00:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
2017-02-17 22:18:48 +00:00
|
|
|
propagatedBuildInputs = [ result cstruct ];
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|