2021-01-11 13:49:15 +01:00
|
|
|
{stdenv, lib, fetchurl, ocaml, findlib, ounit, expat}:
|
2017-11-02 00:32:41 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "ocaml-expat";
|
|
|
|
testcase = fetchurl {
|
|
|
|
url = "http://www.w3.org/TR/1998/REC-xml-19980210.xml";
|
|
|
|
sha256 = "00a3gsfvlkdhmcbziqhvpvy1zmcgbcihfqwcvl6ay03zf7gvw0k1";
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
version = "0.9.1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.xs4all.nl/~mmzeeman/ocaml/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "16n2j3y0jc9xgqyshw9plrwqnjiz30vnpbhahmgxlidbycw8rgjz";
|
|
|
|
};
|
|
|
|
|
2022-02-22 10:59:04 +01:00
|
|
|
nativeBuildInputs = [ocaml findlib ];
|
|
|
|
buildInputs = [ ounit expat];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2017-11-02 00:32:41 +01:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
patches = [ ./unittest.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace "unittest.ml" \
|
|
|
|
--replace "/home/maas/xml-samples/REC-xml-19980210.xml.txt" "${testcase}"
|
|
|
|
substituteInPlace Makefile --replace "EXPAT_LIBDIR=/usr/local/lib" "EXPAT_LIBDIR=${expat.out}/lib" \
|
|
|
|
--replace "EXPAT_INCDIR=/usr/local/include" "EXPAT_INCDIR=${expat.dev}/include" \
|
|
|
|
--replace "gcc" "\$(CC)"
|
|
|
|
'';
|
|
|
|
|
2019-06-19 17:36:06 +02:00
|
|
|
dontConfigure = true; # Skip configure
|
2017-11-02 00:32:41 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make all allopt
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkTarget = "testall";
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.xs4all.nl/~mmzeeman/ocaml/";
|
2017-11-02 00:32:41 +01:00
|
|
|
description = "An ocaml wrapper for the Expat XML parsing library";
|
2021-01-11 13:49:15 +01:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.roconnor ];
|
2017-11-02 00:32:41 +01:00
|
|
|
};
|
|
|
|
}
|