xref: /OK3568_Linux_fs/yocto/poky/meta/classes/packagegroup.bbclass (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# Class for packagegroup (package group) recipes
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun# By default, only the packagegroup package itself is in PACKAGES.
4*4882a593Smuzhiyun# -dbg and -dev flavours are handled by the anonfunc below.
5*4882a593Smuzhiyun# This means that packagegroup recipes used to build multiple packagegroup
6*4882a593Smuzhiyun# packages have to modify PACKAGES after inheriting packagegroup.bbclass.
7*4882a593SmuzhiyunPACKAGES = "${PN}"
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun# By default, packagegroup packages do not depend on a certain architecture.
10*4882a593Smuzhiyun# Only if dependencies are modified by MACHINE_FEATURES, packages
11*4882a593Smuzhiyun# need to be set to MACHINE_ARCH before inheriting packagegroup.bbclass
12*4882a593SmuzhiyunPACKAGE_ARCH ?= "all"
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun# Fully expanded - so it applies the overrides as well
15*4882a593SmuzhiyunPACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}"
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunLICENSE ?= "MIT"
18*4882a593Smuzhiyun
19*4882a593Smuzhiyuninherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun# This automatically adds -dbg and -dev flavours of all PACKAGES
22*4882a593Smuzhiyun# to the list. Their dependencies (RRECOMMENDS) are handled as usual
23*4882a593Smuzhiyun# by package_depchains in a following step.
24*4882a593Smuzhiyun# Also mark all packages as ALLOW_EMPTY
25*4882a593Smuzhiyunpython () {
26*4882a593Smuzhiyun    packages = d.getVar('PACKAGES').split()
27*4882a593Smuzhiyun    if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY') != '1':
28*4882a593Smuzhiyun        types = ['', '-dbg', '-dev']
29*4882a593Smuzhiyun        if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
30*4882a593Smuzhiyun            types.append('-ptest')
31*4882a593Smuzhiyun        packages = [pkg + suffix for pkg in packages
32*4882a593Smuzhiyun                    for suffix in types]
33*4882a593Smuzhiyun        d.setVar('PACKAGES', ' '.join(packages))
34*4882a593Smuzhiyun    for pkg in packages:
35*4882a593Smuzhiyun        d.setVar('ALLOW_EMPTY:%s' % pkg, '1')
36*4882a593Smuzhiyun}
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun# We don't want to look at shared library dependencies for the
39*4882a593Smuzhiyun# dbg packages
40*4882a593SmuzhiyunDEPCHAIN_DBGDEFAULTDEPS = "1"
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun# We only need the packaging tasks - disable the rest
43*4882a593Smuzhiyundeltask do_fetch
44*4882a593Smuzhiyundeltask do_unpack
45*4882a593Smuzhiyundeltask do_patch
46*4882a593Smuzhiyundeltask do_configure
47*4882a593Smuzhiyundeltask do_compile
48*4882a593Smuzhiyundeltask do_install
49*4882a593Smuzhiyundeltask do_populate_sysroot
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunINHIBIT_DEFAULT_DEPS = "1"
52*4882a593Smuzhiyun
53*4882a593Smuzhiyunpython () {
54*4882a593Smuzhiyun    if bb.data.inherits_class('nativesdk', d):
55*4882a593Smuzhiyun        return
56*4882a593Smuzhiyun    initman = d.getVar("VIRTUAL-RUNTIME_init_manager")
57*4882a593Smuzhiyun    if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d):
58*4882a593Smuzhiyun        bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman)
59*4882a593Smuzhiyun}
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunCVE_PRODUCT = ""
62