From 56d651d34724e70da58dcdadb7368f13a2a88055 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 28 Dec 2014 14:27:27 +0100 Subject: [PATCH] Adds ocaml-uuseg Uuseg is an OCaml library for segmenting Unicode text. It implements the locale independent Unicode text segmentation algorithms to detect grapheme cluster, word and sentence boundaries and the Unicode line breaking algorithm to detect line break opportunities. Homepage: http://erratique.ch/software/uuseg --- .../ocaml-modules/uuseg/default.nix | 47 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/ocaml-modules/uuseg/default.nix diff --git a/pkgs/development/ocaml-modules/uuseg/default.nix b/pkgs/development/ocaml-modules/uuseg/default.nix new file mode 100644 index 00000000000..0101c43e504 --- /dev/null +++ b/pkgs/development/ocaml-modules/uuseg/default.nix @@ -0,0 +1,47 @@ +{ stdenv, fetchurl, ocaml, findlib, opam, uucp, uutf, cmdliner }: + +let + inherit (stdenv.lib) getVersion versionAtLeast; + + pname = "uuseg"; + version = "0.8.0"; + webpage = "http://erratique.ch/software/${pname}"; +in + +assert versionAtLeast (getVersion ocaml) "4.01"; + +stdenv.mkDerivation { + + name = "ocaml-${pname}-${version}"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "00n4zi8dyw2yzi4nr2agcrr33b0q4dr9mgnkczipf4c0gm5cm50h"; + }; + + buildInputs = [ ocaml findlib opam cmdliner ]; + propagatedBuildInputs = [ uucp uutf ]; + + createFindlibDestdir = true; + + unpackCmd = "tar xjf $src"; + + buildPhase = '' + ocaml pkg/build.ml \ + native=true native-dynlink=true \ + uutf=true cmdliner=true + ''; + + installPhase = '' + opam-installer --script --prefix=$out ${pname}.install | sh + ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname} + ''; + + meta = with stdenv.lib; { + description = "An OCaml library for segmenting Unicode text"; + homepage = "${webpage}"; + platforms = ocaml.meta.platforms; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 58e2f1673f4..07d0f6938c7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3820,6 +3820,7 @@ let uucd = callPackage ../development/ocaml-modules/uucd { }; uucp = callPackage ../development/ocaml-modules/uucp { }; uunf = callPackage ../development/ocaml-modules/uunf { }; + uuseg = callPackage ../development/ocaml-modules/uuseg { }; uutf = callPackage ../development/ocaml-modules/uutf { }; vg = callPackage ../development/ocaml-modules/vg { };