archrelease: copy trunk to extra-x86_64
[arch-packages.git] / pipewire / trunk / PKGBUILD
blob8b5035172936a5ce42357da98d60a8ebc9278d00
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Jan de Groot <jgc@archlinux.org>
4 pkgbase=pipewire
5 pkgname=(pipewire alsa-card-profiles pipewire-docs pipewire-alsa pipewire-jack
6          pipewire-pulse gst-plugin-pipewire pipewire-zeroconf pipewire-v4l2)
7 pkgver=0.3.40
8 pkgrel=1
9 epoch=1
10 pkgdesc="Low-latency audio/video router and processor"
11 url="https://pipewire.org"
12 license=(MIT)
13 arch=(x86_64)
14 makedepends=(git meson doxygen graphviz python-docutils valgrind libpulse
15              alsa-lib libusb gst-plugins-base rtkit dbus sdl2 ncurses libsndfile
16              bluez-libs sbc libldac libfreeaptx libfdk-aac avahi
17              webrtc-audio-processing)
18 checkdepends=(desktop-file-utils)
19 _commit=7afd80052b7c49754a13c9ab49c368f95b60e0a7  # tags/0.3.40
20 source=("git+https://gitlab.freedesktop.org/pipewire/pipewire.git#commit=$_commit")
21 sha256sums=('SKIP')
23 pkgver() {
24   cd pipewire
25   git describe --tags | sed 's/-/+/g'
28 prepare() {
29   cd pipewire
32 build() {
33   local meson_options=(
34     -D docs=enabled
35     -D jack=disabled
36     -D libcamera=disabled
37     -D udevrulesdir=/usr/lib/udev/rules.d
38     -D roc=disabled
39     -D session-managers=[]
40   )
42   arch-meson pipewire build "${meson_options[@]}"
43   meson compile -C build
46 check() {
47   meson test -C build --print-errorlogs
50 _pick() {
51   local p="$1" f d; shift
52   for f; do
53     d="$srcdir/$p/${f#$pkgdir/}"
54     mkdir -p "$(dirname "$d")"
55     mv "$f" "$d"
56     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
57   done
60 _ver=${pkgver:0:3}
62 package_pipewire() {
63   license+=(LGPL)  # libspa-alsa
64   depends=(rtkit alsa-card-profiles libdbus-1.so libncursesw.so libsndfile.so
65            libudev.so libusb-1.0.so libasound.so libsystemd.so libbluetooth.so
66            libsbc.so libldacBT_enc.so libfreeaptx.so libfdk-aac.so
67            libwebrtc_audio_processing.so)
68   optdepends=('pipewire-docs: Documentation'
69               'pipewire-session-manager: Session manager'
70               'pipewire-alsa: ALSA configuration'
71               'pipewire-jack: JACK support'
72               'pipewire-pulse: PulseAudio replacement'
73               'gst-plugin-pipewire: GStreamer plugin'
74               'pipewire-zeroconf: Zeroconf support'
75               'pipewire-v4l2: V4L2 interceptor')
76   provides=(libpipewire-$_ver.so)
77   install=pipewire.install
79   meson install -C build --destdir "$pkgdir"
81   ( cd "$pkgdir"
83     _pick acp usr/lib/udev
84     _pick acp usr/share/alsa-card-profile
86     _pick docs usr/share/doc
88     _pick jack usr/bin/pw-jack usr/lib/pipewire-$_ver/jack
89     _pick jack usr/share/man/man1/pw-jack.1
90     _pick jack usr/share/pipewire/jack.conf
92     _pick pulse usr/bin/pipewire-pulse
93     _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-protocol-pulse.so
94     _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-pulse-tunnel.so
95     _pick pulse usr/lib/systemd/user/pipewire-pulse.*
97     _pick gst usr/lib/gstreamer-1.0
99     _pick zeroconf usr/lib/pipewire-$_ver/libpipewire-module-zeroconf-discover.so
101     _pick v4l2 usr/bin/pw-v4l2 usr/lib/pipewire-$_ver/v4l2
102   )
104   mkdir -p "$pkgdir/etc/alsa/conf.d"
105   ln -st "$pkgdir/etc/alsa/conf.d" \
106     /usr/share/alsa/alsa.conf.d/50-pipewire.conf
108   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
111 package_alsa-card-profiles() {
112   pkgdesc+=" - ALSA card profiles"
113   license=(LGPL)
115   mv acp/* "$pkgdir"
118 package_pipewire-docs() {
119   pkgdesc+=" - documentation"
121   mv docs/* "$pkgdir"
123   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
126 package_pipewire-alsa() {
127   pkgdesc+=" - ALSA configuration"
128   depends=(pipewire-session-manager)
129   provides=(pulseaudio-alsa)
131   mkdir -p "$pkgdir/etc/alsa/conf.d"
132   ln -st "$pkgdir/etc/alsa/conf.d" \
133     /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf
135   install -Dm644 /dev/null \
136     "$pkgdir/usr/share/pipewire/media-session.d/with-alsa"
138   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
141 package_pipewire-jack() {
142   pkgdesc+=" - JACK support"
143   license+=(GPL2)  # libjackserver
144   depends=(pipewire-session-manager libpipewire-$_ver.so)
146   mv jack/* "$pkgdir"
148   install -Dm644 /dev/null \
149     "$pkgdir/usr/share/pipewire/media-session.d/with-jack"
151   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
154 package_pipewire-pulse() {
155   pkgdesc+=" - PulseAudio replacement"
156   depends=(pipewire-session-manager libpipewire-$_ver.so libpulse.so
157            libavahi-{client,common}.so)
158   provides=(pulseaudio pulseaudio-bluetooth)
159   conflicts=(pulseaudio pulseaudio-bluetooth)
160   install=pipewire-pulse.install
162   mv pulse/* "$pkgdir"
164   install -Dm644 /dev/null \
165     "$pkgdir/usr/share/pipewire/media-session.d/with-pulseaudio"
167   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
170 package_gst-plugin-pipewire() {
171   pkgdesc="Multimedia graph framework - pipewire plugin"
172   depends=(pipewire-session-manager libpipewire-$_ver.so gst-plugins-base-libs)
174   mv gst/* "$pkgdir"
176   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
179 package_pipewire-zeroconf() {
180   pkgdesc+=" - Zeroconf support"
181   depends=(pipewire libpipewire-$_ver.so libavahi-{client,common}.so)
183   mv zeroconf/* "$pkgdir"
185   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
188 package_pipewire-v4l2() {
189   pkgdesc+=" - V4L2 interceptor"
190   depends=(pipewire-session-manager libpipewire-$_ver.so)
192   mv v4l2/* "$pkgdir"
194   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
197 # vim:set sw=2 et: