aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/native.bbclass14
-rw-r--r--meta/classes/nativesdk.bbclass6
-rw-r--r--meta/conf/bitbake.conf9
3 files changed, 25 insertions, 4 deletions
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index 1919fbcdbde..aec1087af5d 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -121,14 +121,20 @@ PATH_prepend = "${COREBASE}/scripts/native-intercept:"
SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
python native_virtclass_handler () {
- classextend = e.data.getVar('BBCLASSEXTEND') or ""
- if "native" not in classextend:
- return
-
pn = e.data.getVar("PN")
if not pn.endswith("-native"):
return
+ # Set features here to prevent appends and distro features backfill
+ # from modifying native distro features
+ features = set(d.getVar("DISTRO_FEATURES_NATIVE").split())
+ filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVE"), d).split())
+ d.setVar("DISTRO_FEATURES", " ".join(features | filtered))
+
+ classextend = e.data.getVar('BBCLASSEXTEND') or ""
+ if "native" not in classextend:
+ return
+
def map_dependencies(varname, d, suffix = ""):
if suffix:
varname = varname + "_" + suffix
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index ebcfb2df24d..655b4560e7c 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -70,6 +70,12 @@ python nativesdk_virtclass_handler () {
if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
return
+ # Set features here to prevent appends and distro features backfill
+ # from modifying nativesdk distro features
+ features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
+ filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
+ d.setVar("DISTRO_FEATURES", " ".join(features | filtered))
+
e.data.setVar("MLPREFIX", "nativesdk-")
e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", ""))
e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 5e98d4511f5..dca6bd4f90d 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -789,6 +789,15 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
EXTRA_IMAGE_FEATURES ??= ""
IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
+# Native distro features (will always be used for -native, even if they
+# are not enabled for target)
+DISTRO_FEATURES_NATIVE ?= "x11"
+DISTRO_FEATURES_NATIVESDK ?= "x11"
+# Normally target distro features will not be applied to native builds:
+# Native distro features on this list will use the target feature value
+DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
+DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
+
DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data ldconfig"
MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"