wireplumber_0.5.10.bb 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. SUMMARY = "Session / policy manager implementation for PipeWire"
  2. HOMEPAGE = "https://gitlab.freedesktop.org/pipewire/wireplumber"
  3. BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/wireplumber/issues"
  4. SECTION = "multimedia"
  5. LICENSE = "MIT"
  6. LIC_FILES_CHKSUM = "file://LICENSE;md5=17d1fe479cdec331eecbc65d26bc7e77"
  7. DEPENDS = "glib-2.0 glib-2.0-native lua pipewire \
  8. ${@bb.utils.contains("DISTRO_FEATURES", "gobject-introspection-data", "python3-native python3-lxml-native doxygen-native", "", d)} \
  9. "
  10. SRCREV = "7a4d3177550b6b53fe0a49396da5b07f5353daff"
  11. SRC_URI = " \
  12. git://gitlab.freedesktop.org/pipewire/wireplumber.git;branch=master;protocol=https \
  13. file://90-OE-disable-session-dbus-dependent-features.lua \
  14. "
  15. S = "${WORKDIR}/git"
  16. inherit meson pkgconfig gobject-introspection systemd
  17. GIR_MESON_ENABLE_FLAG = 'enabled'
  18. GIR_MESON_DISABLE_FLAG = 'disabled'
  19. # Enable system-lua to let wireplumber use OE's lua.
  20. # Documentation needs python-sphinx, which is not in oe-core or meta-python2 for now.
  21. # elogind is not (yet) available in OE, so disable support.
  22. EXTRA_OEMESON += " \
  23. -Ddoc=disabled \
  24. -Dsystem-lua=true \
  25. -Delogind=disabled \
  26. -Dsystemd-system-unit-dir=${systemd_system_unitdir} \
  27. -Dsystemd-user-unit-dir=${systemd_user_unitdir} \
  28. -Dtests=false \
  29. "
  30. PACKAGECONFIG ??= " dbus \
  31. ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service systemd-user-service', '', d)} \
  32. "
  33. PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd"
  34. PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=true,-Dsystemd-system-service=false,systemd"
  35. # "systemd-user-service" packageconfig will only install service
  36. # files to rootfs but not enable them as systemd.bbclass
  37. # currently lacks the feature of enabling user services.
  38. PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=true,-Dsystemd-user-service=false,systemd"
  39. PACKAGECONFIG[dbus] = ""
  40. PACKAGESPLITFUNCS:prepend = " split_dynamic_packages "
  41. PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends "
  42. WP_MODULE_SUBDIR = "wireplumber-0.5"
  43. do_install:append() {
  44. if ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'false', 'true', d)}; then
  45. install -m 0644 ${UNPACKDIR}/90-OE-disable-session-dbus-dependent-features.lua ${D}${datadir}/wireplumber/main.lua.d
  46. fi
  47. }
  48. python split_dynamic_packages () {
  49. # Create packages for each WirePlumber module.
  50. wp_module_libdir = d.expand('${libdir}/${WP_MODULE_SUBDIR}')
  51. do_split_packages(d, wp_module_libdir, r'^libwireplumber-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'WirePlumber %s module', extra_depends='', recursive=False)
  52. }
  53. python set_dynamic_metapkg_rdepends () {
  54. import os
  55. import oe.utils
  56. # Go through all generated WirePlumber module packages
  57. # (excluding the main package and the -meta package itself)
  58. # and add them to the -meta package as RDEPENDS.
  59. base_pn = d.getVar('PN')
  60. wp_module_pn = base_pn + '-modules'
  61. wp_module_metapkg = wp_module_pn + '-meta'
  62. d.setVar('ALLOW_EMPTY:' + wp_module_metapkg, "1")
  63. d.setVar('FILES:' + wp_module_metapkg, "")
  64. blacklist = [ wp_module_pn, wp_module_metapkg ]
  65. wp_module_metapkg_rdepends = []
  66. pkgdest = d.getVar('PKGDEST')
  67. for pkg in oe.utils.packages_filter_out_system(d):
  68. if pkg in blacklist:
  69. continue
  70. is_wp_module_pkg = pkg.startswith(wp_module_pn)
  71. if not is_wp_module_pkg:
  72. continue
  73. if pkg in wp_module_metapkg_rdepends:
  74. continue
  75. # See if the package is empty by looking at the contents of its
  76. # PKGDEST subdirectory. If this subdirectory is empty, then then
  77. # package is empty as well. Empty packages do not get added to
  78. # the meta package's RDEPENDS.
  79. pkgdir = os.path.join(pkgdest, pkg)
  80. if os.path.exists(pkgdir):
  81. dir_contents = os.listdir(pkgdir) or []
  82. else:
  83. dir_contents = []
  84. is_empty = len(dir_contents) == 0
  85. if not is_empty:
  86. if is_wp_module_pkg:
  87. wp_module_metapkg_rdepends.append(pkg)
  88. d.setVar('RDEPENDS:' + wp_module_metapkg, ' '.join(wp_module_metapkg_rdepends))
  89. d.setVar('DESCRIPTION:' + wp_module_metapkg, wp_module_pn + ' meta package')
  90. }
  91. PACKAGES =+ "\
  92. libwireplumber \
  93. ${PN}-default-config \
  94. ${PN}-scripts \
  95. ${PN}-modules \
  96. ${PN}-modules-meta \
  97. "
  98. PACKAGES_DYNAMIC = "^${PN}-modules.*"
  99. CONFFILES:${PN} += " \
  100. ${datadir}/wireplumber/wireplumber.conf \
  101. ${datadir}/wireplumber/*.lua.d/* \
  102. "
  103. # Add pipewire to RRECOMMENDS, since WirePlumber expects a PipeWire daemon to
  104. # be present. While in theory any application that uses libpipewire can configure
  105. # itself to become a daemon, in practice, the PipeWire daemon is used.
  106. RRECOMMENDS:${PN} += "pipewire ${PN}-scripts ${PN}-modules-meta"
  107. FILES:${PN} += "${systemd_user_unitdir} ${systemd_system_unitdir} ${datadir}/zsh"
  108. FILES:libwireplumber = " \
  109. ${libdir}/libwireplumber-*.so.* \
  110. "
  111. FILES:${PN}-scripts += "${datadir}/wireplumber/scripts/*"
  112. # Dynamic packages (see set_dynamic_metapkg_rdepends).
  113. FILES:${PN}-modules = ""
  114. RRECOMMENDS:${PN}-modules += "${PN}-modules-meta"