Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 ocaml, 6 findlib, 7 which, 8 sedlex, 9 easy-format, 10 xmlm, 11 base64, 12}: 13 14lib.throwIf (lib.versionAtLeast ocaml.version "5.0") 15 "piqi is not available for OCaml ${ocaml.version}" 16 17 stdenv.mkDerivation 18 rec { 19 version = "0.6.16"; 20 pname = "piqi"; 21 name = "ocaml${ocaml.version}-${pname}-${version}"; 22 23 src = fetchFromGitHub { 24 owner = "alavrik"; 25 repo = pname; 26 rev = "v${version}"; 27 sha256 = "sha256-qE+yybTn+kzbY0h8udhZYO+GwQPI/J/6p3LMmF12cFU="; 28 }; 29 30 nativeBuildInputs = [ 31 ocaml 32 findlib 33 which 34 ]; 35 propagatedBuildInputs = [ 36 sedlex 37 xmlm 38 easy-format 39 base64 40 ]; 41 42 strictDeps = true; 43 44 patches = [ 45 ./no-stream.patch 46 ./no-ocamlpath-override.patch 47 ]; 48 49 createFindlibDestdir = true; 50 51 postBuild = "make -C piqilib piqilib.cma"; 52 53 installTargets = [ 54 "install" 55 "ocaml-install" 56 ]; 57 58 meta = with lib; { 59 homepage = "https://piqi.org"; 60 description = "Universal schema language and a collection of tools built around it"; 61 license = licenses.asl20; 62 maintainers = [ maintainers.maurer ]; 63 }; 64 }