summaryrefslogtreecommitdiff
path: root/meta/classes/native.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-09 17:56:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-09 22:48:56 +0100
commitf183c7cfe377fa6ed2777605c3590a9dda2060df (patch)
treeb00803dd7a3ca343ad01553d86b80ff2dd6945d0 /meta/classes/native.bbclass
parentf6a38cd75edb46858da6950b5ec029db8a12d801 (diff)
downloadopenembedded-core-f183c7cfe377fa6ed2777605c3590a9dda2060df.tar.gz
openembedded-core-f183c7cfe377fa6ed2777605c3590a9dda2060df.tar.bz2
openembedded-core-f183c7cfe377fa6ed2777605c3590a9dda2060df.zip
native/nativesdk: Clean up the depends ordering after bitbake override handling updates
This massively cleans up the dependency handling in the two classes when interacting with BBCLASSEXTEND. This change has a dependency on the bitbake override handling change and also the existence of the RecipePreFinalise event. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/native.bbclass')
-rw-r--r--meta/classes/native.bbclass72
1 files changed, 40 insertions, 32 deletions
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index e06f02a1bf..3a31b6c091 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -80,17 +80,25 @@ EXTRA_NATIVE_PKGCONFIG_PATH ?= ""
PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
PKG_CONFIG_SYSROOT_DIR = ""
-ORIG_DEPENDS := "${DEPENDS}"
-ORIG_RDEPENDS := "${RDEPENDS}"
-
-DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
-RDEPENDS_virtclass-native ?= "${ORIG_RDEPENDS}"
-
-python __anonymous () {
- 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)
+python native_virtclass_handler () {
+ if not isinstance(e, bb.event.RecipePreFinalise):
+ return
+
+ classextend = bb.data.getVar('BBCLASSEXTEND', e.data, True) or ""
+ if "native" not in classextend:
+ return
+
+ pn = bb.data.getVar("PN", e.data, True)
+ if not pn.endswith("-native"):
+ return
+
+ def map_dependencies(varname, d, suffix = ""):
+ if suffix:
+ varname = varname + "_" + suffix
+ deps = bb.data.getVar(varname, d, True)
+ if not deps:
+ return
+ deps = bb.utils.explode_deps(deps)
newdeps = []
for dep in deps:
if dep.endswith("-cross"):
@@ -99,29 +107,29 @@ python __anonymous () {
newdeps.append(dep + "-native")
else:
newdeps.append(dep)
- bb.data.setVar("DEPENDS_virtclass-native", " ".join(newdeps), d)
- rdepends = bb.data.getVar("RDEPENDS_virtclass-native", d, True)
- rdeps = bb.utils.explode_deps(rdepends)
- newdeps = []
- for dep in rdeps:
- 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("RDEPENDS_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)
+ bb.data.setVar(varname, " ".join(newdeps), d)
+
+ map_dependencies("DEPENDS", e.data)
+ for pkg in (e.data.getVar("PACKAGES", True).split() + [""]):
+ map_dependencies("RDEPENDS", e.data, pkg)
+ map_dependencies("RRECOMMENDS", e.data, pkg)
+ map_dependencies("RSUGGESTS", e.data, pkg)
+ map_dependencies("RPROVIDES", e.data, pkg)
+ map_dependencies("RREPLACES", e.data, pkg)
+
+ provides = bb.data.getVar("PROVIDES", e.data, 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, e.data)
+
+ bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", e.data, False) + ":virtclass-native", e.data)
}
+addhandler native_virtclass_handler
+
do_package[noexec] = "1"
do_package_write_ipk[noexec] = "1"
do_package_write_deb[noexec] = "1"