Skip to contentSkip to conversation

package/libglib2: fix build with NLS

PATCH New Fabrice Fontaine 3 participants 3 messages Jun 11, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libglib2: fix build with NLS

cc_has_function('ngettext') is broken when cross-compiling, see:
https://github.com/mesonbuild/meson/issues/3740

As a result, a false positive is returned and build fails because of the missing lintl dependency

Fixes:
- http://autobuild.buildroot.org/results/f0d85d76786343d767fba9c7c5c01f042ecfc018

---
 ...005-meson.build-fix-build-with-lintl.patch | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 package/libglib2/0005-meson.build-fix-build-with-lintl.patch
package/libglib2/0005-meson.build-fix-build-with-lintl.patch new file +52 -0
new file mode 100644
index 0000000000..5abe87b32a
@@ -0,0 +1,52 @@
+From d1b5dc6ffc8dde4c413c832e178b758cdf3b4187 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 11 Jun 2019 20:40:44 +0200
+Subject: [PATCH] meson.build: fix build with lintl
+
+cc_has_function('ngettext') is broken when cross-compiling, see:
+https://github.com/mesonbuild/meson/issues/3740
+
+As a result, a false positive is returned and build fails because of the
+missing lintl dependency
+
+Fixes:
+ - http://autobuild.buildroot.org/results/f0d85d76786343d767fba9c7c5c01f042ecfc018
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ meson.build | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index b85ff7661..5b22fcfd2 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1785,10 +1785,12 @@ endif
+ # proxy-libintl subproject.
+ # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
+ # implementations. This could be extended if issues are found in some platforms.
+-if cc.has_function('ngettext')
+-  libintl = []
+-  have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
+-else
++# FIXME: cc.has_function('ngettext') is broken when cross-compiling, see
++# https://github.com/mesonbuild/meson/issues/3740
++#if cc.has_function('ngettext')
++#  libintl = []
++#  have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
++#else
+   libintl = cc.find_library('intl', required : false)
+   if not libintl.found()
+     libintl = subproject('proxy-libintl').get_variable('intl_dep')
+@@ -1797,7 +1799,7 @@ else
+     have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset',
+                                                    dependencies : libintl)
+   endif
+-endif
++#endif
+ 
+ glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset)
+ 
+-- 
+2.20.1
+
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/libglib2: fix build with NLS

Hey Fabrice!

We are discussing this currently on IRC and I think we have two options, perhaps you should join us?

Basically, the two options are:
1) Use your above patch (which is what I originally suggested, although my code was a bit more hacky.)
2) What Yann is suggesting which is to expand pkg-meson.mk with something like: http://code.bulix.org/onc7x0-767490?raw

    and then add the $(TARGET_NLS_LIBS) to the mk file.

I am liking option 2 a bit more, as it is another patch that we don't have to maintain.

What do you think?

Adam

Quoted 81 lines · Fabrice Fontaine

cc_has_function('ngettext') is broken when cross-compiling, see:
https://github.com/mesonbuild/meson/issues/3740

As a result, a false positive is returned and build fails because of the missing lintl dependency

Fixes:
- http://autobuild.buildroot.org/results/f0d85d76786343d767fba9c7c5c01f042ecfc018

---
 ...005-meson.build-fix-build-with-lintl.patch | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 package/libglib2/0005-meson.build-fix-build-with-lintl.patch
package/libglib2/0005-meson.build-fix-build-with-lintl.patch new file +52 -1
new file mode 100644
index 0000000000..5abe87b32a
@@ -0,0 +1,52 @@
+From d1b5dc6ffc8dde4c413c832e178b758cdf3b4187 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 11 Jun 2019 20:40:44 +0200
+Subject: [PATCH] meson.build: fix build with lintl
+
+cc_has_function('ngettext') is broken when cross-compiling, see:
+https://github.com/mesonbuild/meson/issues/3740
+
+As a result, a false positive is returned and build fails because of the
+missing lintl dependency
+
+Fixes:
+ - http://autobuild.buildroot.org/results/f0d85d76786343d767fba9c7c5c01f042ecfc018
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ meson.build | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index b85ff7661..5b22fcfd2 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1785,10 +1785,12 @@ endif
+ # proxy-libintl subproject.
+ # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
+ # implementations. This could be extended if issues are found in some platforms.
+-if cc.has_function('ngettext')
+-  libintl = []
+-  have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
+-else
++# FIXME: cc.has_function('ngettext') is broken when cross-compiling, see
++# https://github.com/mesonbuild/meson/issues/3740
++#if cc.has_function('ngettext')
++#  libintl = []
++#  have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
++#else
+   libintl = cc.find_library('intl', required : false)
+   if not libintl.found()
+     libintl = subproject('proxy-libintl').get_variable('intl_dep')
+@@ -1797,7 +1799,7 @@ else
+     have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset',
+                                                    dependencies : libintl)
+   endif
+-endif
++#endif
+
+ glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset)
+
+--
+2.20.1
+
--

2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#2 lore raw

PATCH 1/1 package/libglib2: fix build with NLS

Fabrice, Adam, All,

On 2019-06-11 15:21 -0400, Adam Duskett spake thusly:

Quoted 2 lines

We are discussing this currently on IRC and I think we have two options, perhaps you should join us?

I did absolutely not tell Adam to entice you to join. No I did not.

OK, I did. ;-)

Quoted 9 lines

Basically, the two options are:
1) Use your above patch (which is what I originally suggested, although my code was a bit more hacky.)
2) What Yann is suggesting which is to expand pkg-meson.mk with something like: http://code.bulix.org/onc7x0-767490?raw

    and then add the $(TARGET_NLS_LIBS) to the mk file.

I am liking option 2 a bit more, as it is another patch that we don't have to maintain.

So, it turned out to be the fix (last two commits):
https://git.buildroot.org/~ymorin/git/buildroot/log/?h=yem/meson-per-pkg-flags

I'm test-building the sucker for now, I'll spew the patches in a moment.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'