2022-09-19 16:46:45 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uucp, uutf, cmdliner
|
|
|
|
, cmdlinerSupport ? lib.versionAtLeast cmdliner.version "1.1"
|
|
|
|
}:
|
2014-12-28 13:27:27 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "uuseg";
|
2019-04-22 08:14:28 +00:00
|
|
|
webpage = "https://erratique.ch/software/${pname}";
|
2014-12-28 13:27:27 +00:00
|
|
|
in
|
|
|
|
|
2016-12-04 10:55:37 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2014-12-28 13:27:27 +00:00
|
|
|
|
2016-12-04 10:55:37 +00:00
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
2022-09-19 16:46:45 +00:00
|
|
|
version = "15.0.0";
|
2014-12-28 13:27:27 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
2022-09-19 16:46:45 +00:00
|
|
|
sha256 = "sha256-q8x3bia1QaKpzrWFxUmLWIraKqby7TuPNGvbSjkY4eM=";
|
2014-12-28 13:27:27 +00:00
|
|
|
};
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
|
2022-09-19 16:46:45 +00:00
|
|
|
buildInputs = [ topkg uutf ]
|
|
|
|
++ lib.optional cmdlinerSupport cmdliner;
|
2021-10-03 20:03:56 +00:00
|
|
|
propagatedBuildInputs = [ uucp ];
|
2014-12-28 13:27:27 +00:00
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-09-19 16:46:45 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
${topkg.run} build \
|
|
|
|
--with-uutf true \
|
|
|
|
--with-cmdliner ${lib.boolToString cmdlinerSupport}
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit (topkg) installPhase;
|
2014-12-28 13:27:27 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-12-28 13:27:27 +00:00
|
|
|
description = "An OCaml library for segmenting Unicode text";
|
2019-09-08 23:38:31 +00:00
|
|
|
homepage = webpage;
|
2014-12-28 13:27:27 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2022-05-09 17:30:27 +00:00
|
|
|
mainProgram = "usegtrip";
|
|
|
|
inherit (ocaml.meta) platforms;
|
2014-12-28 13:27:27 +00:00
|
|
|
};
|
|
|
|
}
|