mirror of
https://git.yoctoproject.org/poky
synced 2026-04-23 00:32:12 +02:00
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. (From OE-Core rev: f183c7cfe377fa6ed2777605c3590a9dda2060df) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -85,17 +85,25 @@ EXTRA_NATIVE_PKGCONFIG_PATH ?= ""
|
||||
PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
|
||||
PKG_CONFIG_SYSROOT_DIR = ""
|
||||
|
||||
ORIG_DEPENDS := "${DEPENDS}"
|
||||
ORIG_RDEPENDS := "${RDEPENDS}"
|
||||
python native_virtclass_handler () {
|
||||
if not isinstance(e, bb.event.RecipePreFinalise):
|
||||
return
|
||||
|
||||
DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
|
||||
RDEPENDS_virtclass-native ?= "${ORIG_RDEPENDS}"
|
||||
classextend = bb.data.getVar('BBCLASSEXTEND', e.data, True) or ""
|
||||
if "native" not in classextend:
|
||||
return
|
||||
|
||||
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)
|
||||
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"):
|
||||
@@ -104,29 +112,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"
|
||||
|
||||
@@ -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] = ""
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user