1{
2 lib,
3 stdenv,
4 fetchurl,
5 ocaml,
6 findlib,
7 ocamlbuild,
8 topkg,
9 uchar,
10 uutf,
11 uunf,
12 uucd,
13}:
14
15let
16 pname = "uucp";
17 version = "16.0.0";
18 webpage = "https://erratique.ch/software/${pname}";
19 minimalOCamlVersion = "4.03";
20 doCheck = true;
21in
22
23if lib.versionOlder ocaml.version minimalOCamlVersion then
24 builtins.throw "${pname} needs at least OCaml ${minimalOCamlVersion}"
25else
26
27 stdenv.mkDerivation {
28
29 name = "ocaml${ocaml.version}-${pname}-${version}";
30
31 src = fetchurl {
32 url = "${webpage}/releases/${pname}-${version}.tbz";
33 hash = "sha256-5//UGI4u3OROYdxtwz9K2vCTzYiN16mOyEFhUQWtgEQ=";
34 };
35
36 nativeBuildInputs = [
37 ocaml
38 findlib
39 ocamlbuild
40 topkg
41 ];
42 buildInputs = [
43 topkg
44 uutf
45 uunf
46 uucd
47 ];
48
49 propagatedBuildInputs = [ uchar ];
50
51 strictDeps = true;
52
53 buildPhase = ''
54 runHook preBuild
55 ${topkg.buildPhase} --with-cmdliner false --tests ${lib.boolToString doCheck}
56 runHook postBuild
57 '';
58
59 inherit (topkg) installPhase;
60
61 inherit doCheck;
62 checkPhase = ''
63 runHook preCheck
64 ${topkg.run} test
65 runHook postCheck
66 '';
67 checkInputs = [ uucd ];
68
69 meta = with lib; {
70 description = "OCaml library providing efficient access to a selection of character properties of the Unicode character database";
71 homepage = webpage;
72 inherit (ocaml.meta) platforms;
73 license = licenses.bsd3;
74 maintainers = [ maintainers.vbgl ];
75 };
76 }