1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION="Non-blocking streaming Unicode codec for OCaml"
9 HOMEPAGE="http://erratique.ch/software/uutf"
10 SRC_URI="http://erratique.ch/software/uutf/releases/${P}.tbz"
14 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
15 IUSE="doc utftrip +ocamlopt test"
16 RESTRICT="!test? ( test )"
18 RDEPEND=">=dev-lang/ocaml-3.12:=[ocamlopt?]
20 utftrip? ( dev-ml/cmdliner:= )"
24 test? ( dev-ml/cmdliner )"
27 ocaml pkg/pkg.ml build \
28 --with-cmdliner "$(usex utftrip true false)" \
33 if use ocamlopt ; then
34 ocamlbuild -use-ocamlfind tests.otarget || die
35 pushd _build/test || die
37 #Rebuild to avoid mismatches between installed files, bug #604674
39 ocaml pkg/pkg.ml build \
40 --with-cmdliner "$(usex utftrip true false)" \
43 ewarn "Sorry, ${PN} tests require native support (ocamlopt)"
48 # Can't use opam-installer here as it is an opam dep...
51 use ocamlopt && nativelibs="$(echo _build/src/uutf.cm{x,xa,xs} _build/src/uutf.a)"
52 ocamlfind install uutf _build/pkg/META _build/src/uutf.mli _build/src/uutf.cm{a,i} ${nativelibs} || die
53 use utftrip && newbin utftrip.$(usex ocamlopt native byte) utftrip
54 dodoc CHANGES.md README.md
55 use doc && dohtml -r doc/*