2022-09-22 12:36:57 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uucp, uutf, cmdliner
|
2024-02-07 01:22:34 +00:00
|
|
|
, version ? if lib.versionAtLeast ocaml.version "4.14" then "15.1.0" else "15.0.0"
|
2022-09-22 12:36:57 +00:00
|
|
|
, cmdlinerSupport ? lib.versionAtLeast cmdliner.version "1.1"
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "uuseg";
|
|
|
|
webpage = "https://erratique.ch/software/${pname}";
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = {
|
|
|
|
"15.1.0" = "sha256-IPI3Wd51HzX4n+uGcgc04us29jMjnKbGgVEAdp0CVMU=";
|
|
|
|
"15.0.0" = "sha256-q8x3bia1QaKpzrWFxUmLWIraKqby7TuPNGvbSjkY4eM=";
|
|
|
|
}."${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
|
2022-09-22 12:36:57 +00:00
|
|
|
buildInputs = [ topkg uutf ]
|
|
|
|
++ lib.optional cmdlinerSupport cmdliner;
|
2021-10-06 13:57:05 +00:00
|
|
|
propagatedBuildInputs = [ uucp ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
${topkg.run} build \
|
|
|
|
--with-uutf true \
|
|
|
|
--with-cmdliner ${lib.boolToString cmdlinerSupport}
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit (topkg) installPhase;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "OCaml library for segmenting Unicode text";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = webpage;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "usegtrip";
|
|
|
|
inherit (ocaml.meta) platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|