package/ncmpc: don't set NLS
PATCH 1/1 package/ncmpc: don't set NLS
ncmpc is able to automatically detect NLS support since version 0.47 and
https://github.com/MusicPlayerDaemon/ncmpc/commit/c264db04dd30af301e7d85c9d145bb1f1ae3fea3
so let it handle automatically to avoid the following build failure with a bootlin toolchain which embeds a gettext definition in libintl.h which will clash with the fake gettext definition provided by ncmpc since
https://github.com/MusicPlayerDaemon/ncmpc/commit/95af27ab2d3ceb9df26ebb4e0d936e392a84c153:
In file included from ../src/save_playlist.cxx:8:/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected unqualified-id before 'const'
39 | extern char *gettext (const char *__msgid)
| ^~~~~~~
/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected ')' before 'const' ../src/i18n.h:22:20: note: to match this '('
22 | #define gettext(x) (x)
| ^
Indeed, even if NLS is disabled by the user, libintl.h will be included
by /home/fabrice/buildroot/output/host/opt/ext-toolchain/or1k-buildroot-linux-gnu/include/c++/13.2.0/or1k-buildroot-linux-gnu/bits/messages_members.h though include <chrono>
Fixes:
- http://autobuild.buildroot.org/results/c860e64909dd3b7fa033db0970e1cfc1376c4ec5
- http://autobuild.buildroot.org/results/36eab556fac80124755bff4110af3e43fe6edd78
--- package/ncmpc/ncmpc.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
package/ncmpc/ncmpc.mk +1 -2
@@ -20,8 +20,7 @@ NCMPC_CPE_ID_VENDOR = ncmpc_project NCMPC_CONF_OPTS = \ -Dcurses=ncurses \ - -Ddocumentation=disabled \ - $(if $(BR2_SYSTEM_ENABLE_NLS),-Dnls=enabled,-Dnls=disabled) + -Ddocumentation=disabled ifeq ($(BR2_PACKAGE_LIRC_TOOLS),y) NCMPC_DEPENDENCIES += lirc-tools
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello,
Le 06/01/2024 à 11:12, Fabrice Fontaine a écrit :
Quoted 16 lines
ncmpc is able to automatically detect NLS support since version 0.47 and
https://github.com/MusicPlayerDaemon/ncmpc/commit/c264db04dd30af301e7d85c9d145bb1f1ae3fea3
so let it handle automatically to avoid the following build failure with a bootlin toolchain which embeds a gettext definition inlibintl.hwhich will clash with the fake gettext definition provided by ncmpc since
https://github.com/MusicPlayerDaemon/ncmpc/commit/95af27ab2d3ceb9df26ebb4e0d936e392a84c153:In file included from ../src/save_playlist.cxx:8:
/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected unqualified-id before 'const'
39 | extern char *gettext (const char*__msgid)| ^~~~~~~
/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected ')' before 'const'../src/i18n.h:22:20: note: to match this '('
22 | #define gettext(x) (x)
| ^
Quoted 4 lines
Indeed, even if NLS is disabled by the user,
libintl.hwill be included
by/home/fabrice/buildroot/output/host/opt/ext-toolchain/or1k-buildroot-linux-gnu/include/c++/13.2.0/or1k-buildroot-linux-gnu/bits/messages_members.hthough include <chrono>
We usually want to explicitly handle such option from Buildroot package to not rely on automatic detection (as currently done).
It look like more a bug in ncmpc build system?
Best regards,
Romain
Quoted 15 lines
Fixes:
- http://autobuild.buildroot.org/results/c860e64909dd3b7fa033db0970e1cfc1376c4ec5
- http://autobuild.buildroot.org/results/36eab556fac80124755bff4110af3e43fe6edd78Signed-off-by Fabrice Fontaine <[email protected]>--- package/ncmpc/ncmpc.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)package/ncmpc/ncmpc.mk +0
-0
package/ncmpc/ncmpc.mk NCMPC_CPE_ID_VENDOR = ncmpc_project · line 26
Quoted 9 lines
package/ncmpc/ncmpc.mk +1
-2@@ -20,8 +20,7 @@ NCMPC_CPE_ID_VENDOR = ncmpc_project NCMPC_CONF_OPTS = \ -Dcurses=ncurses \ - -Ddocumentation=disabled \ - $(if $(BR2_SYSTEM_ENABLE_NLS),-Dnls=enabled,-Dnls=disabled) + -Ddocumentation=disabled ifeq ($(BR2_PACKAGE_LIRC_TOOLS),y) NCMPC_DEPENDENCIES += lirc-tools
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Romain,
Quoted 25 lines · Romain Naour
Hello,
Quoted 16 lines · Fabrice Fontaine
ncmpc is able to automatically detect NLS support since version 0.47 and
https://github.com/MusicPlayerDaemon/ncmpc/commit/c264db04dd30af301e7d85c9d145bb1f1ae3fea3
so let it handle automatically to avoid the following build failure with a bootlin toolchain which embeds a gettext definition inlibintl.hwhich will clash with the fake gettext definition provided by ncmpc since
https://github.com/MusicPlayerDaemon/ncmpc/commit/95af27ab2d3ceb9df26ebb4e0d936e392a84c153:In file included from ../src/save_playlist.cxx:8:
/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected unqualified-id before 'const'
39 | extern char *gettext (const char*__msgid)| ^~~~~~~
/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected ')' before 'const'../src/i18n.h:22:20: note: to match this '('
22 | #define gettext(x) (x)
| ^Quoted 4 lines
Indeed, even if NLS is disabled by the user,
libintl.hwill be included
by/home/fabrice/buildroot/output/host/opt/ext-toolchain/or1k-buildroot-linux-gnu/include/c++/13.2.0/or1k-buildroot-linux-gnu/bits/messages_members.hthough include <chrono>
Quoted 4 lines
We usually want to explicitly handle such option from Buildroot package to not rely on automatic detection (as currently done).
It look like more a bug in ncmpc build system?
I don't know, upstream wants to have the same code with and without NLS, so they decided to define a gettext macro when NLS is disabled. I could find an upstreamable solution as upstream will probably reject a patch that removes this gettext define and puts #ifdef ENABLE_NLS before every gettext calls.
Do you have an upstreamable solution or should we just add a NLS dependency to ncmpc?
Quoted 21 lines
Best regards,
RomainQuoted 16 lines
Fixes:
- http://autobuild.buildroot.org/results/c860e64909dd3b7fa033db0970e1cfc1376c4ec5
- http://autobuild.buildroot.org/results/36eab556fac80124755bff4110af3e43fe6edd78Signed-off-by Fabrice Fontaine <[email protected]>--- package/ncmpc/ncmpc.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)package/ncmpc/ncmpc.mk +0
-0@@ -20,8 +20,7 @@ NCMPC_CPE_ID_VENDOR = ncmpc_project
Quoted 9 lines
package/ncmpc/ncmpc.mk NCMPC_CPE_ID_VENDOR = ncmpc_project · line 26
Quoted 8 lines
package/ncmpc/ncmpc.mk +1
-2NCMPC_CONF_OPTS = \ -Dcurses=ncurses \ - -Ddocumentation=disabled \ - $(if $(BR2_SYSTEM_ENABLE_NLS),-Dnls=enabled,-Dnls=disabled) + -Ddocumentation=disabled ifeq ($(BR2_PACKAGE_LIRC_TOOLS),y) NCMPC_DEPENDENCIES += lirc-tools
Best Regards,
Fabrice
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Le 06/02/2024 à 18:59, Fabrice Fontaine a écrit :
Quoted 33 lines
Hello Romain,
Quoted 25 lines · Romain Naour
Hello,
Quoted 16 lines · Fabrice Fontaine
ncmpc is able to automatically detect NLS support since version 0.47 and
https://github.com/MusicPlayerDaemon/ncmpc/commit/c264db04dd30af301e7d85c9d145bb1f1ae3fea3
so let it handle automatically to avoid the following build failure with a bootlin toolchain which embeds a gettext definition inlibintl.hwhich will clash with the fake gettext definition provided by ncmpc since
https://github.com/MusicPlayerDaemon/ncmpc/commit/95af27ab2d3ceb9df26ebb4e0d936e392a84c153:In file included from ../src/save_playlist.cxx:8:
/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected unqualified-id before 'const'
39 | extern char *gettext (const char*__msgid)| ^~~~~~~
/home/buildroot/autobuild/instance-2/output-1/host/or1k-buildroot-linux-gnu/sysroot/usr/include/libintl.h:39:14: error: expected ')' before 'const'../src/i18n.h:22:20: note: to match this '('
22 | #define gettext(x) (x)
| ^Quoted 4 lines
Indeed, even if NLS is disabled by the user,
libintl.hwill be included
by/home/fabrice/buildroot/output/host/opt/ext-toolchain/or1k-buildroot-linux-gnu/include/c++/13.2.0/or1k-buildroot-linux-gnu/bits/messages_members.hthough include <chrono>Quoted 4 lines
We usually want to explicitly handle such option from Buildroot package to not rely on automatic detection (as currently done).
It look like more a bug in ncmpc build system?
Quoted 7 lines
I don't know, upstream wants to have the same code with and without NLS, so they decided to define a gettext macro when NLS is disabled. I could find an upstreamable solution as upstream will probably reject a patch that removes this gettext define and puts #ifdef
ENABLE_NLSbefore every gettext calls.
Do you have an upstreamable solution or should we just add a NLS dependency to ncmpc?
The problem here is that libintl.h header is present in the staging directory when a glibc based toolchain is used with or without NLS enabled.
If ncmpc want to define gettext as a macro when NLS is disabled, its build system should at least do some check before defining gettext as a macro since the libintl.h header can be included indirectly.
When libintl.h header provide gettext, it should be undef before adding the gettext macro.
Something like this (untested):
i18n.h:
#ifdef HAVE_INTL
#include <libintl.h>
#endif
#ifdef ENABLE_NLS
...
#else
#undef gettext
#define gettext(x) (x)
...
#endif
Best regards,
Romain
Quoted 28 lines
Quoted 28 lines
Best regards,
RomainQuoted 22 lines
Fixes:
- http://autobuild.buildroot.org/results/c860e64909dd3b7fa033db0970e1cfc1376c4ec5
- http://autobuild.buildroot.org/results/36eab556fac80124755bff4110af3e43fe6edd78Signed-off-by Fabrice Fontaine <[email protected]>--- package/ncmpc/ncmpc.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)package/ncmpc/ncmpc.mk +1
-2@@ -20,8 +20,7 @@ NCMPC_CPE_ID_VENDOR = ncmpc_project NCMPC_CONF_OPTS = \ -Dcurses=ncurses \ - -Ddocumentation=disabled \ - $(if $(BR2_SYSTEM_ENABLE_NLS),-Dnls=enabled,-Dnls=disabled) + -Ddocumentation=disabled
Quoted 7 lines
Quoted 3 lines
package/ncmpc/ncmpc.mk NCMPC_CPE_ID_VENDOR = ncmpc_project · line 26
Quoted 2 lines
package/ncmpc/ncmpc.mk +0
-0ifeq ($(BR2_PACKAGE_LIRC_TOOLS),y) NCMPC_DEPENDENCIES += lirc-toolsBest Regards,
Fabrice
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot