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