2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, unzip, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, cmdliner, uucd }:
|
2014-07-09 09:42:26 +02:00
|
|
|
let
|
|
|
|
pname = "uunf";
|
2019-04-22 10:14:28 +02:00
|
|
|
webpage = "https://erratique.ch/software/${pname}";
|
2020-08-14 07:42:07 +02:00
|
|
|
version = "13.0.0";
|
|
|
|
ucdxml = fetchurl {
|
|
|
|
url = "http://www.unicode.org/Public/${version}/ucdxml/ucd.all.grouped.zip";
|
|
|
|
sha256 = "04gpl09ggb6fb0kmk6298rd8184dv6vcscn28l1gpdv1yjlw1a8q";
|
|
|
|
};
|
|
|
|
gen = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/dbuenzli/uunf/v12.0.0/support/gen.ml";
|
|
|
|
sha256 = "08j2mpi7j6q3rqc6bcdwspqn1s7pkkphznxfdycqjv4h9yaqsymj";
|
|
|
|
};
|
|
|
|
gen_norm = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/dbuenzli/uunf/v12.0.0/support/gen_norm.ml";
|
|
|
|
sha256 = "11vx5l5bag6bja7qj8jv4s2x9fknj3557n0mj87k2apq5gs5f4m5";
|
|
|
|
};
|
|
|
|
gen_props = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/dbuenzli/uunf/v12.0.0/support/gen_props.ml";
|
|
|
|
sha256 = "0a6lhja498kp9lxql0pbfvkgvajs10wx88wkqc7y5m3lrvw46268";
|
|
|
|
};
|
2014-07-09 09:42:26 +02:00
|
|
|
in
|
2014-09-21 12:02:55 +02:00
|
|
|
|
2021-01-11 13:49:15 +01:00
|
|
|
assert lib.versionAtLeast ocaml.version "4.03";
|
2014-09-21 12:02:55 +02:00
|
|
|
|
2020-08-14 07:42:07 +02:00
|
|
|
stdenv.mkDerivation {
|
2014-07-09 09:42:26 +02:00
|
|
|
name = "ocaml-${pname}-${version}";
|
2020-08-14 07:42:07 +02:00
|
|
|
inherit version;
|
2014-07-09 09:42:26 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
2020-08-08 10:32:27 +02:00
|
|
|
sha256 = "1qci04nkp24kdls1z4s8kz5dzgky4nwd5r8345nwdrgwmxhw7ksm";
|
2014-07-09 09:42:26 +02:00
|
|
|
};
|
|
|
|
|
2020-08-14 07:42:07 +02:00
|
|
|
postConfigure = ''
|
|
|
|
rm -f src/uunf_data.ml
|
|
|
|
mkdir -p support/
|
|
|
|
cp ${gen} support/gen.ml
|
|
|
|
cp ${gen_norm} support/gen_norm.ml
|
|
|
|
cp ${gen_props} support/gen_props.ml
|
|
|
|
funzip ${ucdxml} > support/ucd.xml
|
|
|
|
ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/build_support.ml
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ocamlbuild topkg uutf cmdliner uucd ];
|
2016-12-04 11:33:02 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ uchar ];
|
2014-07-09 09:42:26 +02:00
|
|
|
|
2016-12-04 11:33:02 +01:00
|
|
|
inherit (topkg) buildPhase installPhase;
|
2014-07-09 09:42:26 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2014-07-09 09:42:26 +02:00
|
|
|
description = "An OCaml module for normalizing Unicode text";
|
2019-09-09 01:38:31 +02:00
|
|
|
homepage = webpage;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-09-21 12:02:55 +02:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2014-07-09 09:42:26 +02:00
|
|
|
};
|
|
|
|
}
|