1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

native.bbclass: Fix DEPENDS handling for BBCLASSEXTEND use

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie
2009-11-09 16:04:51 +00:00
parent e782788756
commit 7b849ae2f5
+21 -29
View File
@@ -82,46 +82,38 @@ do_stage () {
PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}" PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
PKG_CONFIG_SYSROOT_DIR = "" PKG_CONFIG_SYSROOT_DIR = ""
ORIG_DEPENDS := "${DEPENDS}"
DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
python __anonymous () { python __anonymous () {
# If we've a legacy native do_stage, we need to neuter do_install # If we've a legacy native do_stage, we need to neuter do_install
stagefunc = bb.data.getVar('do_stage', d, True) 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": 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) bb.data.setVar("do_install", " :", d)
pn = bb.data.getVar("PN", d, True)
depends = bb.data.getVar("DEPENDS", d, True)
deps = bb.utils.explode_deps(depends)
newdeps = []
if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""): if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
autoextend = True pn = bb.data.getVar("PN", d, True)
else: depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)
autoextend = False deps = bb.utils.explode_deps(depends)
for dep in deps: newdeps = []
if dep.endswith("-cross"): for dep in deps:
if autoextend: if dep.endswith("-cross"):
newdeps.append(dep.replace("-cross", "-native")) newdeps.append(dep.replace("-cross", "-native"))
else: elif not dep.endswith("-native"):
bb.note("%s has depends %s which ends in -cross?" % (pn, dep))
newdeps.append(dep)
elif not dep.endswith("-native"):
if autoextend:
newdeps.append(dep + "-native") newdeps.append(dep + "-native")
else: else:
bb.note("%s has depends %s which doesn't end in -native?" % (pn, dep))
newdeps.append(dep) newdeps.append(dep)
else: bb.data.setVar("DEPENDS_virtclass-native", " ".join(newdeps), d)
newdeps.append(dep) provides = bb.data.getVar("PROVIDES", d, True)
bb.data.setVar("DEPENDS", " ".join(newdeps), d) for prov in provides.split():
provides = bb.data.getVar("PROVIDES", d, True) if prov.find(pn) != -1:
for prov in provides.split(): continue
if prov.find(pn) != -1: if not prov.endswith("-native"):
continue
if not prov.endswith("-native"):
if autoextend:
provides = provides.replace(prov, prov + "-native") provides = provides.replace(prov, prov + "-native")
#else: bb.data.setVar("PROVIDES", provides, d)
# bb.note("%s has rouge PROVIDES of %s which doesn't end in -sdk?" % (pn, prov)) bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
bb.data.setVar("PROVIDES", provides, d)
bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
} }