app-shells/fish: add nls support
authorGeorgy Yakovlev <ya@sysdump.net>
Fri, 24 Feb 2017 06:34:59 +0000 (22:34 -0800)
committerLars Wendler <polynomial-c@gentoo.org>
Fri, 3 Mar 2017 13:12:22 +0000 (14:12 +0100)
This adds nls useflag and includes
backported upstream patch to honor LINGUAS.
Fixes bug 409969.
Closes: https://github.com/gentoo/gentoo/pull/4072

app-shells/fish/files/fish-2.5.0-honor-linguas.patch [new file with mode: 0644]
app-shells/fish/fish-2.5.0.ebuild

diff --git a/app-shells/fish/files/fish-2.5.0-honor-linguas.patch b/app-shells/fish/files/fish-2.5.0-honor-linguas.patch
new file mode 100644 (file)
index 0000000..843036d
--- /dev/null
@@ -0,0 +1,32 @@
+diff --git a/Makefile.in b/Makefile.in
+index 35e63ae..b73c612 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -195,11 +195,16 @@ ifeq ($(shell uname), Darwin)
+ endif
+ #
+-# All translation message catalogs
++# All translation message catalogs, filter files based on LINGUAS.
+ #
+ TRANSLATIONS_SRC := $(wildcard po/*.po)
+-ifdef HAVE_GETTEXT
++ifeq ($(HAVE_GETTEXT), 1)
+       TRANSLATIONS := $(TRANSLATIONS_SRC:.po=.gmo)
++ifdef LINGUAS
++      TRANSLATIONS_ALL := $(TRANSLATIONS)
++      TRANSLATIONS_WANTED = $(patsubst %,po/%.gmo,$(LINGUAS))
++      TRANSLATIONS = $(filter $(TRANSLATIONS_WANTED),$(TRANSLATIONS_ALL))
++endif
+ else
+       TRANSLATIONS :=
+ endif
+@@ -764,7 +769,7 @@ uninstall: uninstall-translations | show-prefix show-bindir show-sysconfdir show
+ .PHONY: uninstall
+ install-translations: $(TRANSLATIONS) | show-HAVE_GETTEXT
+-ifdef HAVE_GETTEXT
++ifeq ($(HAVE_GETTEXT), 1)
+       @echo "Installing translations..."
+       $v for i in $(TRANSLATIONS); do \
+               $(INSTALL) -m 755 -d $(DESTDIR)$(localedir)/`basename $$i .gmo`/LC_MESSAGES; \
index 5132a555abc3ff1ef4ffe818e7b0a2663e413bb7..6d94ff16ddfb38e232247617eb215cd3a234f662 100644 (file)
@@ -10,7 +10,7 @@ SRC_URI="http://fishshell.com/files/${PV}/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
-IUSE=""
+IUSE="nls"
 
 RDEPEND="
        >=dev-libs/libpcre2-10.21[pcre32]
@@ -19,9 +19,11 @@ RDEPEND="
 DEPEND="
        ${RDEPEND}
        sys-devel/bc
-       sys-devel/gettext
+       nls? ( sys-devel/gettext )
 "
 
+PATCHES=( "${FILESDIR}/${P}-honor-linguas.patch" )
+
 src_configure() {
        # Set things up for fish to be a default shell.
        # It has to be in /bin in case /usr is unavailable.
@@ -29,7 +31,8 @@ src_configure() {
        econf \
                docdir="${EPREFIX}"/usr/share/doc/${PF} \
                --bindir="${EPREFIX}"/bin \
-               --without-included-pcre2
+               --without-included-pcre2 \
+               $(use_with nls gettext)
 }
 
 src_test() {