gettext changes to solve bug #7124
v4 cover gettext changes to solve bug #7124
Hello,
Here is a fourth version of the gettext changes, that include fixes for the additional comments made by Thomas DS on the manual (PATCH 3/3).
Since they actually fix a runtime issue with ecryptfs-utils, reported as bug #7124, I'd like them to be considered for 2014.08.
Basically, the core of the issue is that the numerous ecryptfs-utils shell scripts use the "gettext" program on the target to query translated strings. However, with glibc toolchains, we do not allow the selection of the gettext package, because the gettext *functions* are already part of the C library.
However, this totally overlooks the fact that gettext provides more than a library, it also provides utilities, which in the case of ecryptfs-utils, are needed on the target.
Moreover, the gettext configure script is smart enough to *not* generate libintl.so when the C library already has the gettext function. It therefore has the right behavior depending on the C
library: for glibc, only the gettext "utilities" are installed, for uClibc, both libintl and the gettext utilities are installed.
These three patches are just a new version rebased on top of master, and re-tested.
Long term, maybe we should rename BR2_NEEDS_GETTEXT and BR2_NEEDS_GETTEXT_IF_LOCALE to BR2_NEEDS_LIBINTL and BR2_NEEDS_LIBINTL_IF_LOCALE, because this is really what those config knobs mean.
Thanks,
Thomas
Thomas Petazzoni (3):
gettext: allow building when BR2_NEEDS_GETTEXT is not selected
ecryptfs-utils: select gettext, needed for command line utilities docs/manual: update documentation about gettext handling
docs/manual/adding-packages-gettext.txt | 29 ++++++++++++++++++++++------- package/ecryptfs-utils/Config.in | 8 ++++++-- package/gettext/Config.in | 1 - 3 files changed, 28 insertions(+), 10 deletions(-)
Signature · 1 line
2.0.0
PATCH v4 1/3 gettext: allow building when BR2_NEEDS_GETTEXT is not selected
Until now, we thought that gettext was only needed for the target for uClibc toolchains, to provide the gettext functions that are normally provided directly by glibc.
However, the gettext runtime actually does more than providing the equivalent of those C library functions: it also provides certain command line tools, like 'gettext' to get translated strings from the shell. This tool is for example used by certain ecryptfs-utils scripts to get translated strings. It is therefore necessary to be able to build the gettext package even for glibc toolchains.
--- package/gettext/Config.in | 1 - 1 file changed, 1 deletion(-)
package/gettext/Config.in +0 -1
@@ -1,6 +1,5 @@ config BR2_PACKAGE_GETTEXT bool "gettext" - depends on BR2_NEEDS_GETTEXT depends on BR2_USE_WCHAR help The GNU `gettext' utilities are a set of tools that provide a
Signature · 1 line
2.0.0
PATCH v4 2/3 ecryptfs-utils: select gettext, needed for command line utilities
In reply to Thomas PetazzoniThe ecryptfs-utils package requires the 'gettext' program, which is provided by the gettext package, to get translated strings. This is needed regardless of whether the toolchain uses glibc or uClibc.
This issue was reported by 'ausjke' on IRC.
--- package/ecryptfs-utils/Config.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
package/ecryptfs-utils/Config.in +6 -2
@@ -2,6 +2,10 @@ config BR2_PACKAGE_ECRYPTFS_UTILS bool "ecryptfs-utils" select BR2_PACKAGE_KEYUTILS select BR2_PACKAGE_LIBNSS + # runtime dependency only, some scripts are using the + # 'gettext' program to get translations + select BR2_PACKAGE_GETTEXT + depends on BR2_USE_WCHAR # gettext depends on BR2_USE_MMU # keyutils depends on !BR2_avr32 && !BR2_microblaze # keyutils depends on BR2_LARGEFILE # libnss
@@ -23,8 +27,8 @@ config BR2_PACKAGE_ECRYPTFS_UTILS http://ecryptfs.org -comment "ecryptfs-utils needs a toolchain w/ largefile, threads" +comment "ecryptfs-utils needs a toolchain w/ largefile, threads, wchar" depends on !BR2_avr32 && !BR2_microblaze depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT depends on BR2_USE_MMU - depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
Signature · 1 line
2.0.0
PATCH v4 3/3 docs/manual: update documentation about gettext handling
In reply to Thomas PetazzoniThis commit updates the Buildroot manual regarding how gettext related issues are handled, now that we have cases where the gettext package should be selected even with glibc toolchains.
--- docs/manual/adding-packages-gettext.txt | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-)
docs/manual/adding-packages-gettext.txt +22 -7
@@ -8,15 +8,22 @@ library. Dependencies for this library are fairly complicated and therefore, deserve some explanation. The 'uClibc' C library doesn't implement gettext functionality; -therefore with this C library, a separate gettext must be compiled. On -the other hand, the 'glibc' C library does integrate its own gettext, -and in this case the separate gettext library should not be compiled, -because it creates various kinds of build failures. +therefore with this C library, a separate gettext must be compiled, +which is provided by the additional +libintl+ library, part of the ++gettext+ package. + +On the other hand, the 'glibc' C library does integrate its own +gettext library functions, so it is not necessary to build a separate ++libintl+ library. + +However, certain packages need some gettext utilities on the target, +such as the +gettext+ program itself, which allows to retrieve +translated strings, from the command line. Additionally, some packages (such as +libglib2+) do require gettext -unconditionally, while other packages (those who support -+--disable-nls+ in general) only require gettext when locale support -is enabled. +functions unconditionally, while other packages (in general, those who +support +--disable-nls+) only require gettext functions when locale +support is enabled. Therefore, Buildroot defines two configuration options:
@@ -44,3 +51,11 @@ should: * use +$(if $(BR2_NEEDS_GETTEXT),gettext)+ in the package +DEPENDENCIES+ variable in the +.mk+ file. +Packages that need the +gettext+ utilities on the target (should be +rare) should: + +* use +select BR2_PACKAGE_GETTEXT+ in their +Config.in+ file, + indicating in a comment above that it's a runtime dependency only. + +* not add any +gettext+ dependency in the +DEPENDENCIES+ variable of + their +.mk+ file.
Signature · 1 line
2.0.0
v4 cover gettext changes to solve bug #7124
In reply to Thomas PetazzoniQuoted 34 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hello,
Here is a fourth version of the gettext changes, that include fixes for the additional comments made by Thomas DS on the manual (PATCH 3/3).Since they actually fix a runtime issue with ecryptfs-utils, reported as bug #7124, I'd like them to be considered for 2014.08.
Basically, the core of the issue is that the numerous ecryptfs-utils shell scripts use the "gettext" program on the target to query translated strings. However, with glibc toolchains, we do not allow the selection of the gettext package, because the gettext *functions* are already part of the C library.
However, this totally overlooks the fact that gettext provides more than a library, it also provides utilities, which in the case of ecryptfs-utils, are needed on the target.
Moreover, the gettext configure script is smart enough to *not* generate libintl.so when the C library already has the gettext function. It therefore has the right behavior depending on the C
library: for glibc, only the gettext "utilities" are installed, for uClibc, both libintl and the gettext utilities are installed.These three patches are just a new version rebased on top of master, and re-tested.
Long term, maybe we should rename
BR2_NEEDS_GETTEXTandBR2_NEEDS_GETTEXT_IF_LOCALEtoBR2_NEEDS_LIBINTLandBR2_NEEDS_LIBINTL_IF_LOCALE, because this is really what those config knobs mean.
Quoted 8 lines
Thanks,
Thomas
Thomas Petazzoni (3):
gettext: allow building whenBR2_NEEDS_GETTEXTis not selected
ecryptfs-utils: select gettext, needed for command line utilities docs/manual: update documentation about gettext handling
Committed series, thanks.
Signature · 1 line
Bye, Peter Korsgaard