summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/expat/default.nix
blob: 1812473e78bfc36c0306c2cf24b95f1c4e524bff (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
{ stdenv, lib, fetchFromGitHub, expat, ocaml, findlib, ounit }:

stdenv.mkDerivation rec {
  name = "ocaml${ocaml.version}-expat-${version}";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "whitequark";
    repo = "ocaml-expat";
    rev = "v${version}";
    sha256 = "07wm9663z744ya6z2lhiz5hbmc76kkipg04j9vw9dqpd1y1f2x3q";
  };

  prePatch = ''
    substituteInPlace Makefile --replace "gcc" "\$(CC)"
  '';

  buildInputs = [ ocaml findlib expat ounit ];

  doCheck = !lib.versionAtLeast ocaml.version "4.06";
  checkTarget = "testall";

  createFindlibDestdir = true;

  meta = {
    description = "OCaml wrapper for the Expat XML parsing library";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.vbgl ];
    inherit (src.meta) homepage;
    inherit (ocaml.meta) platforms;
  };
}