1{ stdenv, fetchFromGitHub, expat, ocaml, findlib, ounit }:
2
3stdenv.mkDerivation rec {
4 name = "ocaml${ocaml.version}-expat-${version}";
5 version = "1.0.0";
6
7 src = fetchFromGitHub {
8 owner = "whitequark";
9 repo = "ocaml-expat";
10 rev = "v${version}";
11 sha256 = "0rb47v08ra2hhh73p3d8sl4sizqwiwc37gnkl22b23sbwbjrpbz0";
12 };
13
14 prePatch = ''
15 substituteInPlace Makefile --replace "gcc" "\$(CC)"
16 '';
17
18 buildInputs = [ ocaml findlib expat ounit ];
19
20 doCheck = !stdenv.lib.versionAtLeast ocaml.version "4.06";
21 checkTarget = "testall";
22
23 createFindlibDestdir = true;
24
25 meta = {
26 description = "OCaml wrapper for the Expat XML parsing library";
27 license = stdenv.lib.licenses.mit;
28 maintainers = [ stdenv.lib.maintainers.vbgl ];
29 inherit (src.meta) homepage;
30 inherit (ocaml.meta) platforms;
31 };
32}