Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | SUMMARY = "Multimedia processing server for Linux" |
| 2 | DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" |
| 3 | HOMEPAGE = "https://pipewire.org/" |
| 4 | BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" |
| 5 | AUTHOR = "Wim Taymans <wtaymans@redhat.com>" |
| 6 | SECTION = "multimedia" |
| 7 | |
| 8 | LICENSE = "MIT & LGPL-2.1-or-later & GPL-2.0-only" |
| 9 | LIC_FILES_CHKSUM = " \ |
| 10 | file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ |
| 11 | file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ |
| 12 | " |
| 13 | |
| 14 | DEPENDS = "dbus ncurses" |
| 15 | |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 16 | SRCREV = "075e7b266876802eab0077afd13ea8e1cee5e1fd" |
| 17 | SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https \ |
| 18 | file://0001-meson-Add-option-to-enable-disable-legacy-RTKit-modu.patch \ |
| 19 | " |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | inherit meson pkgconfig systemd gettext useradd |
| 24 | |
| 25 | USERADD_PACKAGES = "${PN}" |
| 26 | |
| 27 | GROUPADD_PARAM:${PN} = "--system pipewire" |
| 28 | |
| 29 | USERADD_PARAM:${PN} = "--system --home / --no-create-home \ |
| 30 | --comment 'PipeWire multimedia daemon' \ |
| 31 | --gid pipewire --groups audio,video \ |
| 32 | pipewire" |
| 33 | |
| 34 | SYSTEMD_PACKAGES = "${PN}" |
| 35 | |
| 36 | # For "EVL", look up https://evlproject.org/ . It involves |
| 37 | # a specially prepared kernel, and is currently unavailable |
| 38 | # in Yocto. |
| 39 | # |
| 40 | # Vulkan support is currently (as of version 0.3.44) not functional. |
| 41 | # |
| 42 | # manpage generation requires xmltoman, which is not available. |
| 43 | # |
| 44 | # The session-managers list specifies which session managers Meson |
| 45 | # shall download (via git clone) and build as subprojects. In OE, |
| 46 | # this is not how a session manager should be built. Instead, they |
| 47 | # should be integrated as separate OE recipes. To prevent PipeWire |
| 48 | # from using this Meson feature, set an empty list. |
| 49 | # This does not disable support or the need for session managers, |
| 50 | # it just prevents this subproject feature. |
| 51 | # |
| 52 | # AptX and LDAC are not available in OE. Currently, neither |
| 53 | # are lv2 and ROC. |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 54 | # |
| 55 | # The RTKit module is deprecated in favor of the newer RT module. |
| 56 | # It still exists for legacy setups that still include it in |
| 57 | # their PipeWire configuration files. |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 58 | EXTRA_OEMESON += " \ |
| 59 | -Devl=disabled \ |
| 60 | -Dtests=disabled \ |
| 61 | -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \ |
| 62 | -Dsystemd-system-unit-dir=${systemd_system_unitdir} \ |
| 63 | -Dsystemd-user-unit-dir=${systemd_user_unitdir} \ |
| 64 | -Dvulkan=disabled \ |
| 65 | -Dman=disabled \ |
| 66 | -Dsession-managers='[]' \ |
| 67 | -Dlv2=disabled \ |
| 68 | -Droc=disabled \ |
| 69 | -Dbluez5-codec-aptx=disabled \ |
| 70 | -Dbluez5-codec-ldac=disabled \ |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 71 | -Dlegacy-rtkit=false \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 72 | " |
| 73 | |
| 74 | PACKAGECONFIG ??= "\ |
| 75 | ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ |
| 76 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ |
| 77 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service', '', d)} \ |
| 78 | ${@bb.utils.filter('DISTRO_FEATURES', 'alsa', d)} \ |
| 79 | gstreamer jack libusb pw-cat raop sndfile v4l2 \ |
| 80 | " |
| 81 | |
| 82 | # "jack" and "pipewire-jack" packageconfigs cannot be both enabled, |
| 83 | # since "jack" imports libjack, and "pipewire-jack" generates |
| 84 | # libjack.so* files, thus colliding with the libpack package. This |
| 85 | # is why these two are marked in their respective packageconfigs |
| 86 | # as being in conflict. |
| 87 | PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev" |
| 88 | PACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi" |
| 89 | PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" |
| 90 | PACKAGECONFIG[bluez-aac] = "-Dbluez5-codec-aac=enabled,-Dbluez5-codec-aac=disabled,fdk-aac" |
| 91 | PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native graphviz-native" |
| 92 | PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg" |
| 93 | PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base" |
| 94 | PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" |
| 95 | PACKAGECONFIG[libcamera] = "-Dlibcamera=enabled,-Dlibcamera=disabled,libcamera" |
| 96 | PACKAGECONFIG[libcanberra] = "-Dlibcanberra=enabled,-Dlibcanberra=disabled,libcanberra" |
| 97 | PACKAGECONFIG[libusb] = "-Dlibusb=enabled,-Dlibusb=disabled,libusb" |
| 98 | PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" |
| 99 | PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" |
| 100 | PACKAGECONFIG[pw-cat] = "-Dpw-cat=enabled,-Dpw-cat=disabled" |
| 101 | PACKAGECONFIG[raop] = "-Draop=enabled,-Draop=disabled,openssl" |
| 102 | PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2" |
| 103 | PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" |
| 104 | PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd" |
| 105 | PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=enabled,-Dsystemd-system-service=disabled,systemd" |
| 106 | # "systemd-user-service" packageconfig will only install service |
| 107 | # files to rootfs but not enable them as systemd.bbclass |
| 108 | # currently lacks the feature of enabling user services. |
| 109 | PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=enabled,-Dsystemd-user-service=disabled,systemd" |
| 110 | # pw-cat needs sndfile packageconfig to be enabled |
| 111 | PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" |
| 112 | PACKAGECONFIG[webrtc-echo-cancelling] = "-Decho-cancel-webrtc=enabled,-Decho-cancel-webrtc=disabled,webrtc-audio-processing" |
| 113 | |
| 114 | PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " |
| 115 | PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " |
| 116 | |
| 117 | SPA_SUBDIR = "spa-0.2" |
| 118 | PW_MODULE_SUBDIR = "pipewire-0.3" |
| 119 | |
| 120 | remove_unused_installed_files() { |
| 121 | # jack.conf is used by pipewire-jack (not the JACK SPA plugin). |
| 122 | # Remove it if pipewire-jack is not built to avoid creating the |
| 123 | # pipewire-jack package. |
| 124 | if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then |
| 125 | rm -f "${D}${datadir}/pipewire/jack.conf" |
| 126 | fi |
| 127 | |
| 128 | # minimal.conf is an example of how to minimally configure the |
| 129 | # daemon and is not meant to be used for production. |
| 130 | rm -f "${D}${datadir}/pipewire/minimal.conf" |
| 131 | } |
| 132 | |
| 133 | do_install[postfuncs] += "remove_unused_installed_files" |
| 134 | |
| 135 | python split_dynamic_packages () { |
| 136 | # Create packages for each SPA plugin. These plugins are located |
| 137 | # in individual subdirectories, so a recursive search is needed. |
| 138 | spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}') |
| 139 | do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True) |
| 140 | |
| 141 | # Create packages for each PipeWire module. |
| 142 | pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}') |
| 143 | do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False) |
| 144 | } |
| 145 | |
| 146 | python set_dynamic_metapkg_rdepends () { |
| 147 | import os |
| 148 | import oe.utils |
| 149 | |
| 150 | # Go through all generated SPA plugin and PipeWire module packages |
| 151 | # (excluding the main package and the -meta package itself) and |
| 152 | # add them to the -meta package as RDEPENDS. |
| 153 | |
| 154 | base_pn = d.getVar('PN') |
| 155 | |
| 156 | spa_pn = base_pn + '-spa-plugins' |
| 157 | spa_metapkg = spa_pn + '-meta' |
| 158 | |
| 159 | pw_module_pn = base_pn + '-modules' |
| 160 | pw_module_metapkg = pw_module_pn + '-meta' |
| 161 | |
| 162 | d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1") |
| 163 | d.setVar('FILES:' + spa_metapkg, "") |
| 164 | |
| 165 | d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1") |
| 166 | d.setVar('FILES:' + pw_module_metapkg, "") |
| 167 | |
| 168 | blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ] |
| 169 | spa_metapkg_rdepends = [] |
| 170 | pw_module_metapkg_rdepends = [] |
| 171 | pkgdest = d.getVar('PKGDEST') |
| 172 | |
| 173 | for pkg in oe.utils.packages_filter_out_system(d): |
| 174 | if pkg in blacklist: |
| 175 | continue |
| 176 | |
| 177 | is_spa_pkg = pkg.startswith(spa_pn) |
| 178 | is_pw_module_pkg = pkg.startswith(pw_module_pn) |
| 179 | if not is_spa_pkg and not is_pw_module_pkg: |
| 180 | continue |
| 181 | |
| 182 | if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends: |
| 183 | continue |
| 184 | |
| 185 | # See if the package is empty by looking at the contents of its |
| 186 | # PKGDEST subdirectory. If this subdirectory is empty, then then |
| 187 | # package is empty as well. Empty packages do not get added to |
| 188 | # the meta package's RDEPENDS. |
| 189 | pkgdir = os.path.join(pkgdest, pkg) |
| 190 | if os.path.exists(pkgdir): |
| 191 | dir_contents = os.listdir(pkgdir) or [] |
| 192 | else: |
| 193 | dir_contents = [] |
| 194 | is_empty = len(dir_contents) == 0 |
| 195 | if not is_empty: |
| 196 | if is_spa_pkg: |
| 197 | spa_metapkg_rdepends.append(pkg) |
| 198 | if is_pw_module_pkg: |
| 199 | pw_module_metapkg_rdepends.append(pkg) |
| 200 | |
| 201 | d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends)) |
| 202 | d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package') |
| 203 | |
| 204 | d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends)) |
| 205 | d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package') |
| 206 | } |
| 207 | |
| 208 | PACKAGES =+ "\ |
| 209 | libpipewire \ |
| 210 | ${PN}-tools \ |
| 211 | ${PN}-pulse \ |
| 212 | ${PN}-alsa \ |
| 213 | ${PN}-jack \ |
| 214 | ${PN}-spa-plugins \ |
| 215 | ${PN}-spa-plugins-meta \ |
| 216 | ${PN}-spa-tools \ |
| 217 | ${PN}-modules \ |
| 218 | ${PN}-modules-meta \ |
| 219 | ${PN}-alsa-card-profile \ |
| 220 | ${PN}-v4l2 \ |
| 221 | gstreamer1.0-pipewire \ |
| 222 | " |
| 223 | |
| 224 | PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*" |
| 225 | |
| 226 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd-system-service', 'pipewire.service', '', d)}" |
| 227 | CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf" |
| 228 | FILES:${PN} = " \ |
| 229 | ${datadir}/pipewire/pipewire.conf \ |
| 230 | ${systemd_system_unitdir}/pipewire.* \ |
| 231 | ${systemd_user_unitdir}/pipewire.* \ |
| 232 | ${bindir}/pipewire \ |
| 233 | " |
| 234 | |
| 235 | FILES:${PN}-dev += " \ |
| 236 | ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \ |
| 237 | " |
| 238 | |
| 239 | CONFFILES:libpipewire += "${datadir}/pipewire/client.conf" |
| 240 | FILES:libpipewire = " \ |
| 241 | ${datadir}/pipewire/client.conf \ |
| 242 | ${libdir}/libpipewire-*.so.* \ |
| 243 | " |
| 244 | # Add the bare minimum modules and plugins required to be able |
| 245 | # to use libpipewire. Without these, it is essentially unusable. |
| 246 | RDEPENDS:libpipewire += " \ |
| 247 | ${PN}-modules-client-node \ |
| 248 | ${PN}-modules-protocol-native \ |
| 249 | ${PN}-spa-plugins-support \ |
| 250 | " |
| 251 | |
| 252 | FILES:${PN}-tools = " \ |
| 253 | ${bindir}/pw-cat \ |
| 254 | ${bindir}/pw-cli \ |
| 255 | ${bindir}/pw-dot \ |
| 256 | ${bindir}/pw-dsdplay \ |
| 257 | ${bindir}/pw-dump \ |
| 258 | ${bindir}/pw-link \ |
| 259 | ${bindir}/pw-loopback \ |
| 260 | ${bindir}/pw-metadata \ |
| 261 | ${bindir}/pw-mididump \ |
| 262 | ${bindir}/pw-midiplay \ |
| 263 | ${bindir}/pw-midirecord \ |
| 264 | ${bindir}/pw-mon \ |
| 265 | ${bindir}/pw-play \ |
| 266 | ${bindir}/pw-profiler \ |
| 267 | ${bindir}/pw-record \ |
| 268 | ${bindir}/pw-reserve \ |
| 269 | ${bindir}/pw-top \ |
| 270 | " |
| 271 | |
| 272 | # This is a shim daemon that is intended to be used as a |
| 273 | # drop-in PulseAudio replacement, providing a pulseaudio-compatible |
| 274 | # socket that can be used by applications that use libpulse. |
| 275 | CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf" |
| 276 | FILES:${PN}-pulse = " \ |
| 277 | ${datadir}/pipewire/pipewire-pulse.conf \ |
| 278 | ${systemd_system_unitdir}/pipewire-pulse.* \ |
| 279 | ${systemd_user_unitdir}/pipewire-pulse.* \ |
| 280 | ${bindir}/pipewire-pulse \ |
| 281 | " |
| 282 | RDEPENDS:${PN}-pulse += " \ |
| 283 | ${PN}-modules-protocol-pulse \ |
| 284 | " |
| 285 | |
| 286 | # ALSA plugin to redirect audio to pipewire. |
| 287 | FILES:${PN}-alsa = "\ |
| 288 | ${libdir}/alsa-lib/* \ |
| 289 | ${datadir}/alsa/alsa.conf.d/* \ |
| 290 | " |
| 291 | |
| 292 | # JACK drop-in libraries to redirect audio to pipewire. |
| 293 | CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf" |
| 294 | FILES:${PN}-jack = "\ |
| 295 | ${bindir}/pw-jack \ |
| 296 | ${datadir}/pipewire/jack.conf \ |
| 297 | ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ |
| 298 | " |
| 299 | |
| 300 | # Dynamic SPA plugin packages (see set_dynamic_metapkg_rdepends). |
| 301 | FILES:${PN}-spa-plugins = "" |
| 302 | RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta" |
| 303 | |
| 304 | FILES:${PN}-spa-plugins-bluez5 += " \ |
| 305 | ${datadir}/${SPA_SUBDIR}/bluez5/* \ |
| 306 | " |
| 307 | |
| 308 | FILES:${PN}-spa-tools = " \ |
| 309 | ${bindir}/spa-* \ |
| 310 | " |
| 311 | |
| 312 | # Dynamic PipeWire module packages (see set_dynamic_metapkg_rdepends). |
| 313 | FILES:${PN}-modules = "" |
| 314 | RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" |
| 315 | |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 316 | CONFFILES:${PN}-modules-rt = "${datadir}/pipewire/client-rt.conf" |
| 317 | FILES:${PN}-modules-rt += " \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 318 | ${datadir}/pipewire/client-rt.conf \ |
| 319 | " |
| 320 | |
| 321 | CONFFILES:${PN}-modules-filter-chain = "${datadir}/pipewire/filter-chain/*" |
| 322 | FILES:${PN}-modules-filter-chain += " \ |
| 323 | ${datadir}/pipewire/filter-chain/* \ |
| 324 | " |
| 325 | |
| 326 | FILES:${PN}-alsa-card-profile = " \ |
| 327 | ${datadir}/alsa-card-profile/* \ |
| 328 | ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ |
| 329 | " |
| 330 | |
| 331 | # V4L2 interface emulator for sending/receiving data between PipeWire and V4L2 applications. |
| 332 | FILES:${PN}-v4l2 += " \ |
| 333 | ${bindir}/pw-v4l2 \ |
| 334 | ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \ |
| 335 | " |
| 336 | |
| 337 | FILES:gstreamer1.0-pipewire = " \ |
| 338 | ${libdir}/gstreamer-1.0/* \ |
| 339 | " |