Skip to contentSkip to conversation

Clean up improper dependencies on gettext without LOCALE

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 12 messages Sep 21, 2012

lore
Share & tools
lore
#0 lore raw

cover Clean up improper dependencies on gettext without LOCALE

This series cleans up redundant dependencies on gettext, in packages that select gettext when LOCALE is not enabled.

The first 7 patches really remove the gettext dependency. The last three are in fact a NOP, because libglib2 selects gettext unconditionally. I have kept the NEEDS_GETTEXT_IF_LOCALE dependency for these packages, because they do have i18n code and do require libintl. But the dependency adds nothing, because libglib2 does the same already.

Regards,
Arnout

PS sorry for my earlier unfinished cover letter: I though I could still cancel its sending...

---

Arnout Vandecappelle (Essensium/Mind) (10):
diffutils: only needs gettext if locale is selected
flex: only needs gettext if locale is selected
ndisc6: only needs gettext if locale is selected
util-linux: only needs gettext if locale is selected
lshw: fix build with no LOCALE support
avahi: remove double dependency on gettext
pulseaudio: remove dependency on gettext
gdk-pixbuf: remove dependency on gettext
glib-networking: remove redundant dependency on gettext
libsoup: remove redundant dependency on gettext

 package/avahi/avahi.mk                      |    5 +----
 package/diffutils/Config.in                 |    1 +
 package/diffutils/diffutils.mk              |    3 +--
 package/flex/Config.in                      |    1 +
 package/flex/flex.mk                        |    3 +--
 package/gdk-pixbuf/Config.in                |    1 -
 package/gdk-pixbuf/gdk-pixbuf.mk            |    1 -
 package/glib-networking/Config.in           |    2 +-
 package/libsoup/Config.in                   |    2 +-
 package/lshw/Config.in                      |    2 +-
 package/lshw/lshw.mk                        |   12 +++++++++---
 package/multimedia/pulseaudio/Config.in     |    2 +-
 package/multimedia/pulseaudio/pulseaudio.mk |    2 +-
 package/ndisc6/Config.in                    |    1 +
 package/ndisc6/ndisc6.mk                    |    2 +-
 package/util-linux/Config.in                |    1 +
 package/util-linux/util-linux.mk            |    2 +-
 17 files changed, 23 insertions(+), 20 deletions(-)
Signature · 1 line
Signature
#1 lore raw

PATCH 1/10 diffutils: only needs gettext if locale is selected

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

Also add missing select in Config.in.

---
 package/diffutils/Config.in    |    1 +
 package/diffutils/diffutils.mk |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)
package/diffutils/Config.in +1 -0
index 86da5d3..4cc16e2 100644
@@ -1,6 +1,7 @@
 config BR2_PACKAGE_DIFFUTILS
 	bool"diffutils"
 	depends on BR2_USE_WCHAR
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  GNU diff. Compare files per line.
 
package/diffutils/diffutils.mk +1 -2
index 168d040..2530763 100644
@@ -6,8 +6,7 @@
 
 DIFFUTILS_VERSION = 3.2
 DIFFUTILS_SITE = $(BR2_GNU_MIRROR)/diffutils
-DIFFUTILS_DEPENDENCIES = \
-	$(if $(BR2_PACKAGE_GETTEXT),gettext)
+DIFFUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
 
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 DIFFUTILS_DEPENDENCIES += busybox
#2 lore raw

PATCH 2/10 flex: only needs gettext if locale is selected

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

Also add missing select in Config.in.

---
 package/flex/Config.in |    1 +
 package/flex/flex.mk   |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)
package/flex/Config.in +1 -0
index b10eb00..8ce4ccd 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_FLEX
 	bool "flex"
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  A fast lexical analyser generator.  A tool for generating
 	  programs that perform pattern-matching on text.
package/flex/flex.mk +1 -2
index 2599cdc..fe21432 100644
@@ -11,8 +11,7 @@ FLEX_PATCH = flex_$(FLEX_VERSION)-$(FLEX_PATCH_VERSION).diff.gz
 FLEX_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/f/flex
 FLEX_DIR = $(BUILD_DIR)/flex-$(FLEX_VERSION)
 FLEX_INSTALL_STAGING = YES
-FLEX_DEPENDENCIES = \
-	$(if $(BR2_PACKAGE_GETTEXT),gettext)
+FLEX_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
 # we don't have a host-gettext/libintl
 HOST_FLEX_DEPENDENCIES =
 
#3 lore raw

