# Contributor: Rasmus Thomsen # Maintainer: team/alpine-desktop pkgname=pipewire pkgver=0.3.77 pkgrel=0 pkgdesc="Multimedia processing graphs" url="https://pipewire.org/" arch="all" license="LGPL-2.1-or-later" pkggroups="pipewire" makedepends=" alsa-lib-dev avahi-dev bash bluez-dev dbus-dev doxygen eudev-dev fdk-aac-dev glib-dev graphviz gst-plugins-base-dev gstreamer-dev jack-dev libcamera-dev libfreeaptx-dev liblc3-dev libusb-dev libx11-dev meson ncurses-dev pulseaudio-dev py3-docutils readline-dev roc-toolkit-dev sbc-dev vulkan-loader-dev xmltoman " # move regular -dev after -jackdev, to steal files subpackages=" $pkgname-dbg $pkgname-doc $pkgname-alsa $pkgname-pulse $pkgname-jack $pkgname-jack-dev:jackdev $pkgname-dev gst-plugin-pipewire:gst_plugin $pkgname-zeroconf $pkgname-spa-bluez $pkgname-spa-vulkan $pkgname-tools $pkgname-spa-tools:spa_tools $pkgname-lang " install="$pkgname.post-upgrade $pkgname.post-install" source="https://gitlab.freedesktop.org/PipeWire/pipewire/-/archive/$pkgver/pipewire-$pkgver.tar.gz pipewire.desktop pipewire-launcher.sh " case "$CARCH" in s390x) # libldac not available for big endian ;; *) makedepends="$makedepends libldac-dev" ;; esac case "$CARCH" in ppc64le|s390x|riscv64) # no webrtc-audio-processing ;; *) makedepends="$makedepends webrtc-audio-processing-dev" subpackages="$subpackages $pkgname-echo-cancel:echo_cancel" ;; esac # put libs last to steal residual files taken by some prior extras subpackages="$subpackages $pkgname-libs" build() { CFLAGS="$CFLAGS -O2" \ CXXFLAGS="$CXXFLAGS -O2" \ CPPFLAGS="$CPPFLAGS -O2" \ abuild-meson \ -Db_lto=true \ -Dlibjack-path=/usr/lib \ -Dlibv4l2-path=/usr/lib \ -Ddocs=disabled \ -Dman=enabled \ -Dgstreamer=enabled \ -Dexamples=enabled \ -Dffmpeg=disabled \ -Djack-devel=true \ -Dsystemd=disabled \ -Dvulkan=enabled \ -Dsdl2=disabled \ -Dlibcamera=enabled \ -Droc=enabled \ -Dbluez5-codec-lc3=enabled \ -Dsession-managers=[] \ . output meson compile -C output } check() { meson test --no-rebuild --print-errorlogs -C output } package() { DESTDIR="$pkgdir" meson install --no-rebuild -C output install -Dm644 "$srcdir"/pipewire.desktop -t "$pkgdir"/etc/xdg/autostart/ install -Dm755 "$srcdir"/pipewire-launcher.sh "$pkgdir"/usr/libexec/pipewire-launcher } alsa() { pkgdesc="ALSA support for pipewire" replaces="$pkgname" # for backward compatibility amove usr/lib/alsa-lib amove usr/share/alsa/alsa.conf.d mkdir -p "$subpkgdir"/etc/alsa/conf.d cp -r \ "$subpkgdir"/usr/share/alsa/alsa.conf.d/*.conf \ "$subpkgdir"/etc/alsa/conf.d/ } pulse() { pkgdesc="Pulseaudio support for pipewire" depends=" pipewire-session-manager pulseaudio-utils " provides="pulseaudio=$pkgver-r$pkgrel pulseaudio-bluez=$pkgver-r$pkgrel" provider_priority=1 amove usr/bin/pipewire-pulse amove usr/lib/pipewire-${pkgver%.*}/libpipewire-module-protocol-pulse.so amove usr/lib/pipewire-${pkgver%.*}/libpipewire-module-pulse-tunnel.so amove usr/share/pipewire/pipewire-pulse.conf amove usr/share/pipewire/pipewire-pulse.conf.avail } jack() { pkgdesc="JACK support for pipewire" depends="pipewire-session-manager" provides="jack=$pkgver-r$pkgrel" replaces="jack" amove usr/lib/libjack*.so.* amove usr/bin/pw-jack amove usr/lib/spa-*/jack/libspa-jack.so amove usr/share/pipewire/jack.conf } gst_plugin() { pkgdesc="Multimedia graph framework - PipeWire plugin" depends="pipewire-session-manager gst-plugins-base" amove usr/lib/gstreamer-1.0 } echo_cancel() { pkgdesc="WebRTC-based echo canceller module for PipeWire" depends="$pkgname=$pkgver-r$pkgrel" amove usr/lib/pipewire-${pkgver%.*}/libpipewire-module-echo-cancel.so } zeroconf() { pkgdesc="$pkgdesc - Zeroconf support" depends="" provides="pulseaudio-zeroconf=$pkgver-r$pkgrel" provider_priority=1 amove usr/lib/pipewire-${pkgver%.*}/libpipewire-module-zeroconf-discover.so amove usr/lib/pipewire-${pkgver%.*}/libpipewire-module-raop-*.so } bluez() { pkgdesc="PipeWire BlueZ5 SPA plugin (Bluetooth)" depends="" replaces="$pkgname" # for backward compatibility amove usr/lib/spa-*/bluez5 } vulkan() { pkgdesc="PipeWire Vulkan SPA plugin" depends="" amove usr/lib/spa-*/vulkan } tools() { pkgdesc="PipeWire tools" depends="$pkgname=$pkgver-r$pkgrel" replaces="$pkgname" # for backward compatibility amove usr/bin/pw-* } spa_tools() { pkgdesc="PipeWire SPA tools" depends="" replaces="$pkgname" # for backward compatibility amove usr/bin/spa-* } jackdev() { pkgdesc="JACK development files (from pipewire)" provides="jack-dev=$pkgver-r$pkgrel" amove usr/lib/libjack*.so amove usr/include/jack amove usr/lib/pkgconfig/jack.pc } libs() { default_libs # the libraries must be paired with the client config and the plugins, # see: # https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3296 # https://bugs.archlinux.org/task/78813 amove \ usr/share/pipewire/client*.conf* \ usr/lib/pipewire-*/ \ usr/lib/spa-*/ } sha512sums=" 9bb41520d162a3925042f62934244c951b229951b25682d4489c72957827d0a5203edc784a7bf59e30e43f677405626994b03cf186ffb7b0b53f7ca569eb10e2 pipewire-0.3.77.tar.gz d5d8bc64e42715aa94296e3e26e740142bff7f638c7eb4fecc0301e46d55636d889bdc0c0399c1eb523271b20f7c48cc03f6ce3c072e0e8576c821ed1ea0e3dd pipewire.desktop e46939b8f903fe6b7421cd42d0746e669402d76afe3326401c186fefeb725e3c126a00ba9f315067d2535991134a24afd855752d757e9e52c20191b5d388f99b pipewire-launcher.sh "