@@ -0,0 +1,42 @@
1+{ stdenv, fetchurl, ocaml, findlib, opam }:
2+
3+let
4+ inherit (stdenv.lib) getVersion versionAtLeast;
5+
6+ pname = "uucp";
7+ version = "0.9.0";
8+ webpage = "http://erratique.ch/software/${pname}";
9+in
10+
11+assert versionAtLeast (getVersion ocaml) "4.00";
12+
13+stdenv.mkDerivation {
14+
15+ name = "ocaml-${pname}-${version}";
16+
17+ src = fetchurl {
18+ url = "${webpage}/releases/${pname}-${version}.tbz";
19+ sha256 = "1cwjr16cg03h30r97lnb32g725qi7ma76kr2aly5smc3m413dhqy";
20+ };
21+
22+ buildInputs = [ ocaml findlib opam ];
23+
24+ createFindlibDestdir = true;
25+
26+ unpackCmd = "tar xjf $src";
27+
28+ buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
29+
30+ installPhase = ''
31+ opam-installer --script --prefix=$out ${pname}.install | sh
32+ ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname}
33+ '';
34+
35+ meta = with stdenv.lib; {
36+ description = "An OCaml library providing efficient access to a selection of character properties of the Unicode character database";
37+ homepage = "${webpage}";
38+ platforms = ocaml.meta.platforms;
39+ license = licenses.bsd3;
40+ maintainers = [ maintainers.vbgl ];
41+ };
42+}