1 |
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit autotools findlib
|
|
6 |
DUNE_PKG_NAME="gettext"
|
|
7 |
inherit dune
|
7 |
8 |
|
8 |
9 |
DESCRIPTION="Provides support for internationalization of OCaml program"
|
9 |
10 |
HOMEPAGE="https://github.com/gildor478/ocaml-gettext"
|
10 |
|
SRC_URI="https://github.com/gildor478/ocaml-gettext/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
|
11 |
SRC_URI="https://github.com/gildor478/ocaml-gettext/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
11 |
12 |
|
12 |
13 |
LICENSE="LGPL-2.1-with-linking-exception"
|
13 |
14 |
SLOT="0/${PV}"
|
14 |
15 |
KEYWORDS="amd64 ~x86"
|
15 |
|
IUSE="doc +ocamlopt test"
|
16 |
|
RESTRICT="!test? ( test )"
|
17 |
|
|
18 |
|
PATCHES=( "${FILESDIR}"/ocaml-unsafe-string.patch )
|
|
16 |
IUSE="+ocamlopt test"
|
|
17 |
RESTRICT="test" # Tests fail
|
19 |
18 |
|
20 |
19 |
BDEPEND="
|
21 |
|
doc? (
|
22 |
|
app-text/docbook-xsl-stylesheets
|
23 |
|
dev-libs/libxslt
|
24 |
|
)
|
|
20 |
>=dev-ml/cppo-1.6.6
|
|
21 |
dev-ml/dune-configurator
|
25 |
22 |
"
|
26 |
|
# OCaml 4.10 does not support -unsafe-string by default
|
27 |
|
# bug #666149
|
|
23 |
|
28 |
24 |
RDEPEND="
|
29 |
|
>=dev-lang/ocaml-3.12.1:=
|
30 |
|
<dev-lang/ocaml-4.10.0:=
|
31 |
|
>=dev-ml/ocaml-fileutils-0.4.0:=
|
32 |
|
>=dev-ml/camomile-0.8.3:=
|
|
25 |
dev-ml/base:=
|
|
26 |
>=dev-ml/ocaml-fileutils-0.4.0:=[ocamlopt=]
|
33 |
27 |
sys-devel/gettext
|
34 |
|
dev-ml/camlp4:=
|
35 |
|
!dev-ml/ocaml-gettext-stub
|
36 |
28 |
"
|
37 |
29 |
DEPEND="
|
38 |
30 |
${RDEPEND}
|
39 |
|
test? ( dev-ml/ounit2 )
|
|
31 |
test? ( dev-ml/ounit2[ocamlopt=] )
|
40 |
32 |
"
|
41 |
33 |
|
42 |
34 |
src_prepare() {
|
43 |
35 |
default
|
44 |
36 |
|
45 |
|
# Porting to dev-ml/ounit2
|
46 |
|
sed -i \
|
47 |
|
-e 's/OCAMLFIND_CHECK_MODULE(oUnit/OCAMLFIND_CHECK_MODULE(ounit2/' \
|
48 |
|
configure.in || die
|
49 |
|
sed -i \
|
50 |
|
-e 's/oUnit/ounit2/' \
|
51 |
|
test/Makefile || die
|
52 |
|
|
53 |
|
eautoreconf
|
54 |
|
}
|
55 |
|
|
56 |
|
src_configure() {
|
57 |
|
econf \
|
58 |
|
--with-docbook-stylesheet="${EPREFIX}/usr/share/sgml/docbook/xsl-stylesheets/" \
|
59 |
|
$(use_enable doc) \
|
60 |
|
$(use_enable test)
|
61 |
|
}
|
62 |
|
|
63 |
|
src_compile() {
|
64 |
|
emake -j1
|
65 |
|
}
|
|
37 |
# Remove dependency on camomile (see
|
|
38 |
# https://github.com/gildor478/ocaml-gettext/issues/14)
|
|
39 |
rm -r src/lib/gettext-camomile || die
|
|
40 |
rm -r test/test-camomile || die
|
66 |
41 |
|
67 |
|
src_install() {
|
68 |
|
findlib_src_preinst
|
69 |
|
emake -j1 DESTDIR="${D}" \
|
70 |
|
BINDIR="${ED}/usr/bin" \
|
71 |
|
PODIR="${ED}/usr/share/locale/" \
|
72 |
|
DOCDIR="${ED}/usr/share/doc/${PF}" \
|
73 |
|
MANDIR="${ED}/usr/share/man" \
|
74 |
|
install
|
75 |
|
dodoc CHANGELOG README THANKS TODO
|
|
42 |
# Port to dev-ml/ounit2
|
|
43 |
sed -i -e 's/oUnit/ounit2/' test/{,common,test-stub}/dune || die
|
76 |
44 |
}
|