PATCH 3/10 ndisc6: only needs gettext if locale is selected

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

Also add missing select in Config.in.

---
 package/ndisc6/Config.in |    1 +
 package/ndisc6/ndisc6.mk |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
package/ndisc6/Config.in +1 -0
index 126bfa2..6abe4ce 100644
@@ -4,6 +4,7 @@ comment "ndisc6 requires a toolchain with IPv6 support"
 config BR2_PACKAGE_NDISC6
 	bool "ndisc6 tools"
 	depends on BR2_INET_IPV6
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  NDisc6 is a small collection of useful tools for IPv6 networking
 
package/ndisc6/ndisc6.mk +1 -1
index f58cc13..1d3c0e7 100644
@@ -10,7 +10,7 @@ NDISC6_SITE = http://www.remlab.net/files/ndisc6/
 NDISC6_CONF_ENV = CC="$(TARGET_CC) -std=gnu99"
 NDISC6_CONF_OPT = --localstatedir=/var --disable-rpath --disable-suid-install
 
-ifeq ($(BR2_PACKAGE_GETTEXT),y)
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 NDISC6_DEPENDENCIES += gettext
 NDISC6_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lintl"
 endif
#4 lore raw

PATCH 4/10 util-linux: only needs gettext if locale is selected

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

Also add missing select in Config.in.

---
 package/util-linux/Config.in     |    1 +
 package/util-linux/util-linux.mk |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
package/util-linux/Config.in +1 -0
index 43a8444..88d08e7 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_UTIL_LINUX
 	bool "util-linux"
 	depends on BR2_LARGEFILE
 	depends on BR2_USE_WCHAR
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  Various useful/essential Linux utilities.
 
package/util-linux/util-linux.mk +1 -1
index 71a6c53..a6abbf5 100644
@@ -29,7 +29,7 @@ else
 UTIL_LINUX_CONF_OPT += --without-ncurses
 endif
 
-ifeq ($(BR2_PACKAGE_GETTEXT),y)
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 UTIL_LINUX_DEPENDENCIES += gettext
 UTIL_LINUX_MAKE_OPT += LIBS=-lintl
 endif
#5 lore raw

PATCH 5/10 lshw: fix build with no LOCALE support

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

lshw doesn't need libintl if -DNONLS is defined.

---
 package/lshw/Config.in |    2 +-
 package/lshw/lshw.mk   |   12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)
package/lshw/Config.in +1 -1
index 98beacd..afefa6c 100644
@@ -3,7 +3,7 @@ config BR2_PACKAGE_LSHW
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_LARGEFILE
 	depends on BR2_USE_WCHAR
-	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  lshw (Hardware Lister) is a small tool to provide
 	  detailed information on the hardware configuration of the machine.
package/lshw/lshw.mk +9 -3
index 68daa0d..b3c2214 100644
@@ -6,10 +6,16 @@
 
 LSHW_VERSION = B.02.16
 LSHW_SITE = http://ezix.org/software/files
+
+LSHW_CFLAGS = $(TARGET_CFLAGS)
+ifeq ($(BR2_ENABLE_LOCALE),)
+LSHW_CFLAGS += -DNONLS
+endif
+
 LSHW_MAKE_OPT = CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" AR="$(TARGET_AR)" \
-	RPM_OPT_FLAGS="$(TARGET_CFLAGS)" all
-LSHW_MAKE_ENV = LIBS="$(if $(BR2_NEEDS_GETTEXT),-lintl)"
-LSHW_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT),gettext)
+	RPM_OPT_FLAGS="$(LSHW_CFLAGS)" all
+LSHW_MAKE_ENV = LIBS="$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),-lintl)"
+LSHW_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
 
 define LSHW_BUILD_CMDS
 	$(LSHW_MAKE_ENV) $(MAKE) -C $(@D)/src $(LSHW_MAKE_OPT)
#6 lore raw

PATCH 6/10 avahi: remove double dependency on gettext

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 package/avahi/avahi.mk |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
package/avahi/avahi.mk +1 -4
index 03dc368..6a6f524 100644
@@ -133,10 +133,7 @@ else
 AVAHI_CONF_OPT += --disable-python
 endif
 
-ifeq ($(BR2_PACKAGE_GETTEXT),y)
-AVAHI_DEPENDENCIES += gettext
-AVAHI_MAKE_OPT = LIBS=-lintl
-endif
+AVAHI_MAKE_OPT += $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),LIBS=-lintl)
 
 define AVAHI_REMOVE_INITSCRIPT
 	rm -rf $(TARGET_DIR)/etc/init.d/avahi-*
