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 | |
| 7 | # Class for packagegroup (package group) recipes |
| 8 | |
| 9 | # By default, only the packagegroup package itself is in PACKAGES. |
| 10 | # -dbg and -dev flavours are handled by the anonfunc below. |
| 11 | # This means that packagegroup recipes used to build multiple packagegroup |
| 12 | # packages have to modify PACKAGES after inheriting packagegroup.bbclass. |
| 13 | PACKAGES = "${PN}" |
| 14 | |
| 15 | # By default, packagegroup packages do not depend on a certain architecture. |
| 16 | # Only if dependencies are modified by MACHINE_FEATURES, packages |
| 17 | # need to be set to MACHINE_ARCH before inheriting packagegroup.bbclass |
| 18 | PACKAGE_ARCH ?= "all" |
| 19 | |
| 20 | # Fully expanded - so it applies the overrides as well |
| 21 | PACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}" |
| 22 | |
| 23 | LICENSE ?= "MIT" |
| 24 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 25 | inherit_defer ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')} |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 26 | |
| 27 | # This automatically adds -dbg and -dev flavours of all PACKAGES |
| 28 | # to the list. Their dependencies (RRECOMMENDS) are handled as usual |
| 29 | # by package_depchains in a following step. |
| 30 | # Also mark all packages as ALLOW_EMPTY |
| 31 | python () { |
| 32 | packages = d.getVar('PACKAGES').split() |
| 33 | if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY') != '1': |
| 34 | types = ['', '-dbg', '-dev'] |
| 35 | if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d): |
| 36 | types.append('-ptest') |
| 37 | packages = [pkg + suffix for pkg in packages |
| 38 | for suffix in types] |
| 39 | d.setVar('PACKAGES', ' '.join(packages)) |
| 40 | for pkg in packages: |
| 41 | d.setVar('ALLOW_EMPTY:%s' % pkg, '1') |
| 42 | } |
| 43 | |
| 44 | # We don't want to look at shared library dependencies for the |
| 45 | # dbg packages |
| 46 | DEPCHAIN_DBGDEFAULTDEPS = "1" |
| 47 | |
| 48 | # We only need the packaging tasks - disable the rest |
| 49 | deltask do_fetch |
| 50 | deltask do_unpack |
| 51 | deltask do_patch |
| 52 | deltask do_configure |
| 53 | deltask do_compile |
| 54 | deltask do_install |
| 55 | deltask do_populate_sysroot |
| 56 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 57 | do_create_runtime_spdx[deptask] = "do_create_spdx" |
| 58 | do_create_runtime_spdx[rdeptask] = "" |
| 59 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 60 | INHIBIT_DEFAULT_DEPS = "1" |
| 61 | |
| 62 | python () { |
| 63 | if bb.data.inherits_class('nativesdk', d): |
| 64 | return |
| 65 | initman = d.getVar("VIRTUAL-RUNTIME_init_manager") |
| 66 | if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d): |
| 67 | bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman) |
| 68 | } |
| 69 | |
| 70 | CVE_PRODUCT = "" |