Skip to contentSkip to conversation

pkg-autotools: introduce infra to gettextize packages (branch yem/gettext)

PATCH New Yann E. MORIN 2 participants 8 messages Jul 16, 2014 – Jul 17, 2014

lore
Share & tools
lore
#0 lore raw

v3 cover pkg-autotools: introduce infra to gettextize packages (branch yem/gettext)

Hello All!

This small series introduces the gettextize of a package as an optional sequence in the autotools package infra.

It has been only slightly tested, so is still in RFC stage.

Three packages have been converted: wget (the historical offender), coreutils and parted. Others may need gettextizing, too, but the autobuilders (or users) will catch them eventually.

Changes v2 -> v3:
- fix double-dollars (Gustavo)
- fix hook name (Gustavo)
- reword commit log for wget package (Gustavo)
- gettextize gst1-plugins-bad (Gustavo)
- typoes (Gustavo)

Changes RFCv1 -> RFCv2:
- only getttextize with autoreconf (Gustavo)

Regards,
Yann E. MORIN.

The following changes since commit cff18c2f347a46fb996808b6ac439e2a222aa189:

opencv: add jasper support (2014-07-16 22:59:03 +0200)

are available in the git repository at:

git://gitorious.org/buildroot/buildroot.git yem/gettext

for you to fetch changes up to f200992ff52ec38350cf0fcd1d79c5b459da175f:

package/gst1-plugins-bad: gettextize to match the new gettext version (2014-07-16 23:57:48 +0200)

----------------------------------------------------------------
Yann E. MORIN (6):
pkg-autotools: add support to gettextize a package
manual: add gettextize explanations in the manual package/wget: use the new gettextize infra package/coreutils: gettextize to match the new gettext version package/parted: gettextize to match the new gettext version package/gst1-plugins-bad: gettextize to match the new gettext version

 docs/manual/adding-packages-autotools.txt          | 12 ++++++++
 package/coreutils/coreutils.mk                     |  1 +
 .../gst1-plugins-bad/gst1-plugins-bad.mk           |  1 +
 package/parted/parted.mk                           |  1 +
 package/pkg-autotools.mk                           | 33 ++++++++++++++++++++--
 package/wget/wget.mk                               |  9 +-----
 6 files changed, 47 insertions(+), 10 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v3 1/6 pkg-autotools: add support to gettextize a package

In case a package comes with a gettext infra which is different from the one Buildroot provides, we'd get autoreconf errors, like:

    http://autobuild.buildroot.net/results/c0f/c0f7c801f61fdc310cde64342060b00a70155431/

To avoid that, we need to gettextize the package prior to running autoreconf.

Provide the necessary infrastructure in the autotools infrastructure, so we can do it consistently across packages.

Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Baruch Siach <[email protected]>

---
Changes v2 -> v3:
- fix double-dollars (Gustavo)
- fix hook name (Gustavo)

Changes v1 -> v2:
- only gettextize with autoreconf (Gustavo)
- add host-gettext to the filter-out (Gustavo)

---
 package/pkg-autotools.mk | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)
package/pkg-autotools.mk +31 -2
index ddff9bf..50876cb 100644
@@ -87,6 +87,22 @@ ifndef $(2)_AUTORECONF
  endif
 endif
 
+ifndef $(2)_GETTEXTIZE
+ ifdef $(3)_GETTEXTIZE
+  $(2)_GETTEXTIZE = $$($(3)_GETTEXTIZE)
+ else
+  $(2)_GETTEXTIZE ?= NO
+ endif
+endif
+
+ifndef $(2)_GETTEXTIZE_OPT
+ ifdef $(3)_GETTEXTIZE_OPT
+  $(2)_GETTEXTIZE_OPT = $$($(3)_GETTEXTIZE)
+ else
+  $(2)_GETTEXTIZE_OPT ?= -f
+ endif
+endif
+
 ifeq ($(4),host)
  $(2)_AUTORECONF_OPT ?= $$($(3)_AUTORECONF_OPT)
 endif
@@ -200,6 +216,14 @@ $(2)_POST_PATCH_HOOKS += LIBTOOL_PATCH_HOOK
 endif
 
 #
