package/ncmpc: fix build without NLS

The build fails if libintl.h is found but xgettext is not available:

Has header "libintl.h" : YES
Library intl found: NO

po/meson.build:28:5: ERROR: Can not do gettext because xgettext is not installed.

This is because enable_nls defaults to true if libintl.h is found. Use
the nls option to enable/disable NLS explicitly, depending on
BR2_SYSTEM_ENABLE_NLS,

Also, fix the second patch to always look for libintl, even if NLS is
not enabled. The enable_nls option disables processing the po files, but
the gettext calls in the source are still there, so we need to link with
libintl anyway.

Fixes:
 - http://autobuild.buildroot.org/results/0ab0a42fd4c5c9fd5891f3b84287bd788f763ba4

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Fabrice Fontaine 2019-06-10 11:51:46 +02:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent 5e2c3c390b
commit 56fb7401b9
2 changed files with 4 additions and 3 deletions

View File

@ -18,13 +18,13 @@ index 2e6defc..28e9d29 100644
--- a/meson.build
+++ b/meson.build
@@ -42,6 +42,7 @@ else
error('libintl.h not found')
endif
conf.set('ENABLE_NLS', enable_nls)
+intl_dep = cc.find_library('intl', required: false)
if enable_nls
+ intl_dep = cc.find_library('intl', required: false)
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
subdir('po')
endif
@@ -356,6 +357,7 @@ ncmpc = executable('ncmpc',
boost_dep,
pcre_dep,

View File

@ -19,7 +19,8 @@ NCMPC_LICENSE_FILES = COPYING
NCMPC_CONF_OPTS = \
-Dcurses=ncurses \
-Ddocumentation=disabled
-Ddocumentation=disabled \
$(if $(BR2_SYSTEM_ENABLE_NLS),-Dnls=enabled,-Dnls=disabled)
ifeq ($(BR2_PACKAGE_LIRC_TOOLS),y)
NCMPC_DEPENDENCIES += lirc-tools