Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
2let
3 pname = "xmlm";
4 webpage = "https://erratique.ch/software/${pname}";
5in
6
7if lib.versionOlder ocaml.version "4.05"
8then throw "xmlm is not available for OCaml ${ocaml.version}"
9else
10
11stdenv.mkDerivation rec {
12 name = "ocaml${ocaml.version}-${pname}-${version}";
13 version = "1.4.0";
14
15 src = fetchurl {
16 url = "${webpage}/releases/${pname}-${version}.tbz";
17 sha256 = "sha256-CRJSJY490WMgw85N2yG81X79nIwuv7eZ7mpUPtSS2fo=";
18 };
19
20 nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
21 buildInputs = [ topkg ];
22
23 strictDeps = true;
24
25 inherit (topkg) buildPhase installPhase;
26
27 meta = with lib; {
28 description = "An OCaml streaming codec to decode and encode the XML data format";
29 homepage = webpage;
30 license = licenses.isc;
31 maintainers = [ maintainers.vbgl ];
32 mainProgram = "xmltrip";
33 inherit (ocaml.meta) platforms;
34 };
35}