With the help of this class you can dynamically inherit other classes into any recipe based on conditions
You can either insert
INHERIT += "auto-inherit"
into your distro configuration or into conf/local.conf of your build directory
Configuration is done by bitbake variable AUTO_INHERIT_CONF. It is a space separated list of items (see below). Best is to place this variable along the inherit. E.g.
INHERIT += "auto-inherit"
AUTO_INHERIT_CONF = "BBClass=foo;props[a,b,c]"
each value is formatted in the following way
BBClass=<class>;props=[func_foo(d),func_foo2(d,param)]
The identifier BBClass specifies what other bbclass to be included. The props identifier specifies a list of python-function, which all must return true for the class at BBClass to become included into the recipe currently parsed.
Checks if the current recipe DEPENDS on another package. Parameters are
- d [object] for the current data-storage of bitbake
- pn [string] for the package-name to be checked for
- skipNative [bool:True] for ignoring -native packages on lookup
Checks if the current recipe is located at a certain path (or below) relative to project root Parameters are
- d [object] for the current data-storage of bitbake
- path [string] path to check for
- skip_bbappend [bool:True] for ignoring bbappend-files on lookup
Checks if a recipe is published under a particular license Parameters are
- d [object] for the current data-storage of bitbake
- license_regex [regex] regular expression describing the license to check for
Checks if the recipe contains specific resources in it's SRC_URI entry
- d [object] for the current data-storage of bitbake
- source_regex [regex] regular expression describing the entries to check for
AUTO_INHERIT_CONF = "BBClass=foo;props=[auto_inherit_is_at_path(d,'meta-foo/recipes-foo/',False)]"
will inherit foo.bbclass into each recipe (and bbappend) placed under meta-foo/recipes-foo/
AUTO_INHERIT_CONF = "BBClass=bar;props=[auto_inherit_license(d,'GPL.*')]"
will inherit bar.bbclass into each recipe licensed under "GPL" (including all variants like GPLv2, GPLv3, a.s.o.)
AUTO_INHERIT_CONF = "BBClass=bar;props=[auto_inherit_contains_package(d,'python3')]"
will inherit bar.bbclass into each recipe which DEPENDS on python3