+# Hook to gettextize the package if needed
+#
+define GETTEXTIZE_HOOK
+	@$$(call MESSAGE,"Gettextizing")
+	$(Q)cd $$($$(PKG)_SRCDIR) && $(HOST_DIR)/usr/bin/gettextize $$($$(PKG)_GETTEXTIZE_OPT)
+endef
+
+#
 # Hook to autoreconf the package if needed
 #
 define AUTORECONF_HOOK
@@ -222,14 +246,19 @@ endef
 
 # This must be repeated from inner-generic-package, otherwise we get an empty
 # _DEPENDENCIES if _AUTORECONF is YES.  Also filter the result of _AUTORECONF
-# away from the non-host rule
+# and _GETTEXTIZE away from the non-host rule
 ifeq ($(4),host)
 $(2)_DEPENDENCIES ?= $$(filter-out host-automake host-autoconf host-libtool \
-				host-toolchain $(1),\
+				host-gettext host-toolchain $(1),\
     $$(patsubst host-host-%,host-%,$$(addprefix host-,$$($(3)_DEPENDENCIES))))
 endif
 
 ifeq ($$($(2)_AUTORECONF),YES)
+# This has to come before autoreconf
+ifeq ($$($(2)_GETTEXTIZE),YES)
+$(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK
+$(2)_DEPENDENCIES += host-gettext
+endif
 $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
 $(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
 endif
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 2/6 manual: add gettextize explanations in the manual

In reply to Yann E. MORIN
Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Baruch Siach <[email protected]>

---
Changes v2 -> v3:
- fix typoes (Gustavo)

Changes v1 -> v2:
- gettextize is only valid if autoreconf=yes (Gustavo)

---
 docs/manual/adding-packages-autotools.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
docs/manual/adding-packages-autotools.txt +12 -0
index c7e797f..3f40503 100644
@@ -125,6 +125,18 @@ cases, typical packages will therefore only use a few of them.
   passed to the 'autoreconf' program if
   +LIBFOO_AUTORECONF=YES+. By default, empty.
 
+* +LIBFOO_GETTEXTIZE+, tells whether the package should be
+  gettextized or not (i.e. if the package uses a different gettext
+  version than Buildroot provides, and it is needed to run
+  'gettextize'.) Only valid when +LIBFOO_AUTORECONF=YES+. Valid
+  values are +YES+ and +NO+. The default is +NO+.
+
+* +LIBFOO_GETTEXTIZE_OPT+, to specify additional options passed to
+  the 'gettextize' program, if +LIBFOO_GETTEXTIZE=YES+. You may
+  use that if, for example, the +.po+ files are not located in the
+  standard place (i.e. in +po/+ at the root of the package.) By
+  default, '-f'.
+
 * +LIBFOO_LIBTOOL_PATCH+ tells whether the Buildroot
   patch to fix libtool cross-compilation issues should be applied or
   not. Valid values are +YES+ and +NO+. By
Signature · 1 line
1.9.1
#3 lore raw

PATCH v3 3/6 package/wget: use the new gettextize infra

In reply to Yann E. MORIN

Instead of using a custom hook to gettextize wget, use the new gettextize infra we just added in the previous patch.

Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Baruch Siach <[email protected]>

---
Changes v2 -> v3:
- reword commit log (Gustavo)
- remove comment (Baruch)

---
 package/wget/wget.mk | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
package/wget/wget.mk +1 -8
index 56ccfb5..8046a61 100644
@@ -12,14 +12,7 @@ WGET_LICENSE_FILES = COPYING
 
 # patching gnulib .m4 file
 WGET_AUTORECONF = YES
-
-# Ugly kludge to fix autoreconf with old gettext infra
-# We need to gettextize before autoreconf to upgrade
-WGET_DEPENDENCIES += host-gettext
-define WGET_GETTEXTIZE
-	cd $(@D) ; $(HOST_DIR)/usr/bin/gettextize -f
-endef
-WGET_PRE_CONFIGURE_HOOKS += WGET_GETTEXTIZE
+WGET_GETTEXTIZE = YES
 
 # Prefer full-blown wget over busybox
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
Signature · 1 line
1.9.1
#4 lore raw

PATCH v3 4/6 package/coreutils: gettextize to match the new gettext version

In reply to Yann E. MORIN

The gettext macros in the package are from a gettext version older than the one we have in Buildroot, so autoreconf fails.

Run gettextize prior to running autoreconf, like we do in wget.

Fixes:

    http://autobuild.buildroot.net/results/228/228224668be4376844fe924d0a5b346af0414460/
    http://autobuild.buildroot.net/results/ac4/ac4dbb1342e9c9f1de5412e0b71fe4422ef744ef/
    http://autobuild.buildroot.net/results/a0c/a0c25faf149de9d51768eed8ff5a2274282cd797/
    ...
---
 package/coreutils/coreutils.mk | 1 +
 1 file changed, 1 insertion(+)
package/coreutils/coreutils.mk +1 -0
index c90396d..af202b4 100644
@@ -12,6 +12,7 @@ COREUTILS_LICENSE_FILES = COPYING
 
 # patching gnulib .m4 file
 COREUTILS_AUTORECONF = YES
+COREUTILS_GETTEXTIZE = YES
 
 # If both coreutils and busybox are selected, make certain coreutils
 # wins the fight over who gets to have their utils actually installed.
Signature · 1 line
1.9.1
#5 lore raw

PATCH v3 5/6 package/parted: gettextize to match the new gettext version

In reply to Yann E. MORIN

The gettext macros in the package are from a gettext version older than the one we have in Buildroot, so autoreconf fails.

Run gettextize prior to running autoreconf, like we do in wget.

Fixes:

    http://autobuild.buildroot.net/results/ee2/ee20455ead785200847f50e463c32c55821f8925/
    http://autobuild.buildroot.net/results/3fe/3fe46e1a6ef10645e46a2e9efdf651f60f05dea8/
    http://autobuild.buildroot.net/results/ecd/ecdacafb3245afa1cce4f587eff9bdfe5c162f81/
    ...
---
 package/parted/parted.mk | 1 +
 1 file changed, 1 insertion(+)
package/parted/parted.mk +1 -0
index fd82684..75537a7 100644
@@ -11,6 +11,7 @@ PARTED_DEPENDENCIES = util-linux
 PARTED_INSTALL_STAGING = YES
 # For uclinux patch
 PARTED_AUTORECONF = YES
+PARTED_GETTEXTIZE = YES
 PARTED_LICENSE = GPLv3+
 PARTED_LICENSE_FILES = COPYING
 
Signature · 1 line
1.9.1
#6 lore raw

PATCH v3 6/6 package/gst1-plugins-bad: gettextize to match the new gettext version

In reply to Yann E. MORIN

The gettext macros in the package are from a gettext version older than the ones we have in Buildroot, so autoreconf fails.

Run gettextize prior to running autoreconf, like we do in wget.

Fixes:

    http://autobuild.buildroot.org/results/ea6/ea6797f9595c34734229c78b4e25bf624925144b/
    http://autobuild.buildroot.org/results/578/5781774ae1b7ba85efee4bc933235304169b9196/
    http://autobuild.buildroot.org/results/188/18888e06058dff0249d7c5e10a2c4f46e059878a/
    ...
Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk | 1 +
 1 file changed, 1 insertion(+)
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk +1 -0
index 25289d2..e7d265f 100644
@@ -14,6 +14,7 @@ GST1_PLUGINS_BAD_LICENSE = LGPLv2+ LGPLv2.1+
 
 GST1_PLUGINS_BAD_AUTORECONF = YES
 GST1_PLUGINS_BAD_AUTORECONF_OPT = -I $(@D)/common/m4
+GST1_PLUGINS_BAD_GETTEXTIZE = YES
 
 GST1_PLUGINS_BAD_CONF_OPT = \
 	--disable-examples \
Signature · 1 line
1.9.1
#7 lore raw

v3 cover pkg-autotools: introduce infra to gettextize packages (branch yem/gettext)

In reply to Yann E. MORIN

Dear Yann E. MORIN,

Quoted 8 lines · Yann E. MORIN

This small series introduces the gettextize of a package as an optional sequence in the autotools package infra.

It has been only slightly tested, so is still in RFC stage.

Three packages have been converted: wget (the historical offender), coreutils and parted. Others may need gettextizing, too, but the autobuilders (or users) will catch them eventually.

Since this issue was causing some much breakage in the autobuilders, I've applied your series. If there are some fixes or improvements to be made, either due to additional review, or additional issues being discovered, we can handle them as followup patches.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com