summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>2017-03-20 14:57:26 +0100
committerMichael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>2017-03-20 14:57:26 +0100
commit0f772d919b567c9c879cdf847483bcc66a56a613 (patch)
treebed5cd4f6c40a945506d9dc0d9101d6c5d8502bb
parentmedia-video/ffmpeg: sync with gx86, bug #612366 (diff)
downloadprefix-0f772d919b567c9c879cdf847483bcc66a56a613.tar.gz
prefix-0f772d919b567c9c879cdf847483bcc66a56a613.tar.bz2
prefix-0f772d919b567c9c879cdf847483bcc66a56a613.zip
dev-libs/libintl: hide newlocale behind feature macros
Package-Manager: Portage-2.3.4-prefix, Repoman-2.3.2
-rw-r--r--dev-libs/libintl/files/0.19.8.1-hide-newlocale.patch32
-rw-r--r--dev-libs/libintl/libintl-0.19.8.1-r00.1.ebuild80
2 files changed, 112 insertions, 0 deletions
diff --git a/dev-libs/libintl/files/0.19.8.1-hide-newlocale.patch b/dev-libs/libintl/files/0.19.8.1-hide-newlocale.patch
new file mode 100644
index 0000000000..f6fa8dcc54
--- /dev/null
+++ b/dev-libs/libintl/files/0.19.8.1-hide-newlocale.patch
@@ -0,0 +1,32 @@
+https://savannah.gnu.org/bugs/index.php?50595
+
+From 03d14880627f78cb3b8dd509f85c26bf973b1fcc Mon Sep 17 00:00:00 2001
+From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
+Date: Mon, 20 Mar 2017 13:43:58 +0100
+Subject: [PATCH] libintl.h: expose newlocale when requested only
+
+When available, locale_t is declared by <locale.h> only when either
+(_POSIX_C_SOURCE >= 200809L) or (_XOPEN_SOURCE >= 700), seen on both
+glibc and newlib (Cygwin).
+---
+ gettext-runtime/intl/libgnuintl.in.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gettext-runtime/intl/libgnuintl.in.h b/gettext-runtime/intl/libgnuintl.in.h
+index dc1947f..7d5018c 100644
+--- a/gettext-runtime/intl/libgnuintl.in.h
++++ b/gettext-runtime/intl/libgnuintl.in.h
+@@ -435,7 +435,9 @@ extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
+ extern char *setlocale (int, const char *);
+ #endif
+
+-#if @HAVE_NEWLOCALE@
++#if @HAVE_NEWLOCALE@ && \
++ ( (defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L) || \
++ (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 700) )
+
+ #undef newlocale
+ #define newlocale libintl_newlocale
+--
+2.10.2
+
diff --git a/dev-libs/libintl/libintl-0.19.8.1-r00.1.ebuild b/dev-libs/libintl/libintl-0.19.8.1-r00.1.ebuild
new file mode 100644
index 0000000000..f2b7b245be
--- /dev/null
+++ b/dev-libs/libintl/libintl-0.19.8.1-r00.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Note: Keep version bumps in sync with sys-devel/gettext.
+
+EAPI="5"
+
+MY_P="gettext-${PV}"
+
+inherit multilib-minimal toolchain-funcs libtool
+
+DESCRIPTION="the GNU international library (split out of gettext)"
+HOMEPAGE="https://www.gnu.org/software/gettext/"
+SRC_URI="mirror://gnu/gettext/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="static-libs +threads"
+
+DEPEND=">=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]"
+# Block C libraries known to provide libintl.
+RDEPEND="${DEPEND}
+ !sys-libs/glibc
+ !sys-libs/musl
+ !<sys-devel/gettext-0.19.6-r1"
+
+S="${WORKDIR}/${MY_P}/gettext-runtime"
+
+src_prepare() {
+ epatch "${FILESDIR}"/0.19.3-localename.patch # Cygwin
+ epatch "${FILESDIR}"/0.19.8.1-hide-newlocale.patch # feature test
+
+ # The libtool files are stored higher up, so make sure we run in the
+ # whole tree and not just the subdir we build.
+ elibtoolize "${WORKDIR}"
+}
+
+multilib_src_configure() {
+ local myconf=(
+ # Emacs support is now in a separate package.
+ --without-emacs
+ --without-lispdir
+ # Normally this controls nls behavior in general, but the libintl
+ # subdir is skipped unless this is explicitly set. ugh.
+ --enable-nls
+ # This magic flag enables libintl.
+ --with-included-gettext
+ # The gettext package provides this library.
+ --disable-c++
+ --disable-libasprintf
+ # No java until someone cares.
+ --disable-java
+
+ $(use_enable static-libs static)
+ $(use_enable threads)
+ )
+ ECONF_SOURCE=${S} econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ # We only need things in the intl/ subdir.
+ emake -C intl
+}
+
+multilib_src_install() {
+ # We only need things in the intl/ subdir.
+ emake DESTDIR="${D}" install -C intl
+
+ gen_usr_ldscript -a intl
+}
+
+multilib_src_install_all() {
+ use static-libs || prune_libtool_files --all
+
+ rm -f "${ED}"/usr/share/locale/locale.alias "${ED}"/usr/lib/charset.alias
+
+ dodoc AUTHORS ChangeLog NEWS README
+}