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