summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/packagegroup.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 14:35:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-12 15:27:17 +0100
commitfd1517e2b51a170f2427122c6b95396db251d827 (patch)
treedabfe3e631339c2fc99a9ee7febb0f9c128e325e /meta/classes-recipe/packagegroup.bbclass
parent10317912ee319ccf7f83605d438b5cbf9663f296 (diff)
downloadpoky-fd1517e2b51a170f2427122c6b95396db251d827.tar.gz
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/packagegroup.bbclass')
-rw-r--r--meta/classes-recipe/packagegroup.bbclass67
1 files changed, 67 insertions, 0 deletions
diff --git a/meta/classes-recipe/packagegroup.bbclass b/meta/classes-recipe/packagegroup.bbclass
new file mode 100644
index 0000000000..6f17fc73b0
--- /dev/null
+++ b/meta/classes-recipe/packagegroup.bbclass
@@ -0,0 +1,67 @@
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.
13PACKAGES = "${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
18PACKAGE_ARCH ?= "all"
19
20# Fully expanded - so it applies the overrides as well
21PACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}"
22
23LICENSE ?= "MIT"
24
25inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
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
31python () {
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
46DEPCHAIN_DBGDEFAULTDEPS = "1"
47
48# We only need the packaging tasks - disable the rest
49deltask do_fetch
50deltask do_unpack
51deltask do_patch
52deltask do_configure
53deltask do_compile
54deltask do_install
55deltask do_populate_sysroot
56
57INHIBIT_DEFAULT_DEPS = "1"
58
59python () {
60 if bb.data.inherits_class('nativesdk', d):
61 return
62 initman = d.getVar("VIRTUAL-RUNTIME_init_manager")
63 if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d):
64 bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman)
65}
66
67CVE_PRODUCT = ""