#7 lore raw

PATCH 7/10 pulseaudio: remove dependency on gettext

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The dependency on gettext is only due to libglib2, not due to portaudio itself. It works fine without gettext if libglib2 is not selected.

---
 package/multimedia/pulseaudio/Config.in     |    2 +-
 package/multimedia/pulseaudio/pulseaudio.mk |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/multimedia/pulseaudio/Config.in +1 -1
index 6c767bb..4845ffa 100644
@@ -5,7 +5,7 @@ config BR2_PACKAGE_PULSEAUDIO
 	select BR2_PACKAGE_JSON_C
 	select BR2_PACKAGE_LIBSNDFILE
 	select BR2_PACKAGE_SPEEX
-	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  PulseAudio is a sound system for POSIX OSes, meaning that it
 	  is a proxy for your sound applications. It allows you to do
package/multimedia/pulseaudio/pulseaudio.mk +1 -1
index 406dd8f..8015070 100644
@@ -16,7 +16,7 @@ PULSEAUDIO_CONF_OPT = \
 
 PULSEAUDIO_DEPENDENCIES = \
 	host-pkg-config libtool json-c libsndfile speex host-intltool \
-	$(if $(BR2_NEEDS_GETTEXT),gettext) \
+	$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) \
 	$(if $(BR2_PACKAGE_LIBATOMIC_OPS),libatomic_ops) \
 	$(if $(BR2_PACKAGE_LIBSAMPLERATE),libsamplerate) \
 	$(if $(BR2_PACKAGE_ALSA_LIB),alsa-lib) \
#8 lore raw

PATCH 7/10 pulseaudio: remove dependency on gettext

Dear Arnout Vandecappelle \(Essensium/Mind\),

Quoted 5 lines · Arnout Vandecappelle \(Essensium/Mind\)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The dependency on gettext is only due to libglib2, not due to portaudio itself. It works fine without gettext if libglib2 is not selected.

This description doesn't match what the patch is doing. The description says that you remove the gettext dependency, but the patch only changes the dependency to a _IF_LOCALE dependency.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#9 lore raw

PATCH 8/10 gdk-pixbuf: remove dependency on gettext

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The dependency on gettext comes from libglib2, not from gdk-pixbuf itself.

---
 package/gdk-pixbuf/Config.in     |    1 -
 package/gdk-pixbuf/gdk-pixbuf.mk |    1 -
 2 files changed, 2 deletions(-)
package/gdk-pixbuf/Config.in +0 -1
index 33b5f7c..f205793 100644
@@ -2,7 +2,6 @@ config BR2_PACKAGE_GDK_PIXBUF
 	bool "gdk-pixbuf"
 	depends on BR2_USE_WCHAR # glib2
 	select BR2_PACKAGE_LIBGLIB2
-	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	help
 	  Gdk-Pixbuf is an image loader and scaler. It uses GObject
package/gdk-pixbuf/gdk-pixbuf.mk +0 -1
index 92a34bf..7e1dc37 100644
@@ -40,7 +40,6 @@ GDK_PIXBUF_DEPENDENCIES += xlib_libX11
 endif
 
 GDK_PIXBUF_DEPENDENCIES += \
-	$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) \
 	$(if $(BR2_ENABLE_LOCALE),,libiconv) \
 	host-pkg-config libglib2
 
#10 lore raw

PATCH 9/10 glib-networking: remove redundant dependency on gettext

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 package/glib-networking/Config.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/glib-networking/Config.in +1 -1
index dab35ea..f1aa7ee 100644
@@ -2,7 +2,7 @@ config BR2_PACKAGE_GLIB_NETWORKING
 	bool "glib-networking"
 	depends on BR2_USE_WCHAR # glib2
 	select BR2_PACKAGE_LIBGLIB2
-	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  Network-related GIO modules for glib.
 
#11 lore raw

PATCH 10/10 libsoup: remove redundant dependency on gettext

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 package/libsoup/Config.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/libsoup/Config.in +1 -1
index 57b425f..219f822 100644
@@ -3,7 +3,7 @@ config BR2_PACKAGE_LIBSOUP
 	depends on BR2_USE_WCHAR # glib2 and gnutls
 	select BR2_PACKAGE_LIBXML2
 	select BR2_PACKAGE_LIBGLIB2
-	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  libsoup is an HTTP client/server library. It uses GObject
 	  and the GLib main loop, to integrate well with GNOME