blob: 8d9d7cda7dc7d6ecf2b63fb13d74fbbf76720563 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007# 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 Williams213cb262021-08-07 19:21:33 -050015# do_install:append:df-my-feature () { ... }
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016# 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
27DISTRO_FEATURES_OVERRIDES ?= ""
28DISTRO_FEATURES_OVERRIDES[doc] = "A space-separated list of <feature> entries. \
29Each entry is added to OVERRIDES as df-<feature> if <feature> is in DISTRO_FEATURES."
30
Patrick Williams213cb262021-08-07 19:21:33 -050031DISTRO_FEATURES_FILTER_NATIVE:append = " ${DISTRO_FEATURES_OVERRIDES}"
32DISTRO_FEATURES_FILTER_NATIVESDK:append = " ${DISTRO_FEATURES_OVERRIDES}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050033
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.
38DISTROOVERRIDES .= "${@ ''.join([':df-' + x for x in sorted(set(d.getVar('DISTRO_FEATURES_OVERRIDES').split()) & set((d.getVar('DISTRO_FEATURES') or '').split()))]) }"