Patchwork [36/52] gettext.bbclass: Use _append instead of =+

login
register
mail settings
Submitter Richard Purdie
Date May 3, 2011, 10:39 p.m.
Message ID <1304462379.21461.144.camel@rex>
Download mbox | patch
Permalink /patch/3117/
State New, archived
Headers show

Comments

Richard Purdie - May 3, 2011, 10:39 p.m.
On Tue, 2011-05-03 at 11:04 -0700, Khem Raj wrote:
> This has the same problem It empties out DEPENDS_GETTEXT after they have
> have already been added to DEPENDS via virtclass e.g. when you build
> gcc-runtime-nativesdk it will report a dep loop since now it depends on
> virtual/gettext-nativesdk (added by gettext class)
> and virtual/gettext-nativesdk depends on compilerlibs
> provided by gcc-runtime-nativesdk. This was same problem I was trying to
> circumvent

Ok, how about this version:

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 4f20bc2..3b83e42 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -89,9 +89,11 @@  def base_dep_prepend(d):
 			deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
 	return deps
 
-DEPENDS_prepend="${@base_dep_prepend(d)} "
-DEPENDS_virtclass-native_prepend="${@base_dep_prepend(d)} "
-DEPENDS_virtclass-nativesdk_prepend="${@base_dep_prepend(d)} "
+BASEDEPENDS = "${@base_dep_prepend(d)}"
+
+DEPENDS_prepend="${BASEDEPENDS} "
+DEPENDS_virtclass-native_prepend="${BASEDEPENDS} "
+DEPENDS_virtclass-nativesdk_prepend="${BASEDEPENDS} "
 
 FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
 # THISDIR only works properly with imediate expansion as it has to run
diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
index a40e74f..6f79e5e 100644
--- a/meta/classes/gettext.bbclass
+++ b/meta/classes/gettext.bbclass
@@ -1,17 +1,17 @@ 
-def gettext_after_parse(d):
-    # Remove the NLS bits if USE_NLS is no.
-    if bb.data.getVar('USE_NLS', d, 1) == 'no':
-        cfg = oe_filter_out('^--(dis|en)able-nls$', bb.data.getVar('EXTRA_OECONF', d, 1) or "", d)
-        cfg += " --disable-nls"
-        depends = bb.data.getVar('DEPENDS', d, 1) or ""
-        bb.data.setVar('DEPENDS', oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
-        bb.data.setVar('EXTRA_OECONF', cfg, d)
+def gettext_dependencies(d):
+    if d.getVar('USE_NLS', True) == 'no':
+        return ""
+    if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not oe.utils.inherits(d, 'cross-canadian'):
+        return ""
+    return d.getVar('DEPENDS_GETTEXT', False)
 
-python () {
-    gettext_after_parse(d)
-}
+def gettext_oeconf(d):
+    # Remove the NLS bits if USE_NLS is no.
+    if d.getVar('USE_NLS', True) == 'no':
+        return '--disable-nls'
+    return "--enable-nls"
 
-DEPENDS_GETTEXT = "gettext gettext-native"
+DEPENDS_GETTEXT = "virtual/gettext gettext-native"
 
-DEPENDS =+ "${DEPENDS_GETTEXT}"
-EXTRA_OECONF += "--enable-nls"
+BASEDEPENDS =+ "${@gettext_dependencies(d)}"
+EXTRA_OECONF += "${@gettext_oeconf(d)}"