Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 1 | # |
| 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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: |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 15 | # do_install:append:df-my-feature () { ... } |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 31 | DISTRO_FEATURES_FILTER_NATIVE:append = " ${DISTRO_FEATURES_OVERRIDES}" |
| 32 | DISTRO_FEATURES_FILTER_NATIVESDK:append = " ${DISTRO_FEATURES_OVERRIDES}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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()))]) }" |