Skip to contentSkip to conversation

gettext: add gettextize definition

PATCH New Gustavo Zacarias 5 participants 15 messages Jul 12, 2014 – Jul 15, 2014 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 gettext: add gettextize definition

To be used in pkg-autotools for AUTORECONF.
Also delete the "Press Return..." prompt to avoid user confusion.

---
 package/gettext/gettext.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/gettext/gettext.mk +4 -0
index 9d5d9f3..4385f10 100644
@@ -69,8 +69,12 @@ endif
 # Disable interactive confirmation in host gettextize for package fixups
 define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 	$(SED) '/read dummy/d' $(HOST_DIR)/usr/bin/gettextize
+	$(SED) '/Press Return/d' $(HOST_DIR)/usr/bin/gettextize
 endef
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
+
+# variables used by other packages
+GETTEXTIZE = $(HOST_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/gettextize -f
Signature · 1 line
1.8.5.5
#1 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

Since the bump to gettext version 0.19 many autoreconfigured packages will complain about gettext infra version mismatch and fail to AUTORECONF.
Fix this by hooking up a gettextize run before autoreconfiguring.

It adds some extra build time when doing autoreconf passes but the alternative would require a new GETTEXTIZE option and package audit which could take some time to get resolved.

Fixes:
http://autobuild.buildroot.net/results/6d4/6d477b7042d949c3ceea9a63bd26ffc187a67221/

---
 package/pkg-autotools.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/pkg-autotools.mk +4 -4
index ddff9bf..544f524 100644
@@ -204,7 +204,7 @@ endif
 #
 define AUTORECONF_HOOK
 	@$$(call MESSAGE,"Autoreconfiguring")
-	$$(Q)cd $$($$(PKG)_SRCDIR) && $$(AUTORECONF) $$($$(PKG)_AUTORECONF_OPT)
+	$$(Q)cd $$($$(PKG)_SRCDIR) && $$(GETTEXTIZE) && $$(AUTORECONF) $$($$(PKG)_AUTORECONF_OPT)
 	$$(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES"; then \
 		for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \
 			ltmain_version=`sed -n '/^[ 	]*VERSION=/{s/^[ 	]*VERSION=//;p;q;}' $$$$i | \
@@ -224,14 +224,14 @@ endef
 # _DEPENDENCIES if _AUTORECONF is YES.  Also filter the result of _AUTORECONF
 # away from the non-host rule
 ifeq ($(4),host)
-$(2)_DEPENDENCIES ?= $$(filter-out host-automake host-autoconf host-libtool \
-				host-toolchain $(1),\
+$(2)_DEPENDENCIES ?= $$(filter-out host-automake host-autoconf host-gettext \
+				host-libtool host-toolchain $(1),\
     $$(patsubst host-host-%,host-%,$$(addprefix host-,$$($(3)_DEPENDENCIES))))
 endif
 
 ifeq ($$($(2)_AUTORECONF),YES)
 $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
-$(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
+$(2)_DEPENDENCIES += host-automake host-autoconf host-gettext host-libtool
 endif
 
 #
Signature · 1 line
1.8.5.5
#2 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

Dear Gustavo Zacarias,

Quoted 3 lines · Gustavo Zacarias

It adds some extra build time when doing autoreconf passes but the alternative would require a new GETTEXTIZE option and package audit which could take some time to get resolved.

I believe I would actually prefer a separate GETTEXTIZE option, I'm a little bit worried about the extra build time. What do others think?

Thanks,

Thomas

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

PATCH 2/3 infra: add gettextize run in AUTORECONF

Quoted 2 lines · Thomas Petazzoni

I believe I would actually prefer a separate GETTEXTIZE option, I'm a little bit worried about the extra build time. What do others think?

That's fine with me as well, however we'll be hunting a little until the autobuilders look greener :)
Regards.

#4 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

In reply to Thomas Petazzoni
Quoted 2 lines · Thomas Petazzoni

I believe I would actually prefer a separate GETTEXTIZE option, I'm a little bit worried about the extra build time. What do others think?

Expanding a little bit on my rationale i opted for simplicity when making the patch ("fix it quick"), and it may not be that straightforward to document.
Also it only add big time to the autoreconf deps, a gettextize run is usually quite quick, in the one digit seconds.
Regards.

#5 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

In reply to Thomas Petazzoni

Thomas, Gustavo, All,

On 2014-07-14 13:01 +0200, Thomas Petazzoni spake thusly:

Quoted 7 lines · Gustavo Zacarias
Quoted 3 lines

It adds some extra build time when doing autoreconf passes but the alternative would require a new GETTEXTIZE option and package audit which could take some time to get resolved.

I believe I would actually prefer a separate GETTEXTIZE option, I'm a little bit worried about the extra build time. What do others think?

Should I revive the series I did a while ago, that did just that?

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

Quoted 1 line · Yann E. MORIN

Should I revive the series I did a while ago, that did just that?

A couple of fixes:
It needs the filter-out addition for host-gettext in package/pkg-autotools.mk (like AUTORECONF does), and probably a tiny mention that GETTEXTIZING without AUTORECONF is useless. Also we might be able to filter gettextizing out when gettext/host-gettext aren't pulled in - no infra version mismatch to account for, hence time savings.
Regards.

#7 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

Gustavo, All,

On 2014-07-14 09:40 -0300, Gustavo Zacarias spake thusly:

Quoted 7 lines · Yann E. MORIN
Quoted 1 line

Should I revive the series I did a while ago, that did just that?

A couple of fixes:
It needs the filter-out addition for host-gettext in package/pkg-autotools.mk (like AUTORECONF does), and probably a tiny mention that GETTEXTIZING without AUTORECONF is useless.

Yep.

Quoted 3 lines

Also we might be able to filter gettextizing out when gettext/host-gettext aren't pulled in - no infra version mismatch to account for, hence time savings.

But we can only know that when the package is extracted+patched, which is too late for the dependency rules, no?

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

Quoted 6 lines · Yann E. MORIN
Quoted 3 lines

Also we might be able to filter gettextizing out when gettext/host-gettext aren't pulled in - no infra version mismatch to account for, hence time savings.

But we can only know that when the package is extracted+patched, which is too late for the dependency rules, no?

It's likely the host-gettext infra that triggers the problem (may as well be target gettext, i haven't tested as much), so we might be able to skip the run if gettext isn't in DEPENDENCIES (and not pulling it in if GETTEXTIZE = YES, just running if it is for packages that gettextize). Regards.

#9 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

In reply to Thomas Petazzoni
Quoted 10 lines · Thomas Petazzoni

Dear Gustavo Zacarias,

Quoted 3 lines · Gustavo Zacarias

It adds some extra build time when doing autoreconf passes but the alternative would require a new GETTEXTIZE option and package audit which could take some time to get resolved.

I believe I would actually prefer a separate GETTEXTIZE option, I'm a little bit worried about the extra build time. What do others think?

I agree with Gustavo that the extra 2 seconds of gettextize are anyway dwarfed
by the 15 seconds for autoreconf (on my I/O-bound laptop). So I wouldn't bother with an extra option.

My worry is more that gettextize could fail, like autoreconf sometimes does.
Though I think the risk is lower for gettextize.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#10 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

Dear Arnout Vandecappelle,

Quoted 6 lines · Arnout Vandecappelle
Quoted 2 lines

I believe I would actually prefer a separate GETTEXTIZE option, I'm a little bit worried about the extra build time. What do others think?

I agree with Gustavo that the extra 2 seconds of gettextize are anyway dwarfed
by the 15 seconds for autoreconf (on my I/O-bound laptop). So I wouldn't bother with an extra option.

Actually, I am not worried about the duration of the gettextize step itself, but worried about the fact that host-gettext now gets unconditionally added to all packages that have <pkg>_AUTORECONF = YES, while this gettextize is probably not needed for the majority of them. So we pull-in a fairly heavy dependency (host-gettext) for no reason for such packages.

Thomas

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

PATCH 2/3 infra: add gettextize run in AUTORECONF

Quoted 6 lines · Thomas Petazzoni

Actually, I am not worried about the duration of the gettextize step itself, but worried about the fact that host-gettext now gets unconditionally added to all packages that have <pkg>_AUTORECONF = YES, while this gettextize is probably not needed for the majority of them. So we pull-in a fairly heavy dependency (host-gettext) for no reason for such packages.

At least libffi doesn't like getting gettextized, probably some stray gettext bits in it's build stuff without really using it.
So i'm leaning towards PKG_GETTEXTIZE, or at least trying to detect if it's required (a find for gettext.m4 in the package source should suffice). Regards.

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw

PATCH 2/3 infra: add gettextize run in AUTORECONF

Quoted 11 lines · Gustavo Zacarias
Quoted 8 lines · Thomas Petazzoni

Except that trying to detect if it's required will still make the dependency on host-gettext mandatory.

What would be good to have is <pkg>_GETTEXTIZE + a check that verifies whether the gettextize is still needed or not. This way, on the packages on which we'll be adding <pkg>_GETTEXTIZE = YES, we will notice when the <pkg>_GETTEXTIZE = YES can be remove after an upstream bump.

Quoted 7 lines

Detecting if it's required via gettext.m4 says if it's using the infra, but you must do a grep for the serial usually in $(@D)/m4/gettext.m4 to know if it's a different version.
If we do a silent warning it will probably pass unnoticed, making it fatal would be best probably - though we never did that kind of behaviour before it would only affect bumps.
Regards.

And i forgot to cc@ the list again, broke it when adding Yann before :) Looking at the source upstream had the great idea of NOT updating the serial so that won't work, sigh...
Regards.

#16 lore raw

PATCH 3/3 wget: remove redundant gettextize run

In reply to Gustavo Zacarias
---
 package/wget/wget.mk | 8 --------
 1 file changed, 8 deletions(-)
package/wget/wget.mk +0 -8
index 56ccfb5..c546aba 100644
@@ -13,14 +13,6 @@ 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
-
 # Prefer full-blown wget over busybox
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 	WGET_DEPENDENCIES += busybox
Signature · 1 line
1.8.5.5
#17 lore raw

PATCH 3/3 wget: remove redundant gettextize run

Hi Gustavo,

Quoted 1 line · Gustavo Zacarias

Please explain in the commit log that gettextize now runs unconditionally when enabling AUTORECONF.

baruch

Quoted 23 lines
---
 package/wget/wget.mk | 8 --------
 1 file changed, 8 deletions(-)
package/wget/wget.mk +0 -8
index 56ccfb5..c546aba 100644
@@ -13,14 +13,6 @@ 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
-
 # Prefer full-blown wget over busybox
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 	WGET_DEPENDENCIES += busybox
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -