diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-18 10:38:28 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-18 10:38:48 +0100 |
| commit | 5127df17c071b28134e6a77130824a58c191a7da (patch) | |
| tree | 2680107df1ff54a38767fd4a1ab9a9b8f55fc343 /meta/classes | |
| parent | 7e10918724646a86afd4739ea136dac63d22def3 (diff) | |
| download | poky-5127df17c071b28134e6a77130824a58c191a7da.tar.gz | |
distrooverrides: Move back to classes whilst it's usage is clarified
(From OE-Core rev: eb56f89a9b2163bdb8c91dbdc33696fea052d032)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/distrooverrides.bbclass | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/classes/distrooverrides.bbclass b/meta/classes/distrooverrides.bbclass new file mode 100644 index 0000000000..8d9d7cda7d --- /dev/null +++ b/meta/classes/distrooverrides.bbclass | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | # | ||
| 2 | # Copyright OpenEmbedded Contributors | ||
| 3 | # | ||
| 4 | # SPDX-License-Identifier: MIT | ||
| 5 | # | ||
| 6 | |||
| 7 | # Turns certain DISTRO_FEATURES into overrides with the same | ||
| 8 | # name plus a df- prefix. Ensures that these special | ||
| 9 | # distro features remain set also for native and nativesdk | ||
| 10 | # recipes, so that these overrides can also be used there. | ||
| 11 | # | ||
| 12 | # This makes it simpler to write .bbappends that only change the | ||
| 13 | # task signatures of the recipe if the change is really enabled, | ||
| 14 | # for example with: | ||
| 15 | # do_install:append:df-my-feature () { ... } | ||
| 16 | # where "my-feature" is a DISTRO_FEATURE. | ||
| 17 | # | ||
| 18 | # The class is meant to be used in a layer.conf or distro | ||
| 19 | # .inc file with: | ||
| 20 | # INHERIT += "distrooverrides" | ||
| 21 | # DISTRO_FEATURES_OVERRIDES += "my-feature" | ||
| 22 | # | ||
| 23 | # Beware that this part of OVERRIDES changes during parsing, so usage | ||
| 24 | # of these overrides should be limited to .bb and .bbappend files, | ||
| 25 | # because then DISTRO_FEATURES is final. | ||
| 26 | |||
| 27 | DISTRO_FEATURES_OVERRIDES ?= "" | ||
| 28 | DISTRO_FEATURES_OVERRIDES[doc] = "A space-separated list of <feature> entries. \ | ||
| 29 | Each entry is added to OVERRIDES as df-<feature> if <feature> is in DISTRO_FEATURES." | ||
| 30 | |||
| 31 | DISTRO_FEATURES_FILTER_NATIVE:append = " ${DISTRO_FEATURES_OVERRIDES}" | ||
| 32 | DISTRO_FEATURES_FILTER_NATIVESDK:append = " ${DISTRO_FEATURES_OVERRIDES}" | ||
| 33 | |||
| 34 | # If DISTRO_FEATURES_OVERRIDES or DISTRO_FEATURES show up in a task | ||
| 35 | # signature because of this line, then the task dependency on | ||
| 36 | # OVERRIDES itself should be fixed. Excluding these two variables | ||
| 37 | # with DISTROOVERRIDES[vardepsexclude] would just work around the problem. | ||
| 38 | DISTROOVERRIDES .= "${@ ''.join([':df-' + x for x in sorted(set(d.getVar('DISTRO_FEATURES_OVERRIDES').split()) & set((d.getVar('DISTRO_FEATURES') or '').split()))]) }" | ||
