lol
1{ lib, stdenv, fetchFromGitHub, ocaml, findlib, which, sedlex, easy-format, xmlm, base64 }:
2
3lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
4 "piqi is not available for OCaml ${ocaml.version}"
5
6stdenv.mkDerivation rec {
7 version = "0.6.16";
8 pname = "piqi";
9 name = "ocaml${ocaml.version}-${pname}-${version}";
10
11 src = fetchFromGitHub {
12 owner = "alavrik";
13 repo = pname;
14 rev = "v${version}";
15 sha256 = "sha256-qE+yybTn+kzbY0h8udhZYO+GwQPI/J/6p3LMmF12cFU=";
16 };
17
18 nativeBuildInputs = [ ocaml findlib which ];
19 propagatedBuildInputs = [ sedlex xmlm easy-format base64 ];
20
21 strictDeps = true;
22
23 patches = [ ./no-stream.patch ./no-ocamlpath-override.patch ];
24
25 createFindlibDestdir = true;
26
27 postBuild = "make -C piqilib piqilib.cma";
28
29 installTargets = [ "install" "ocaml-install" ];
30
31 meta = with lib; {
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 ];
36 };
37}