diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-09 17:56:23 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-09 22:48:56 +0100 |
commit | f183c7cfe377fa6ed2777605c3590a9dda2060df (patch) | |
tree | b00803dd7a3ca343ad01553d86b80ff2dd6945d0 /meta | |
parent | f6a38cd75edb46858da6950b5ec029db8a12d801 (diff) | |
download | openembedded-core-f183c7cfe377fa6ed2777605c3590a9dda2060df.tar.gz openembedded-core-f183c7cfe377fa6ed2777605c3590a9dda2060df.tar.bz2 openembedded-core-f183c7cfe377fa6ed2777605c3590a9dda2060df.tar.xz 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')
-rw-r--r-- | meta/classes/autotools.bbclass | 2 | ||||
-rw-r--r-- | meta/classes/base.bbclass | 2 | ||||
-rw-r--r-- | meta/classes/native.bbclass | 72 | ||||
-rw-r--r-- | meta/classes/nativesdk.bbclass | 23 | ||||
-rw-r--r-- | meta/recipes-core/util-linux/util-linux.inc | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_5.4.0.bb | 6 |
6 files changed, 58 insertions, 49 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass index 27f4a01f1..98c871acc 100644 --- a/meta/classes/autotools.bbclass +++ b/meta/classes/autotools.bbclass @@ -21,8 +21,6 @@ def autotools_dep_prepend(d): EXTRA_OEMAKE = "" DEPENDS_prepend = "${@autotools_dep_prepend(d)}" -DEPENDS_virtclass-native_prepend = "${@autotools_dep_prepend(d)}" -DEPENDS_virtclass-nativesdk_prepend = "${@autotools_dep_prepend(d)}" inherit siteinfo diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 6f0484e26..119b052f3 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -69,8 +69,6 @@ def 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/native.bbclass b/meta/classes/native.bbclass index e06f02a1b..3a31b6c09 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" diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass index cd34a798e..644e73121 100644 --- a/meta/classes/nativesdk.bbclass +++ b/meta/classes/nativesdk.bbclass @@ -54,12 +54,15 @@ FILES_${PN}-dbg += "${prefix}/.debug \ export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig" export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}" -ORIG_DEPENDS := "${DEPENDS}" -DEPENDS_virtclass-nativesdk ?= "${ORIG_DEPENDS}" +python nativesdk_virtclass_handler () { + if not isinstance(e, bb.event.RecipePreFinalise): + return -python __anonymous () { - pn = bb.data.getVar("PN", d, True) - depends = bb.data.getVar("DEPENDS_virtclass-nativesdk", d, True) + pn = bb.data.getVar("PN", e.data, True) + if not pn.endswith("-nativesdk"): + return + + depends = bb.data.getVar("DEPENDS", e.data, True) deps = bb.utils.explode_deps(depends) newdeps = [] for dep in deps: @@ -71,16 +74,18 @@ python __anonymous () { newdeps.append(dep + "-nativesdk") else: newdeps.append(dep) - bb.data.setVar("DEPENDS_virtclass-nativesdk", " ".join(newdeps), d) - provides = bb.data.getVar("PROVIDES", d, True) + bb.data.setVar("DEPENDS", " ".join(newdeps), e.data) + provides = bb.data.getVar("PROVIDES", e.data, True) for prov in provides.split(): if prov.find(pn) != -1: continue if not prov.endswith("-nativesdk"): provides = provides.replace(prov, prov + "-nativesdk") - bb.data.setVar("PROVIDES", provides, d) - bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-nativesdk", d) + bb.data.setVar("PROVIDES", provides, e.data) + bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", e.data, False) + ":virtclass-nativesdk", e.data) } +addhandler nativesdk_virtclass_handler + do_populate_sysroot[stamp-extra-info] = "" do_package[stamp-extra-info] = "" diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index 4b361005e..b77266af1 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc @@ -15,7 +15,7 @@ LIC_FILES_CHKSUM = "file://README.licensing;md5=9c920d811858a74b67a36ba23cbaa95f inherit autotools gettext pkgconfig DEPENDS = "zlib ncurses" -DEPENDS_virtclass-native_append = " lzo-native" +DEPENDS_virtclass-native = " lzo-native" SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux-ng/v${MAJOR_VERSION}/util-linux-${PV}.tar.bz2 \ diff --git a/meta/recipes-devtools/rpm/rpm_5.4.0.bb b/meta/recipes-devtools/rpm/rpm_5.4.0.bb index 5c30f1cbf..0c88f9176 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.0.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.0.bb @@ -42,9 +42,9 @@ HOMEPAGE = "http://rpm5.org/" LICENSE = "LGPL 2.1" LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1" -rpmdeps = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt" -DEPENDS = "${rpmdeps} python perl" -DEPENDS_virtclass-native = "${rpmdeps}" +DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}" +extrarpmdeps = "python perl" +extrarpmdeps_virtclass-native = "" PR = "r17" # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed |