[oe-commits] Richard Purdie : native.bbclass: Add BBCLASSEXTEND support (from poky)

git version control git at git.openembedded.org
Tue Nov 10 13:59:03 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 4ecbf17b161b54780c26af2c6e90333f8825b013
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=4ecbf17b161b54780c26af2c6e90333f8825b013

Author: Richard Purdie <rpurdie at linux.intel.com>
Date:   Tue Nov 10 13:53:17 2009 +0000

native.bbclass: Add BBCLASSEXTEND support (from poky)

Signed-off-by: Richard Purdie <rpurdie at linux.intel.com>

---

 classes/autotools.bbclass |    4 ++++
 classes/base.bbclass      |    2 ++
 classes/native.bbclass    |   28 ++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index 7b69898..a944f0e 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -25,7 +25,11 @@ def autotools_dep_prepend(d):
 	return deps + 'gnu-config-native '
 
 EXTRA_OEMAKE = ""
+
 DEPENDS_prepend = "${@autotools_dep_prepend(d)}"
+DEPENDS_virtclass-native_prepend = "${@autotools_dep_prepend(d)}"
+DEPENDS_virtclass-nativesdk_prepend = "${@autotools_dep_prepend(d)}"
+
 acpaths = "default"
 EXTRA_AUTORECONF = "--exclude=autopoint"
 
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 49bb814..dd48d92 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -199,6 +199,8 @@ def base_both_contain(variable1, variable2, checkvalue, d):
                return ""
 
 DEPENDS_prepend="${@base_dep_prepend(d)} "
+DEPENDS_virtclass-native_prepend="${@base_dep_prepend(d)} "
+DEPENDS_virtclass-nativesdk_prepend="${@base_dep_prepend(d)} "
 
 # Returns PN with various suffixes removed
 # or PN if no matching suffix was found.
diff --git a/classes/native.bbclass b/classes/native.bbclass
index f01aba3..6292e4b 100644
--- a/classes/native.bbclass
+++ b/classes/native.bbclass
@@ -80,10 +80,38 @@ do_stage () {
 PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
 PKG_CONFIG_SYSROOT_DIR = ""
 
+ORIG_DEPENDS := "${DEPENDS}"
+
+DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+
 python __anonymous () {
     # If we've a legacy native do_stage, we need to neuter do_install
     stagefunc = bb.data.getVar('do_stage', d, True)
     if (stagefunc.strip() != "do_stage_native" and stagefunc.strip() != "autotools_stage_all") and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
         bb.data.setVar("do_install", "      :", d)
+
+    if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
+        pn = bb.data.getVar("PN", d, True)
+        depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)
+        deps = bb.utils.explode_deps(depends)
+        newdeps = []
+        for dep in deps:
+            if dep.endswith("-cross"):
+                newdeps.append(dep.replace("-cross", "-native"))
+            elif not dep.endswith("-native"):
+     
+                newdeps.append(dep + "-native")
+            else:
+                newdeps.append(dep)
+        bb.data.setVar("DEPENDS_virtclass-native", " ".join(newdeps), d)
+        provides = bb.data.getVar("PROVIDES", d, True)
+        for prov in provides.split():
+            if prov.find(pn) != -1:
+                continue
+            if not prov.endswith("-native"):
+    
+                provides = provides.replace(prov, prov + "-native")
+        bb.data.setVar("PROVIDES", provides, d)
+        bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
 }
 





More information about the Openembedded-commits mailing list