summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-04 14:06:49 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-04 20:41:46 +0100
commit17bab13b0f2431757d8ddd66489bb720c13a0320 (patch)
tree4ae676fd3e3f12fb6c6397a15d44a25e4c43b57d /meta
parent576d52cdaca047d290c3b10b26aa2244da230dbb (diff)
downloadopenembedded-core-17bab13b0f2431757d8ddd66489bb720c13a0320.tar.gz
devupstream: Allow support of native class extensions
It is useful to be able to use the class with recipes using BBCLASSEXTEND for native extensions. This adds the magic required to do that. [YOCTO #11449] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/devupstream.bbclass20
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/classes/devupstream.bbclass b/meta/classes/devupstream.bbclass
index 1230fa12ea..dc9a9472b1 100644
--- a/meta/classes/devupstream.bbclass
+++ b/meta/classes/devupstream.bbclass
@@ -16,8 +16,6 @@
# - If the fetcher requires native tools (such as subversion-native) then
# bitbake won't be able to add them automatically.
-CLASSOVERRIDE .= ":class-devupstream"
-
python devupstream_virtclass_handler () {
# Do nothing if this is inherited, as it's for BBCLASSEXTEND
if "devupstream" not in (d.getVar('BBCLASSEXTEND') or ""):
@@ -25,8 +23,8 @@ python devupstream_virtclass_handler () {
return
variant = d.getVar("BBEXTENDVARIANT")
- if variant not in ("target"):
- bb.error("Pass the variant when using devupstream, for example devupstream:target")
+ if variant not in ("target", "native"):
+ bb.error("Unsupported variant %s. Pass the variant when using devupstream, for example devupstream:target" % variant)
return
# Develpment releases are never preferred by default
@@ -34,14 +32,22 @@ python devupstream_virtclass_handler () {
uri = bb.fetch2.URI(d.getVar("SRC_URI").split()[0])
- if uri.scheme == "git":
- d.setVar("S", "${WORKDIR}/git")
+ if uri.scheme == "git" and not d.getVar("S:class-devupstream"):
+ d.setVar("S:class-devupstream", "${WORKDIR}/git")
# Modify the PV if the recipe hasn't already overridden it
pv = d.getVar("PV")
proto_marker = "+" + uri.scheme
- if proto_marker not in pv:
+ if proto_marker not in pv and not d.getVar("PV:class-devupstream"):
d.setVar("PV", pv + proto_marker + "${SRCPV}")
+
+ if variant == "native":
+ pn = d.getVar("PN")
+ d.setVar("PN", "%s-native" % (pn))
+ fn = d.getVar("FILE")
+ bb.parse.BBHandler.inherit("native", fn, 0, d)
+
+ d.appendVar("CLASSOVERRIDE", ":class-devupstream")
}
addhandler devupstream_virtclass_handler