b5bd3497c592464ba3bda80b54a0e458d604a7be
[gentoo.git] / dev-libs / libintl / libintl-0.19.7.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 # Note: Keep version bumps in sync with sys-devel/gettext.
5
6 EAPI="5"
7
8 MY_P="gettext-${PV}"
9
10 inherit multilib-minimal toolchain-funcs libtool ltprune usr-ldscript
11
12 DESCRIPTION="the GNU international library (split out of gettext)"
13 HOMEPAGE="https://www.gnu.org/software/gettext/"
14 SRC_URI="mirror://gnu/gettext/${MY_P}.tar.gz"
15
16 LICENSE="LGPL-2.1+"
17 SLOT="0"
18 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
19 IUSE="static-libs +threads"
20
21 DEPEND=">=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]"
22 # Block C libraries known to provide libintl.
23 RDEPEND="${DEPEND}
24         !sys-libs/glibc
25         !sys-libs/musl
26         !<sys-devel/gettext-0.19.6-r1"
27
28 S="${WORKDIR}/${MY_P}/gettext-runtime"
29
30 src_prepare() {
31         # The libtool files are stored higher up, so make sure we run in the
32         # whole tree and not just the subdir we build.
33         elibtoolize "${WORKDIR}"
34 }
35
36 multilib_src_configure() {
37         local myconf=(
38                 # Emacs support is now in a separate package.
39                 --without-emacs
40                 --without-lispdir
41                 # Normally this controls nls behavior in general, but the libintl
42                 # subdir is skipped unless this is explicitly set.  ugh.
43                 --enable-nls
44                 # This magic flag enables libintl.
45                 --with-included-gettext
46                 # The gettext package provides this library.
47                 --disable-c++
48                 --disable-libasprintf
49                 # No java until someone cares.
50                 --disable-java
51
52                 $(use_enable static-libs static)
53                 $(use_enable threads)
54         )
55         ECONF_SOURCE=${S} econf "${myconf[@]}"
56 }
57
58 multilib_src_compile() {
59         # We only need things in the intl/ subdir.
60         emake -C intl
61 }
62
63 multilib_src_install() {
64         # We only need things in the intl/ subdir.
65         emake DESTDIR="${D}" install -C intl
66
67         gen_usr_ldscript -a intl
68 }
69
70 multilib_src_install_all() {
71         use static-libs || prune_libtool_files --all
72
73         rm -f "${ED}"/usr/share/locale/locale.alias "${ED}"/usr/lib/charset.alias
74
75         dodoc AUTHORS ChangeLog NEWS README
76 }