Skip to contentSkip to conversation

gettext_0.16.1: use musl gettext implementation

PATCH In review André Draszik 2 participants 5 messages Aug 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 gettext_0.16.1: use musl gettext implementation

gettext uses internal symbols to detect whether the implementation is compatible with GNU gettext. However, these symbols don't are not part of the public API, they are specific to glibc.

While musl implements the GNU gettext *API* version 1 and 2
http://www.openwall.com/lists/musl/2015/04/16/3
it doesn't implement glibc internals. This means that gettext fails to detect musl's working implementation.

More recent versions of gettext have changed the way GNU gettext compatibility is done
https://lists.gnu.org/archive/html/bug-gettext/2016-04/msg00000.html
http://git.savannah.gnu.org/cgit/gettext.git/commit/gettext-runtime/m4/gettext.m4?id=b67399b40bc5bf3165b09e6a095ec941d4b30a97
and while we could backport the corresponding patch to gettext.m4, we avoid doing that so as to avoid any potential GPL-v3 issues.

So instead we force ./configure to assume that the gettext implementation of the c-library (musl) is compatible.

As a side-effect, this also reduces image sizes as the internal gettext implementation isn't built anymore, and it's otherwise packaged into the main gettext package which blows up the image as the main gettext package contains a lot of things.

Similarly, libintl.h isn't generated anymore, as the one from musl is OK.

---
 meta/recipes-core/gettext/gettext_0.16.1.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/gettext/gettext_0.16.1.bb +5 -1
index 8b6f0a7..5a58578 100644
@@ -31,6 +31,11 @@ PARALLEL_MAKE = ""
 inherit autotools texinfo
 
 EXTRA_OECONF += "--without-lisp --disable-csharp --disable-openmp --without-emacs"
+EXTRA_OECONF_append_libc-musl = "\
+                                 gt_cv_func_gnugettext1_libc=yes \
+                                 gt_cv_func_gnugettext2_libc=yes \
+                                "
+
 acpaths = '-I ${S}/autoconf-lib-link/m4/ \
            -I ${S}/gettext-runtime/m4 \
            -I ${S}/gettext-tools/m4'
@@ -41,7 +46,6 @@ do_configure_prepend() {
 
 do_install_append_libc-musl () {
 	rm -f ${D}${libdir}/charset.alias
-	rm -f ${D}${includedir}/libintl.h
 }
 
 # these lack the .x behind the .so, but shouldn't be in the -dev package
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/4 gettext_0.16.1: fix lispdir configure option

The option is called --with(out)-lispdir, not --with(out)-lisp

---
 meta/recipes-core/gettext/gettext_0.16.1.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/gettext/gettext_0.16.1.bb +5 -1
index 5a58578..6710c8d 100644
@@ -30,7 +30,11 @@ PARALLEL_MAKE = ""
 
 inherit autotools texinfo
 
-EXTRA_OECONF += "--without-lisp --disable-csharp --disable-openmp --without-emacs"
+EXTRA_OECONF += "--without-lispdir \
+                 --disable-csharp \
+                 --disable-openmp \
+                 --without-emacs \
+                "
 EXTRA_OECONF_append_libc-musl = "\
                                  gt_cv_func_gnugettext1_libc=yes \
                                  gt_cv_func_gnugettext2_libc=yes \
Signature · 1 line
2.9.3
#2 lore raw

PATCH 3/4 gettext_0.16.1: align configure options with v0.19.8.1 recipe

In reply to André Draszik

It doesn't look like we need any of those features, so let's disable them explicitly.

---
 meta/recipes-core/gettext/gettext_0.16.1.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-core/gettext/gettext_0.16.1.bb +3 -0
index 6710c8d..93f5fcd 100644
@@ -32,6 +32,9 @@ inherit autotools texinfo
 
 EXTRA_OECONF += "--without-lispdir \
                  --disable-csharp \
+                 --disable-libasprintf \
+                 --disable-java \
+                 --disable-native-java \
                  --disable-openmp \
                  --without-emacs \
                 "
Signature · 1 line
2.9.3
#3 lore raw

PATCH 4/4 gettext_0.16.1: whitespace changes to align with v0.19.8.1

In reply to André Draszik

This further aligns this recipe with the GPLv3 version to make it easier to spot differences between the two recipes.

---
 meta/recipes-core/gettext/gettext_0.16.1.bb | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
meta/recipes-core/gettext/gettext_0.16.1.bb +3 -4
index 93f5fcd..e79f4da 100644
@@ -21,13 +21,13 @@ SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
            file://hardcode_macro_version.patch \
           "
 
-LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
-
 SRC_URI[md5sum] = "3d9ad24301c6d6b17ec30704a13fe127"
 SRC_URI[sha256sum] = "0bf850d1a079fb5a61f0a47b1a9efd35eb44032255375e1cedb0253bc27b376d"
 
 PARALLEL_MAKE = ""
 
+LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
+
 inherit autotools texinfo
 
 EXTRA_OECONF += "--without-lispdir \
@@ -104,9 +104,8 @@ FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
                              ${infodir}/autosprintf.info \
                             "
 
-
 do_install_append() {
-	rm -f ${D}${libdir}/preloadable_libintl.so
+    rm -f ${D}${libdir}/preloadable_libintl.so
 }
 
 do_install_append_class-native () {
Signature · 1 line
2.9.3
#4 lore raw

Re: [PATCH 4/4] gettext_0.16.1: whitespace changes to align with v0.19.8.1

Quoted 1 line · André Draszik

+LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "

i'm not a big fan of doing the above; that is, adding *both* leading
and trailing space to a string, just to play it safe. i know it doesn't hurt, but it's sloppy and might actually conceal incorrect string values elsewhere.

if you're "_append"ing, then the string should have only a leading
space; if you're "_prepend"ing, then only a trailing space. the reason for that is that, if you're rigorous like that, you might actually catch a string that *doesn't* have the appropriate spaces, but is getting away with it only because a string elsewhere is being generous and covering for it.

and, yes, i *am* that pedantic.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================