1{stdenv, fetchurl, ocaml, findlib}:
2let
3 pname = "xml-light";
4 version = "2.4";
5in
6stdenv.mkDerivation {
7 name = "ocaml-${pname}-${version}";
8
9 src = fetchurl {
10 url = "https://github.com/ncannasse/${pname}/archive/${version}.tar.gz";
11 sha256 = "10b55qf6mvdp11ny3h0jv6k6wrs78jr9lhsiswl0xya7z8r8j0a2";
12 };
13
14 buildInputs = [ ocaml findlib ];
15
16 createFindlibDestdir = true;
17
18 buildPhase = ''
19 make all
20 make opt
21 '';
22
23 installPhase = ''
24 make install_ocamlfind
25 mkdir -p $out/share
26 cp -vai doc $out/share/
27 '';
28
29 meta = {
30 description = "Minimal Xml parser and printer for OCaml";
31 longDescription = ''
32 Xml-Light provides functions to parse an XML document into an OCaml
33 data structure, work with it, and print it back to an XML
34 document. It support also DTD parsing and checking, and is
35 entirely written in OCaml, hence it does not require additional C
36 library.
37 '';
38 homepage = "http://tech.motion-twin.com/xmllight.html";
39 license = stdenv.lib.licenses.lgpl21;
40 maintainers = [ stdenv.lib.maintainers.romildo ];
41 platforms = ocaml.meta.platforms or [];
42 };
43}