Skip to contentSkip to conversation

Add gettext-tiny package

PATCH Superseded Vadim Kochan 2 participants 7 messages Jan 5, 2019 – Feb 6, 2019

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 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.

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 (3):
package/wine: Add gettext dependency for host-wine only with NLS
enabled
package/gettext: Turn into virtual package package/gettext-tiny: Add new package

 DEVELOPERS                                         |   3 +
 .../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 +--
 package/wine/wine.mk                               |   4 +
 12 files changed, 1016 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.mk
Signature · 1 line
2.14.1
#1 lore raw

PATCH v2 1/3 package/wine: Add gettext dependency for host-wine only with NLS enabled

Checked that host-wine compiles ok without host-gettext, so no needs to specify this dependency.

libgettextpo is required by tools/wrc (https://linux.die.net/man/1/wrc)
which allows to convert windows resources also to *.po format, which is not needed if NLS is disabled.

---
 package/wine/wine.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/wine/wine.mk +4 -0
index 78c8e6ab63..7e44e3c81d 100644
@@ -307,8 +307,12 @@ WINE_CONF_OPTS += --without-zlib
 endif
 
 # host-gettext is essential for .po file support in host-wine wrc
+ifeq ($(BR2_SYSTEM_ENABLE_NLS),y)
 HOST_WINE_DEPENDENCIES += host-gettext
 HOST_WINE_CONF_OPTS += --with-gettext --with-gettextpo
+else
+HOST_WINE_CONF_OPTS += --without-gettext --without-gettextpo
+endif
 
 # Wine needs to enable 64-bit build tools on 64-bit host
 ifeq ($(HOSTARCH),x86_64)
Signature · 1 line
2.14.1
#2 lore raw

PATCH v2 1/3 package/wine: Add gettext dependency for host-wine only with NLS enabled

Quoted 11 lines · On Sat, 5 Jan 2019 22:00:44 +0200 Vadim Kochan <[email protected]> wrote:

Checked that host-wine compiles ok without host-gettext, so no needs to specify this dependency.

libgettextpo is required by tools/wrc (https://linux.die.net/man/1/wrc)
which allows to convert windows resources also to *.po format, which is not needed if NLS is disabled.

---
 package/wine/wine.mk | 4 ++++
 1 file changed, 4 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 2/3 package/gettext: Turn into virtual package

In reply to Vadim Kochan

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.mk
package/gettext-gnu/0001-error_print_progname.patch renamed from package/gettext/0001-error_print_progname.patch +0 -0
similarity index 100%
rename from package/gettext/0001-error_print_progname.patch
rename to package/gettext-gnu/0001-error_print_progname.patch
package/gettext-gnu/0002-Update-after-gnulib-changed.patch renamed from package/gettext/0002-Update-after-gnulib-changed.patch +0 -0
similarity index 100%
rename from package/gettext/0002-Update-after-gnulib-changed.patch
rename to package/gettext-gnu/0002-Update-after-gnulib-changed.patch
package/gettext-gnu/gettext-gnu.hash renamed from package/gettext/gettext.hash +0 -0
similarity index 100%
rename from package/gettext/gettext.hash
rename to package/gettext-gnu/gettext-gnu.hash
package/gettext-gnu/gettext-gnu.mk new file +103 -0

103 lines not on this page · raw message

package/gettext/Config.in +21 -5
index e55663b1d7..9546468571 100644
@@ -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
#4 lore raw

PATCH v2 3/3 package/gettext-tiny: Add new package

In reply to Vadim Kochan

Add 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                                         |   3 +
 ...-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, 895 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 +3 -0
index 9654fcf2bf..0df7e4b83e 100644
@@ -2140,6 +2140,9 @@ N:	Tzu-Jung Lee <[email protected]>
 F:	package/dropwatch/
 F:	package/tstools/
 
+N:	Vadim Kochan <[email protected]>
+F:	package/gettext-tiny/
+
 N:	Valentin Korenblit <[email protected]>
 F:	package/clang/
 F:	package/clinfo/
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
new file mode 100644
index 0000000000..31fde2a525
@@ -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
index 9546468571..158864e299 100644
@@ -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
#5 lore raw

PATCH v2 3/3 package/gettext-tiny: Add new package

Hi All,

package/gettext/Config.in config BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL · line 42

Quoted 10 lines
package/gettext/Config.in +5 -3
+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

I really think that for a while it is better to make allow select host-gettext-tiny optionally, because there might be issues with some packages. After it will be stable it is safe to select it automatically if !BR2_SYSTEM_ENABLE_NLS.

Regards,
Vadim Kochan

#6 lore raw

v2 cover Add gettext-tiny package

In reply to Vadim Kochan

Hi All,

Quoted 58 lines · Vadim Kochan

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.

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 (3):
package/wine: Add gettext dependency for host-wine only with NLS
enabled
package/gettext: Turn into virtual package package/gettext-tiny: Add new package

 DEVELOPERS                                         |   3 +
 .../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 +--
 package/wine/wine.mk                               |   4 +
 12 files changed, 1016 insertions(+), 99 deletions(-)
Quoted 12 lines
 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.mk
Signature · 1 line
2.14.1

Just 'd like to know if someone will have a chance to review/test these changes.

Thanks,
Vadim Kochan