2022-09-20 06:26:09 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, cmdliner
|
|
|
|
, cmdlinerSupport ? lib.versionAtLeast cmdliner.version "1.1"
|
|
|
|
}:
|
|
|
|
|
2014-07-09 07:42:26 +00:00
|
|
|
let
|
|
|
|
pname = "uunf";
|
2019-04-22 08:14:28 +00:00
|
|
|
webpage = "https://erratique.ch/software/${pname}";
|
2022-09-20 06:26:09 +00:00
|
|
|
version = "15.0.0";
|
2014-07-09 07:42:26 +00:00
|
|
|
in
|
2014-09-21 10:02:55 +00:00
|
|
|
|
2022-04-25 20:35:24 +00:00
|
|
|
if lib.versionOlder ocaml.version "4.03"
|
2021-10-06 05:10:37 +00:00
|
|
|
then throw "${pname} is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2014-09-21 10:02:55 +00:00
|
|
|
|
2020-08-14 05:42:07 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-10-06 05:10:37 +00:00
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
2020-08-14 05:42:07 +00:00
|
|
|
inherit version;
|
2014-07-09 07:42:26 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
2022-09-20 06:26:09 +00:00
|
|
|
sha256 = "sha256-B/prPAwfqS8ZPS3fyDDIzXWRbKofwOCyCfwvh9veuug=";
|
2014-07-09 07:42:26 +00:00
|
|
|
};
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
|
2022-09-20 06:26:09 +00:00
|
|
|
buildInputs = [ topkg uutf ]
|
|
|
|
++ lib.optional cmdlinerSupport cmdliner;
|
2016-12-04 10:33:02 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ uchar ];
|
2014-07-09 07:42:26 +00:00
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-01-05 22:55:04 +00:00
|
|
|
prePatch = lib.optionalString stdenv.isAarch64 "ulimit -s 16384";
|
|
|
|
|
2022-09-20 06:26:09 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
${topkg.run} build \
|
|
|
|
--with-uutf true \
|
|
|
|
--with-cmdliner ${lib.boolToString cmdlinerSupport}
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit (topkg) installPhase;
|
2014-07-09 07:42:26 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-07-09 07:42:26 +00:00
|
|
|
description = "An OCaml module for normalizing Unicode text";
|
2019-09-08 23:38:31 +00:00
|
|
|
homepage = webpage;
|
2014-09-21 10:02:55 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2022-05-09 17:30:27 +00:00
|
|
|
mainProgram = "unftrip";
|
|
|
|
inherit (ocaml.meta) platforms;
|
2014-07-09 07:42:26 +00:00
|
|
|
};
|
|
|
|
}
|