packagegroup.bbclass 2.2 KB

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