packagegroup.bbclass 2.3 KB

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