summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/angstrom/default.nix
blob: c4ed5acbe1b6d11d9d9a210bec6b903345c22945 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, cstruct, result, findlib }:

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

stdenv.mkDerivation rec {
  inherit (param) version;
  name = "ocaml-angstrom-${version}";

  src = fetchFromGitHub {
    owner  = "inhabitedtype";
    repo   = "angstrom";
    rev    = "${version}";
    inherit (param) sha256;
  };

  createFindlibDestdir = true;

  buildInputs = [ ocaml findlib ocamlbuild ];
  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;
  };
}