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