1 { lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf, cmdliner
2 , cmdlinerSupport ? lib.versionAtLeast cmdliner.version "1.1"
3 , version ? if lib.versionAtLeast ocaml.version "4.14" then "15.1.0" else "15.0.0"
8 webpage = "https://erratique.ch/software/${pname}";
10 "15.0.0" = "sha256-B/prPAwfqS8ZPS3fyDDIzXWRbKofwOCyCfwvh9veuug=";
11 "15.1.0" = "sha256-D8yvb7hVWaYxMqMZ5089/5tWDfvyGXKUOjhfU/4zSeQ=";
15 if lib.versionOlder ocaml.version "4.03"
16 then throw "${pname} is not available for OCaml ${ocaml.version}"
20 name = "ocaml${ocaml.version}-${pname}-${version}";
24 url = "${webpage}/releases/${pname}-${version}.tbz";
28 nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
29 buildInputs = [ topkg uutf ]
30 ++ lib.optional cmdlinerSupport cmdliner;
34 prePatch = lib.optionalString stdenv.isAarch64 "ulimit -s 16384";
40 --with-cmdliner ${lib.boolToString cmdlinerSupport}
44 inherit (topkg) installPhase;
47 description = "An OCaml module for normalizing Unicode text";
49 license = licenses.bsd3;
50 maintainers = [ maintainers.vbgl ];
51 mainProgram = "unftrip";
52 inherit (ocaml.meta) platforms;