Add gettext-tiny package
v3 cover Add gettext-tiny package
Add lightweight alternative for the GNU gettext package - gettext-tiny. The sources are used from sabotage-linux project. Some files are used from the original gettext gnu like po/*, gettextize and some m4 files.
The original gettext package is renamed to gettext-gnu because now gettext is a virtual package and gettext-gnu and gettext-tiny became as gettext providers.
The main purpose of gettext-tiny is to be used only for the host if NLS is not enabled.
There was issue with using gettext-tiny for "wine" because it requires libgettextpo for wrc tool to be able translate Windows's resource files to *.pot, but this option might be disabled if NLS is disabled (done in patch 0001.
v3:
1) Rebased on master.
2) Drop wine related patch which is already applied.
v2:
1) Add patch to disable gettext option for "wine" if NLS is disabled.
2) Fix build issue with libuio by adding config.rpath by separate package patch:
0002-Add-config.rpath-from-gettext-gnu-distro-0.19.8.1.patch
3) Use gettext-tiny only as for HOST alternative and if NLS is disabled. There is no option to manually select gettext-gnu or gettext-tiny which is controlled by gettext virtual package.
4) Drop "files" folder with copied files from original gettext gnu, but download them from:
https://git.savannah.gnu.org/cgit/gettext.git
Thanks to Yann E. Morin for help with this.
5) gettextize is preprocessed from the original gettextize.in
6) Use only host-generic-package for gettext-tiny, hence remove "target" related stuff.
Vadim Kochan (2):
package/gettext: Turn into virtual package
package/gettext-tiny: Add new package
DEVELOPERS | 1 +
.../0001-error_print_progname.patch | 0
.../0002-Update-after-gnulib-changed.patch | 0
.../gettext.hash => gettext-gnu/gettext-gnu.hash} | 0
package/gettext-gnu/gettext-gnu.mk | 103 +++
...-format-not-a-string-literal-error-for-gc.patch | 55 ++
...ig.rpath-from-gettext-gnu-distro-0.19.8.1.patch | 709 +++++++++++++++++++++
package/gettext-tiny/gettext-tiny.hash | 14 +
package/gettext-tiny/gettext-tiny.mk | 104 +++
package/gettext/Config.in | 27 +-
package/gettext/gettext.mk | 96 +--
11 files changed, 1010 insertions(+), 99 deletions(-)
rename package/{gettext => gettext-gnu}/0001-error_print_progname.patch (100%)
rename package/{gettext => gettext-gnu}/0002-Update-after-gnulib-changed.patch (100%)
rename package/{gettext/gettext.hash => gettext-gnu/gettext-gnu.hash} (100%)
create mode 100644 package/gettext-gnu/gettext-gnu.mk
create mode 100644 package/gettext-tiny/0001-libintl-Fix-format-not-a-string-literal-error-for-gc.patch
create mode 100644 package/gettext-tiny/0002-Add-config.rpath-from-gettext-gnu-distro-0.19.8.1.patch
create mode 100644 package/gettext-tiny/gettext-tiny.hash
create mode 100644 package/gettext-tiny/gettext-tiny.mkSignature · 1 line
2.14.1
PATCH v3 1/2 package/gettext: Turn into virtual package
Re-work gettext to be a virtual package which may allow to use different gettext's providers, and rename the original one into gettext-gnu package.
---
.../0001-error_print_progname.patch | 0
.../0002-Update-after-gnulib-changed.patch | 0
.../gettext.hash => gettext-gnu/gettext-gnu.hash} | 0
package/gettext-gnu/gettext-gnu.mk | 103 +++++++++++++++++++++
package/gettext/Config.in | 26 +++++-
package/gettext/gettext.mk | 96 +------------------
6 files changed, 126 insertions(+), 99 deletions(-)
rename package/{gettext => gettext-gnu}/0001-error_print_progname.patch (100%)
rename package/{gettext => gettext-gnu}/0002-Update-after-gnulib-changed.patch (100%)
rename package/{gettext/gettext.hash => gettext-gnu/gettext-gnu.hash} (100%)
create mode 100644 package/gettext-gnu/gettext-gnu.mkpackage/gettext-gnu/0001-error_print_progname.patch renamed from package/gettext/0001-error_print_progname.patch +0 -0
package/gettext-gnu/0002-Update-after-gnulib-changed.patch renamed from package/gettext/0002-Update-after-gnulib-changed.patch +0 -0
package/gettext-gnu/gettext-gnu.hash renamed from package/gettext/gettext.hash +0 -0
package/gettext-gnu/gettext-gnu.mk new file +103 -0
103 lines not on this page · raw message
package/gettext/Config.in +21 -5
@@ -1,5 +1,12 @@ -config BR2_PACKAGE_GETTEXT +menuconfig BR2_PACKAGE_GETTEXT bool "gettext" + select BR2_PACKAGE_HAS_GETTEXT + +if BR2_PACKAGE_GETTEXT + +config BR2_PACKAGE_GETTEXT_GNU + bool "gettext-gnu" + default y depends on BR2_USE_WCHAR help The GNU `gettext' utilities are a set of tools that provide a
@@ -12,14 +19,23 @@ config BR2_PACKAGE_GETTEXT http://www.gnu.org/software/gettext/ -if BR2_PACKAGE_GETTEXT +comment "gettext-gnu needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR config BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL bool default y if BR2_SYSTEM_ENABLE_NLS depends on !BR2_TOOLCHAIN_HAS_FULL_GETTEXT -endif +config BR2_PACKAGE_PROVIDES_GETTEXT + string + default "gettext-gnu" if BR2_PACKAGE_GETTEXT_GNU -comment "gettext needs a toolchain w/ wchar" - depends on !BR2_USE_WCHAR +config BR2_PACKAGE_HAS_GETTEXT + bool + +config BR2_PACKAGE_PROVIDES_HOST_GETTEXT + string + default "host-gettext-gnu" + +endif
package/gettext/gettext.mk +2 -94
99 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH v3 2/2 package/gettext-tiny: Add new package
In reply to Vadim KochanAdd gettext-tiny package from the sabotage-linux project:
gettext-tiny provides lightweight replacements for tools typically used from the GNU gettext suite, which is incredibly bloated and takes a lot of time to build (in the order of an hour on slow devices). the most notable component is msgfmt which is used to create binary translation files in the .mo format out of textual input files in .po format. this is the most important tool for building software from source, because it is used from the build processes of many software packages.
Some files were taken from gettext-gnu (some po/* files and gettextize script) to make possible perform gettextizing of packages.
The main purpose of gettext-tiny is to replace gettext for the "host" if NLS support is not needed. There is no option to manually select gettext-gnu or gettext-tiny, it is done automatically by virtual gettext package, because there is no reason to have gettext-tiny for the target.
--- DEVELOPERS | 1 + ...-format-not-a-string-literal-error-for-gc.patch | 55 ++ ...ig.rpath-from-gettext-gnu-distro-0.19.8.1.patch | 709 +++++++++++++++++++++ package/gettext-tiny/gettext-tiny.hash | 14 + package/gettext-tiny/gettext-tiny.mk | 104 +++ package/gettext/Config.in | 19 +- 6 files changed, 893 insertions(+), 9 deletions(-) create mode 100644 package/gettext-tiny/0001-libintl-Fix-format-not-a-string-literal-error-for-gc.patch create mode 100644 package/gettext-tiny/0002-Add-config.rpath-from-gettext-gnu-distro-0.19.8.1.patch create mode 100644 package/gettext-tiny/gettext-tiny.hash create mode 100644 package/gettext-tiny/gettext-tiny.mk
DEVELOPERS +1 -0
@@ -2153,6 +2153,7 @@ F: package/tstools/ N: Vadim Kochan <[email protected]> F: package/brcm-patchram-plus/ +F: package/gettext-tiny/ N: Valentin Korenblit <[email protected]> F: package/clang/
package/gettext-tiny/0001-libintl-Fix-format-not-a-string-literal-error-for-gc.patch new file +55 -0
55 lines not on this page · raw message
package/gettext-tiny/0002-Add-config.rpath-from-gettext-gnu-distro-0.19.8.1.patch new file +709 -0
709 lines not on this page · raw message
package/gettext-tiny/gettext-tiny.hash new file +14 -0
@@ -0,0 +1,14 @@ +# Locally Computed: +sha256 654dcd52f2650476c8822b60bee89c20a0aa7f6a1bf6001701eeacd71a9e388b gettext-tiny-v0.3.1.tar.gz +sha256 64f7e3661c832c19eb9d3ea156cd4410f97cf263d80fd546517c20f584ed15e8 gettextize.in?h=v0.19.8.1 +sha256 ed85e3a2a4ce7157180b40ffab00bd8a24b4891c9ffc3e3bc94cb161d62e744c Makefile.in.in?h=v0.19.8.1 +sha256 d5a3b72f3d2a12b6740416c201b35c77808a981feae8a7c9b674cd3ee875e000 Makevars.template?h=v0.19.8.1 +sha256 33234736a58f1610c73e1c8c08faf1b2ef1397d878dd7d2cbd888ca0f2da4ffc boldquot.sed?h=v0.19.8.1 +sha256 3b0b89aa6625c051e69cce1e341f973f62ca94aff62cbb36b4a452ce67eb261c en at boldquot.header?h=v0.19.8.1 +sha256 90e35325bf9b6b9562bd0882128ea4650b65c9389b35edf9ff534dc3a48e8bed en at quot.header?h=v0.19.8.1 +sha256 73e650aeccc3ef0a7c2e1bbab934b0882b61f19569e96e4615d069dc50b6becd insert-header.sin?h=v0.19.8.1 +sha256 d19ab2cc69000c1206f1b8460952857f05d154158da8b89273ac2900a5c80ec0 quot.sed?h=v0.19.8.1 +sha256 9a36cf3e93b6374521c81fa4f302350d3c04b95573f5570717284107689188e6 remove-potcdate.sin?h=v0.19.8.1 +sha256 01b364b311c593a1a80c02fe2dd68cbeff7014515f4d54b3bf62dc74370a1790 Rules-quot?h=v0.19.8.1 +sha256 0f8fdf35a253d2c04c8ca15c454798549aaddef6eff3a1a9447779f107e2aaac lock.m4?h=v0.19.8.1 +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING?h=v0.19.8.1
package/gettext-tiny/gettext-tiny.mk new file +104 -0
104 lines not on this page · raw message
package/gettext/Config.in +10 -9
@@ -1,13 +1,13 @@ -menuconfig BR2_PACKAGE_GETTEXT +config BR2_PACKAGE_GETTEXT bool "gettext" select BR2_PACKAGE_HAS_GETTEXT + depends on BR2_SYSTEM_ENABLE_NLS if BR2_PACKAGE_GETTEXT config BR2_PACKAGE_GETTEXT_GNU bool "gettext-gnu" default y - depends on BR2_USE_WCHAR help The GNU `gettext' utilities are a set of tools that provide a framework to help other GNU packages produce multi-lingual
@@ -19,9 +19,6 @@ config BR2_PACKAGE_GETTEXT_GNU http://www.gnu.org/software/gettext/ -comment "gettext-gnu needs a toolchain w/ wchar" - depends on !BR2_USE_WCHAR - config BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL bool default y if BR2_SYSTEM_ENABLE_NLS
@@ -29,13 +26,17 @@ config BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL config BR2_PACKAGE_PROVIDES_GETTEXT string - default "gettext-gnu" if BR2_PACKAGE_GETTEXT_GNU + default "gettext-gnu" config BR2_PACKAGE_HAS_GETTEXT bool +endif + +comment "gettext requires NLS enabled" + depends on !BR2_SYSTEM_ENABLE_NLS + config BR2_PACKAGE_PROVIDES_HOST_GETTEXT string - default "host-gettext-gnu" - -endif + default "host-gettext-gnu" if BR2_SYSTEM_ENABLE_NLS + default "host-gettext-tiny" if !BR2_SYSTEM_ENABLE_NLS
Signature · 1 line
2.14.1
v3 cover Add gettext-tiny package
In reply to Vadim KochanHello,
Quoted 9 lines · On Tue, 12 Feb 2019 23:55:18 +0200 Vadim Kochan <[email protected]> wrote:
Add lightweight alternative for the GNU gettext package - gettext-tiny. The sources are used from sabotage-linux project. Some files are used from the original gettext gnu like po/*, gettextize and some m4 files.
The original gettext package is renamed to gettext-gnu because now gettext is a virtual package and gettext-gnu and gettext-tiny became as gettext providers.
The main purpose of gettext-tiny is to be used only for the host if NLS is not enabled.
I finally took some time to play around with this. The first thing is that I didn't like a lot the download of lots of gettext-gnu files from gettext-tiny. I've played a bit with this, and ended up trying to use the gettext-gnu tarball instead. See:
https://github.com/tpetazzoni/buildroot/tree/gettext-tiny
https://github.com/tpetazzoni/buildroot/commit/22936b22944f49646c8732fb2742a526d0a556e2#diff-e5eacf305a325109262748204673e7b5R19
for the details. It also avoids the need to patch to get config.rpath, because config.rpath is available in the gettext-gnu tarball.
I also reworked how the virtual package was handled, but I then understood that I had mistaken that only the host package was really a virtual package with two implementation: the target gettext package has only one implementation: gettext-gnu.
However, the ecryptfs-utils case has shown that it is possible for a package to need a gettext implementation even if BR2_SYSTEM_ENABLE_NLS is disabled. So from there, we have two solutions:
- Patch ecryptfs-utils itself so that it doesn't use gettext when --disable-nls is used. Perhaps this is the right thing to do. In this case, we could indeed mandate that the target gettext package is only available when BR2_SYSTEM_ENABLE_NLS=y, and therefore indeed have the gettext virtual package always point to gettext-gnu.
- Alternatively, support gettext-tiny as a target package, which would provide both libintl and the gettext program (the latter to please ecryptfs-utils).
I was initially worried that some packages that don't understand --disable-nls might try to link with libintl, and that we would therefore need a target gettext package even if BR2_SYSTEM_ENABLE_NLS. However, libintl is only a replacement library for the gettext functions that don't exist in uclibc/musl, but do exist in glibc. Because in glibc they are part of the C library itself, I don't think any package is ever going to link explicitly with libintl. It's only Buildroot that ensures -lintl is passed to the LIBS/LDFLAGS when needed. So I believe we're good.
So, perhaps the good solution is option (1) above ?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
v3 cover Add gettext-tiny package
Hi Thomas!
Quoted 55 lines · Thomas Petazzoni
Hello,
Quoted 9 lines · On Tue, 12 Feb 2019 23:55:18 +0200 Vadim Kochan <[email protected]> wrote:
Add lightweight alternative for the GNU gettext package - gettext-tiny. The sources are used from sabotage-linux project. Some files are used from the original gettext gnu like po/*, gettextize and some m4 files.
The original gettext package is renamed to gettext-gnu because now gettext is a virtual package and gettext-gnu and gettext-tiny became as gettext providers.
The main purpose of gettext-tiny is to be used only for the host if NLS is not enabled.
I finally took some time to play around with this. The first thing is that I didn't like a lot the download of lots of gettext-gnu files from gettext-tiny. I've played a bit with this, and ended up trying to use the gettext-gnu tarball instead. See:
https://github.com/tpetazzoni/buildroot/tree/gettext-tiny
https://github.com/tpetazzoni/buildroot/commit/22936b22944f49646c8732fb2742a526d0a556e2#diff-e5eacf305a325109262748204673e7b5R19for the details. It also avoids the need to patch to get config.rpath, because config.rpath is available in the gettext-gnu tarball.
I also reworked how the virtual package was handled, but I then understood that I had mistaken that only the host package was really a virtual package with two implementation: the target gettext package has only one implementation: gettext-gnu.
However, the ecryptfs-utils case has shown that it is possible for a package to need a gettext implementation even if
BR2_SYSTEM_ENABLE_NLSis disabled. So from there, we have two solutions:- Patch ecryptfs-utils itself so that it doesn't use gettext when --disable-nls is used. Perhaps this is the right thing to do. In this case, we could indeed mandate that the target gettext package is only available when BR2_SYSTEM_ENABLE_NLS=y, and therefore indeed have the gettext virtual package always point to gettext-gnu.
- Alternatively, support gettext-tiny as a target package, which would provide both libintl and the gettext program (the latter to please ecryptfs-utils).
I was initially worried that some packages that don't understand --disable-nls might try to link with libintl, and that we would therefore need a target gettext package even if
BR2_SYSTEM_ENABLE_NLS. However, libintl is only a replacement library for the gettext functions that don't exist in uclibc/musl, but do exist in glibc. Because in glibc they are part of the C library itself, I don't think any package is ever going to link explicitly with libintl. It's only Buildroot that ensures -lintl is passed to the LIBS/LDFLAGS when needed. So I believe we're good.
Quoted 1 line
So, perhaps the good solution is option (1) above ?
Many thanks for your feedback! Using the gnu gettext's tar is really better idea! Regarding ecryptfs-utils - yes, I think the patch might be really easy, something like this:
...
function trans {
if command -v gettext &> /dev/null; then
gettext @
else
echo @
fi
}
...
and replace gettext -> trans in scripts.
Regards,
Vadim Kochan
v3 cover Add gettext-tiny package
Hello Vadim,
Quoted 14 lines · On Sun, 10 Mar 2019 02:20:05 +0200 Vadim Kochan <[email protected]> wrote:
Many thanks for your feedback! Using the gnu gettext's tar is really better idea! Regarding ecryptfs-utils - yes, I think the patch might be really easy, something like this:
...
function trans {
if command -v gettext &>/dev/null; then
gettext @
else
echo @
fi
}
...
Quoted 1 line
and replace gettext -> trans in scripts.
Sounds good! Will you work on this ?
So, we agree that for the target gettext, only gettext-gnu will be a provider when BR2_SYSTEM_ENABLE_NLS=y. When BR2_SYSTEM_ENABLE_NLS is disabled, we don't have any target gettext package. Correct ? If so, then I'll rework my branch to take this into account.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
v3 cover Add gettext-tiny package
Vadim, All,
On 2019-03-10 10:11 +0100, Thomas Petazzoni spake thusly:
Quoted 10 lines
Quoted 7 lines · On Sun, 10 Mar 2019 02:20:05 +0200 Vadim Kochan <[email protected]> wrote:
Many thanks for your feedback! Using the gnu gettext's tar is really better idea! Regarding ecryptfs-utils - yes, I think the patch might be really easy, something like this:
...
function trans {
if command -v gettext &>/dev/null; then
'command' is not a POSIX builtin; it's a bashism, so there is no guarantee it is available:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
So, maybe:
if which gettext >/dev/null; then
gettext "${@}"
else
echo "${@}"
fiAlternatively, I believe it would be relatively trivial to provide a fake gettext rwapper:
#!/bin/sh
while [ ${#} -ne 0 ]; do
case "${1}" in
(-h) echo "no help"; exit 0;;
(-V) echo "0.0.0"; exit 0;;
(-d|--domain) shift 2;;
(-d*|--domain=*) shift 1;;
(-e|-E|-n) shift 1;;
(-s) shift 1;; # Ignore?
(*) break;;
esac
done
case ${#} in
(0) ;;
(1) echo "${1}";; # No TEXTDOMAIN?
(*) shift; echo "${@}";; # Ignore TEXTDOMAIN?
esacRegards,
Yann E. MORIN.
Quoted 23 lines
Quoted 8 lines
gettext @
else
echo @
fi
}
...and replace gettext -> trans in scripts.
Sounds good! Will you work on this ?
So, we agree that for the target gettext, only gettext-gnu will be a provider when BR2_SYSTEM_ENABLE_NLS=y. When
BR2_SYSTEM_ENABLE_NLSis disabled, we don't have any target gettext package. Correct ? If so, then I'll rework my branch to take this into account.Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
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. | '------------------------------^-------^------------------^--------------------'
v3 cover Add gettext-tiny package
Hi Yann, Thomas, All
Quoted 49 lines · Yann E. MORIN
Vadim, All,
On 2019-03-10 10:11 +0100, Thomas Petazzoni spake thusly:
Quoted 10 lines
Quoted 7 lines · On Sun, 10 Mar 2019 02:20:05 +0200 Vadim Kochan <[email protected]> wrote:
Many thanks for your feedback! Using the gnu gettext's tar is really better idea! Regarding ecryptfs-utils - yes, I think the patch might be really easy, something like this:
...
function trans {
if command -v gettext &>/dev/null; then'command' is not a POSIX builtin; it's a bashism, so there is no guarantee it is available:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.htmlSo, maybe:
if which gettext >/dev/null; then gettext "${@}" else echo "${@}" fiAlternatively, I believe it would be relatively trivial to provide a fake gettext rwapper:
#!/bin/sh while [ ${#} -ne 0 ]; do case "${1}" in (-h) echo "no help"; exit 0;; (-V) echo "0.0.0"; exit 0;; (-d|--domain) shift 2;; (-d*|--domain=*) shift 1;; (-e|-E|-n) shift 1;; (-s) shift 1;; # Ignore? (*) break;; esac done case ${#} in (0) ;; (1) echo "${1}";; # No TEXTDOMAIN? (*) shift; echo "${@}";; # Ignore TEXTDOMAIN? esac
Quoted 2 lines
Regards,
Yann E. MORIN.
Yann, thanks for this!
Quoted 12 lines
Quoted 12 lines
Quoted 9 lines
gettext @
else
echo @
fi
}
...and replace gettext -> trans in scripts.
Sounds good! Will you work on this ?
Quoted 8 lines
Quoted 8 lines
So, we agree that for the target gettext, only gettext-gnu will be a provider when BR2_SYSTEM_ENABLE_NLS=y. When
BR2_SYSTEM_ENABLE_NLSis disabled, we don't have any target gettext package. Correct ? If so, then I'll rework my branch to take this into account.Thanks,
Thomas
But, it looks like that there should be no problem if NLS is disabled (host-gettext is provided by gettext-tiny) and gettext (target) (provided by gettext-gnu) are enabled in the same time (of course 1 small fix is required in latest gettext-tiny series v3):
in file package/gettext/Config.in
Quoted 3 lines
config
BR2_PACKAGE_GETTEXT
bool "gettext"
selectBR2_PACKAGE_HAS_GETTEXT
*remove -> depends on BR2_SYSTEM_ENABLE_NLS
remove dependens on NLS to select gettext-gnu for the target.
So, both host-gettext-tiny and gettext-gnu should coexist as they provides different instances, right ?
If this is ok, then of course ecryptfs-utils needs support the gettext-less version, but it might be done later out of this scope ?
Regards,
Vadim Kochan
v3 cover Add gettext-tiny package
Hello,
Quoted 12 lines · On Mon, 11 Mar 2019 01:05:32 +0200 Vadim Kochan <[email protected]> wrote:
But, it looks like that there should be no problem if NLS is disabled (host-gettext is provided by gettext-tiny) and gettext (target) (provided by gettext-gnu) are enabled in the same time (of course 1 small fix is required in latest gettext-tiny series v3):
in file package/gettext/Config.in
Quoted 3 lines
config
BR2_PACKAGE_GETTEXT
bool "gettext"
selectBR2_PACKAGE_HAS_GETTEXT*remove -> depends on
BR2_SYSTEM_ENABLE_NLS
Quoted 7 lines
remove dependens on NLS to select gettext-gnu for the target.
So, both host-gettext-tiny and gettext-gnu should coexist as they provides different instances, right ?
If this is ok, then of course ecryptfs-utils needs support the gettext-less version, but it might be done later out of this scope ?
I don't really like to do this. It's a lot better if we can avoid gettext-gnu entirely if NLS is disabled. So I'd prefer if we could stick to one of the two options I proposed in my reply to your v3:
Option 1: we fix ecryptfs-utils to not unconditionally use gettext.
Option 2: we improve gettext-tiny so that it provides a fake gettext implementation, and we allow gettext-tiny as a gettext implementation for the target.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
v3 cover Add gettext-tiny package
Hi Thomas, Yann, All
Quoted 29 lines · Thomas Petazzoni
Hello,
Quoted 12 lines · On Mon, 11 Mar 2019 01:05:32 +0200 Vadim Kochan <[email protected]> wrote:
But, it looks like that there should be no problem if NLS is disabled (host-gettext is provided by gettext-tiny) and gettext (target) (provided by gettext-gnu) are enabled in the same time (of course 1 small fix is required in latest gettext-tiny series v3):
in file package/gettext/Config.in
Quoted 3 lines
config
BR2_PACKAGE_GETTEXT
bool "gettext"
selectBR2_PACKAGE_HAS_GETTEXT*remove -> depends on
BR2_SYSTEM_ENABLE_NLSQuoted 7 lines
remove dependens on NLS to select gettext-gnu for the target.
So, both host-gettext-tiny and gettext-gnu should coexist as they provides different instances, right ?
If this is ok, then of course ecryptfs-utils needs support the gettext-less version, but it might be done later out of this scope ?
I don't really like to do this. It's a lot better if we can avoid gettext-gnu entirely if NLS is disabled. So I'd prefer if we could stick to one of the two options I proposed in my reply to your v3:
Quoted 6 lines
Option 1: we fix ecryptfs-utils to not unconditionally use gettext.
Option 2: we improve gettext-tiny so that it provides a fake gettext implementation, and we allow gettext-tiny as a gettext implementation for the target.
Regarding ecryptfs-utils, looks like it is easy just to use function with "gettext" name and if gettext exists (by "which") then use the full path which is returned by "which", otherwise I think it is OK to use just "echo" or Yann's wrapper. Here is a sample script:
----------8<----------------
#! /bin/sh
GETTEXT_PROG=""
gettext() {
if [ -z "${GETTEXT_PROG}" ]; then
GETTEXT_PROG=$(which gettext)
if [ $? != 0 ]; then
GETTEXT_PROG=echo
fi
fi
${GETTEXT_PROG} "$@"
}gettext "XXXXXXXXXXXX"
gettext "ZZZZZZZZZZZZ"
gettext "CCCCCCCCCCCC"
-------->8------------------
Of course copy-n-pasting it to even few ecryptfs-utils's scripts looks not good, the better way if each script will source some 'common' one which has this gettext function. Otherwise, the better if gettext-tiny installs one for target because it may work w/o changing ecryptfs-utils, and it will work for other packages which may use gettext tool.
So I will start with ecryptfs-utils.
Regards,
Vadim Kochan
v3 cover Add gettext-tiny package
In reply to Yann E. MORINQuoted 2 lines · On Sun, 10 Mar 2019 11:18:52 +0100 "Yann E. MORIN" <[email protected]>…
Alternatively, I believe it would be relatively trivial to provide a fake gettext rwapper:
Well, that was the whole point of the discussion in my initial reply to Vadim's v3. Do we want to create a gettext-tiny target variant, which would install a fake gettext wrapper, or do we say "if NLS is disabled, there is no gettext support on the target". See my reply to Vadim v3 cover letter.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com