2021-01-11 12:49:15 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, expat, ocaml, findlib, ounit }:
|
2010-12-31 17:48:55 +00:00
|
|
|
|
2023-05-12 20:35:45 +00:00
|
|
|
lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02")
|
|
|
|
"ocaml_expat is not available for OCaml ${ocaml.version}"
|
|
|
|
|
2016-10-05 07:32:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-02-10 00:28:00 +00:00
|
|
|
pname = "ocaml${ocaml.version}-expat";
|
2023-10-27 05:17:31 +00:00
|
|
|
version = "1.3.0";
|
2017-11-01 23:32:41 +00:00
|
|
|
|
2021-01-21 00:24:35 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "whitequark";
|
|
|
|
repo = "ocaml-expat";
|
|
|
|
rev = "v${version}";
|
2023-10-27 05:17:31 +00:00
|
|
|
hash = "sha256-eDA6MUcztaI+fpunWBdanNnPo9Y5gvbj/ViVcxYYEBg=";
|
2021-01-21 00:24:35 +00:00
|
|
|
};
|
2017-11-01 23:32:41 +00:00
|
|
|
|
2021-01-21 00:24:35 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace Makefile --replace "gcc" "\$(CC)"
|
|
|
|
'';
|
2017-11-01 23:32:41 +00:00
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
2023-05-12 21:09:22 +00:00
|
|
|
buildInputs = [ expat ];
|
2022-02-22 09:59:04 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
2017-11-01 23:32:41 +00:00
|
|
|
|
2023-05-12 21:09:22 +00:00
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.08";
|
2021-01-21 00:24:35 +00:00
|
|
|
checkTarget = "testall";
|
2023-05-12 21:09:22 +00:00
|
|
|
checkInputs = [ ounit ];
|
2017-11-01 23:32:41 +00:00
|
|
|
|
2021-01-21 00:24:35 +00:00
|
|
|
createFindlibDestdir = true;
|
2017-11-01 23:32:41 +00:00
|
|
|
|
2021-01-21 00:24:35 +00:00
|
|
|
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;
|
|
|
|
};
|
2010-12-31 17:48:55 +00:00
|
|
|
}
|