summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/native.bbclass14
-rw-r--r--meta/classes/nativesdk.bbclass6
-rw-r--r--meta/classes/packagegroup.bbclass2
-rw-r--r--meta/conf/bitbake.conf10
4 files changed, 28 insertions, 4 deletions
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index 1919fbcdbd..aec1087af5 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -121,14 +121,20 @@ PATH_prepend = "${COREBASE}/scripts/native-intercept:"
121SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}" 121SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
122 122
123python native_virtclass_handler () { 123python native_virtclass_handler () {
124 classextend = e.data.getVar('BBCLASSEXTEND') or ""
125 if "native" not in classextend:
126 return
127
128 pn = e.data.getVar("PN") 124 pn = e.data.getVar("PN")
129 if not pn.endswith("-native"): 125 if not pn.endswith("-native"):
130 return 126 return
131 127
128 # Set features here to prevent appends and distro features backfill
129 # from modifying native distro features
130 features = set(d.getVar("DISTRO_FEATURES_NATIVE").split())
131 filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVE"), d).split())
132 d.setVar("DISTRO_FEATURES", " ".join(features | filtered))
133
134 classextend = e.data.getVar('BBCLASSEXTEND') or ""
135 if "native" not in classextend:
136 return
137
132 def map_dependencies(varname, d, suffix = ""): 138 def map_dependencies(varname, d, suffix = ""):
133 if suffix: 139 if suffix:
134 varname = varname + "_" + suffix 140 varname = varname + "_" + suffix
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index ebcfb2df24..655b4560e7 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -70,6 +70,12 @@ python nativesdk_virtclass_handler () {
70 if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")): 70 if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
71 return 71 return
72 72
73 # Set features here to prevent appends and distro features backfill
74 # from modifying nativesdk distro features
75 features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
76 filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
77 d.setVar("DISTRO_FEATURES", " ".join(features | filtered))
78
73 e.data.setVar("MLPREFIX", "nativesdk-") 79 e.data.setVar("MLPREFIX", "nativesdk-")
74 e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", "")) 80 e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", ""))
75 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk") 81 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
index 4af4a014b0..eea2e5b9fc 100644
--- a/meta/classes/packagegroup.bbclass
+++ b/meta/classes/packagegroup.bbclass
@@ -49,6 +49,8 @@ deltask do_install
49deltask do_populate_sysroot 49deltask do_populate_sysroot
50 50
51python () { 51python () {
52 if bb.data.inherits_class('nativesdk', d):
53 return
52 initman = d.getVar("VIRTUAL-RUNTIME_init_manager") 54 initman = d.getVar("VIRTUAL-RUNTIME_init_manager")
53 if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d): 55 if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d):
54 bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman) 56 bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 5e98d4511f..af3937a48e 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -789,6 +789,16 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
789EXTRA_IMAGE_FEATURES ??= "" 789EXTRA_IMAGE_FEATURES ??= ""
790IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}" 790IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
791 791
792# Native distro features (will always be used for -native, even if they
793# are not enabled for target)
794DISTRO_FEATURES_NATIVE ?= "x11"
795DISTRO_FEATURES_NATIVESDK ?= "x11 libc-charsets libc-locales libc-locale-code"
796
797# Normally target distro features will not be applied to native builds:
798# Native distro features on this list will use the target feature value
799DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
800DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
801
792DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data ldconfig" 802DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data ldconfig"
793MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode" 803MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
794 804