]> code.ossystems Code Review - openembedded-core.git/commitdiff
gettext.bbclass: Updates to better handle gettext alternatives
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 3 May 2011 23:32:48 +0000 (00:32 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 3 May 2011 23:38:06 +0000 (00:38 +0100)
* Change gettext dependency to virtual/gettext

* Ensure INHIBIT_DEFAULT_DEPS removes gettext dependencies

* Use BASEDEPENDS to ensure dependencies are added in native/nativesdk cases

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/gettext.bbclass
meta/classes/insane.bbclass

index a40e74f819ed3b37209224b773dc383e06fb30ac..6f79e5ee7679059f8b830ab25d8f220430980485 100644 (file)
@@ -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)}"
index 98acf7f5a4fea73606451c3b8c94ade3f5019122..a3ea0e5ef0c00990533b18c667e5ef8a2497dc23 100644 (file)
@@ -584,7 +584,7 @@ Rerun configure task after fixing this. The path was '%s'""" % root)
        elif bb.data.inherits_class('cross-canadian', d):
           gt = "gettext-nativesdk"
        else:
-          gt = "gettext"
+          gt = "virtual/gettext"
        deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "")
        if gt not in deps:
           for config in configs: