1{stdenv, fetchurl, ocaml, findlib, opam}:
2let
3 pname = "xmlm";
4 version = "1.2.0";
5 webpage = "http://erratique.ch/software/${pname}";
6 ocaml_version = (builtins.parseDrvName ocaml.name).version;
7in
8
9assert stdenv.lib.versionAtLeast ocaml_version "3.12";
10
11stdenv.mkDerivation rec {
12
13 name = "ocaml-${pname}-${version}";
14
15 src = fetchurl {
16 url = "${webpage}/releases/${pname}-${version}.tbz";
17 sha256 = "1jywcrwn5z3gkgvicr004cxmdaqfmq8wh72f81jqz56iyn5024nh";
18 };
19
20 buildInputs = [ ocaml findlib opam ];
21
22 createFindlibDestdir = true;
23
24 unpackCmd = "tar xjf $src";
25
26 buildPhase = "./pkg/build true";
27
28 installPhase = ''
29 opam-installer --script --prefix=$out ${pname}.install > install.sh
30 sh install.sh
31 ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml_version}/site-lib/
32 '';
33
34 meta = with stdenv.lib; {
35 description = "An OCaml streaming codec to decode and encode the XML data format";
36 homepage = "${webpage}";
37 platforms = ocaml.meta.platforms or [];
38 maintainers = [ maintainers.vbgl ];
39 license = licenses.bsd3;
40 };
41}