1 { lib, stdenv, fetchFromGitHub, ocaml, findlib, which, sedlex, easy-format, xmlm, base64 }:
3 lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
4 "piqi is not available for OCaml ${ocaml.version}"
6 stdenv.mkDerivation rec {
9 name = "ocaml${ocaml.version}-${pname}-${version}";
11 src = fetchFromGitHub {
15 sha256 = "sha256-qE+yybTn+kzbY0h8udhZYO+GwQPI/J/6p3LMmF12cFU=";
18 nativeBuildInputs = [ ocaml findlib which ];
19 propagatedBuildInputs = [ sedlex xmlm easy-format base64 ];
23 patches = [ ./no-stream.patch ./no-ocamlpath-override.patch ];
25 createFindlibDestdir = true;
27 postBuild = "make -C piqilib piqilib.cma";
29 installTargets = [ "install" "ocaml-install" ];
32 homepage = "https://piqi.org";
33 description = "Universal schema language and a collection of tools built around it";
34 license = licenses.asl20;
35 maintainers = [ maintainers.maurer ];