archrelease: copy trunk to extra-x86_64
[arch-packages.git] / pipewire / trunk / PKGBUILD
blob2675b8f3ebfcd18ad13fa5e2614397814feef98e
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
3 # Contributor: Jan de Groot <jgc@archlinux.org>
5 pkgbase=pipewire
6 pkgname=(
7   pipewire
8   libpipewire
9   alsa-card-profiles
10   pipewire-docs
11   pipewire-audio
12   pipewire-alsa
13   pipewire-jack
14   pipewire-pulse
15   pipewire-roc
16   gst-plugin-pipewire
17   pipewire-zeroconf
18   pipewire-v4l2
19   pipewire-x11-bell
21 _commit=9f7d60c1e84cc0481afc3f6ccf76e127567943a8  # tags/0.3.70
22 pkgver=0.3.70
23 pkgrel=2
24 epoch=1
25 pkgdesc="Low-latency audio/video router and processor"
26 url="https://pipewire.org"
27 arch=(x86_64)
28 license=(MIT)
29 makedepends=(
30   alsa-lib
31   avahi
32   bluez-libs
33   dbus
34   doxygen
35   git
36   glib2
37   graphviz
38   gst-plugins-base
39   libcamera
40   libcanberra
41   libfdk-aac
42   libfreeaptx
43   liblc3
44   libldac
45   libmysofa
46   libpulse
47   libsndfile
48   libusb
49   libx11
50   libxfixes
51   lilv
52   meson
53   ncurses
54   opus
55   python-docutils
56   readline
57   roc-toolkit
58   rtkit
59   sbc
60   sdl2
61   systemd
62   tinycompress
63   valgrind
64   webrtc-audio-processing
66 checkdepends=(desktop-file-utils)
67 source=("git+https://gitlab.freedesktop.org/pipewire/pipewire.git#commit=$_commit")
68 b2sums=('SKIP')
70 pkgver() {
71   cd pipewire
72   git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
75 prepare() {
76   cd pipewire
78   # remove export of LD_LIBRARY_PATH for pw-jack as it would add /usr/lib
79   sed -i '/LD_LIBRARY_PATH/d' pipewire-jack/src/pw-jack.in
82 build() {
83   local meson_options=(
84     -D bluez5-codec-lc3=enabled
85     -D bluez5-codec-lc3plus=disabled
86     -D compress-offload=enabled
87     -D docs=enabled
88     -D jack-devel=true
89     -D jack=disabled
90     -D libjack-path=/usr/lib
91     -D rlimits-install=false
92     -D session-managers=[]
93     -D udevrulesdir=/usr/lib/udev/rules.d
94   )
96   arch-meson pipewire build "${meson_options[@]}"
97   meson compile -C build
100 check() {
101   meson test -C build --print-errorlogs
104 _pick() {
105   local p="$1" f d; shift
106   for f; do
107     d="$srcdir/$p/${f#$pkgdir/}"
108     mkdir -p "$(dirname "$d")"
109     mv "$f" "$d"
110     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
111   done
114 _ver=${pkgver:0:3}
116 package_pipewire() {
117   license+=(LGPL)  # libspa-alsa
118   depends=(
119     "libpipewire=$epoch:$pkgver-$pkgrel"
120     libcamera-base.so
121     libcamera.so
122     libdbus-1.so
123     libglib-2.0.so
124     libncursesw.so
125     libpipewire-$_ver.so
126     libreadline.so
127     libsystemd.so
128     libudev.so
129   )
130   optdepends=(
131     'gst-plugin-pipewire: GStreamer plugin'
132     'pipewire-alsa: ALSA configuration'
133     'pipewire-audio: Audio support'
134     'pipewire-docs: Documentation'
135     'pipewire-jack: JACK support'
136     'pipewire-pulse: PulseAudio replacement'
137     'pipewire-roc: ROC streaming'
138     'pipewire-session-manager: Session manager'
139     'pipewire-v4l2: V4L2 interceptor'
140     'pipewire-x11-bell: X11 bell'
141     'pipewire-zeroconf: Zeroconf support'
142     'realtime-privileges: realtime privileges with rt module'
143     'rtkit: realtime privileges with rtkit module'
144   )
145   install=pipewire.install
147   meson install -C build --destdir "$pkgdir"
149   (
150     cd "$pkgdir"
152     # Replace copies with symlinks
153     for _f in pipewire-{aes67,avb,pulse}; do
154       cmp usr/bin/pipewire usr/bin/$_f
155       ln -sf pipewire usr/bin/$_f
156     done
158     _pick lib usr/include/{pipewire-$_ver,spa-0.2}
159     _pick lib usr/lib/libpipewire-$_ver.so*
160     _pick lib usr/lib/pkgconfig/lib{pipewire-$_ver,spa-0.2}.pc
162     _pick acp usr/lib/udev
163     _pick acp usr/share/alsa-card-profile
165     _pick docs usr/share/doc
167     _pick audio usr/bin/pipewire-{aes67,avb}
168     _pick audio usr/bin/pw-{cat,{,enc}play,record,midi{play,record},dsdplay}
169     _pick audio usr/bin/pw-{loopback,mididump}
170     _pick audio usr/bin/spa-{acp-tool,resample}
171     _pick audio usr/lib/alsa-lib
172     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-avb.so
173     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-echo-cancel.so
174     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-fallback-sink.so
175     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-filter-chain.so
176     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-loopback.so
177     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-pipe-tunnel.so
178     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-protocol-simple.so
179     _pick audio usr/lib/pipewire-$_ver/libpipewire-module-rtp-*.so
180     _pick audio usr/lib/spa-0.2/{aec,alsa,audio*,avb,bluez5}
181     _pick audio usr/lib/systemd/user/filter-chain.service
182     _pick audio usr/share/alsa
183     _pick audio usr/share/man/man1/pw-{cat,mididump}.1
184     _pick audio usr/share/pipewire/filter-chain*
185     _pick audio usr/share/pipewire/pipewire-{aes67,avb}.conf
186     _pick audio usr/share/spa-0.2/bluez5
188     _pick jack usr/bin/pw-jack
189     _pick jack usr/include/jack
190     _pick jack usr/lib/libjack*
191     _pick jack usr/lib/pkgconfig/jack.pc
192     _pick jack usr/share/man/man1/pw-jack.1
193     _pick jack usr/share/pipewire/jack.conf
195     _pick pulse usr/bin/pipewire-pulse
196     _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-protocol-pulse.so
197     _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-pulse-tunnel.so
198     _pick pulse usr/lib/systemd/user/pipewire-pulse.*
199     _pick pulse usr/share/man/man1/pipewire-pulse.1
200     _pick pulse usr/share/pipewire/pipewire-pulse.conf
202     _pick roc usr/lib/pipewire-$_ver/libpipewire-module-roc*.so
204     _pick gst usr/lib/gstreamer-1.0
206     _pick zeroconf usr/lib/pipewire-$_ver/libpipewire-module-{raop,zeroconf}-*.so
208     _pick v4l2 usr/bin/pw-v4l2 usr/lib/pipewire-$_ver/v4l2
210     _pick x11-bell usr/lib/pipewire-$_ver/libpipewire-module-x11-bell.so
212     # directories for overrides
213     mkdir -p etc/pipewire/{client-rt,client,minimal,pipewire}.conf.d
214   )
216   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
219 package_libpipewire() {
220   pkgdesc+=" - client library"
221   depends=(
222     gcc-libs
223   )
224   provides=(libpipewire-$_ver.so)
226   mv lib/* "$pkgdir"
228   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
231 package_alsa-card-profiles() {
232   pkgdesc+=" - ALSA card profiles"
233   license=(LGPL)
235   mv acp/* "$pkgdir"
238 package_pipewire-docs() {
239   pkgdesc+=" - documentation"
241   mv docs/* "$pkgdir"
243   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
246 package_pipewire-audio() {
247   pkgdesc+=" - Audio support"
248   depends=(
249     alsa-card-profiles
250     libasound.so
251     libbluetooth.so
252     libfdk-aac.so
253     libfreeaptx.so
254     liblc3.so
255     libldacBT_enc.so
256     liblilv-0.so
257     libmysofa.so
258     libopus.so
259     libpipewire-$_ver.so
260     libsbc.so
261     libsndfile.so
262     libtinycompress.so
263     libusb-1.0.so
264     libwebrtc_audio_processing.so
265     pipewire
266   )
268   mv audio/* "$pkgdir"
270   mkdir -p "$pkgdir/etc/alsa/conf.d"
271   ln -st "$pkgdir/etc/alsa/conf.d" \
272     /usr/share/alsa/alsa.conf.d/50-pipewire.conf
274   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
277 package_pipewire-alsa() {
278   pkgdesc+=" - ALSA configuration"
279   depends=(
280     pipewire
281     pipewire-audio
282     pipewire-session-manager
283   )
284   conflicts=(pulseaudio-alsa)
285   provides=(pulseaudio-alsa)
287   mkdir -p "$pkgdir/etc/alsa/conf.d"
288   ln -st "$pkgdir/etc/alsa/conf.d" \
289     /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf
291   install -Dm644 /dev/null \
292     "$pkgdir/usr/share/pipewire/media-session.d/with-alsa"
294   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
297 package_pipewire-jack() {
298   pkgdesc+=" - JACK support"
299   license+=(GPL2)  # libjackserver
300   depends=(
301     libpipewire-$_ver.so
302     pipewire
303     pipewire-audio
304     pipewire-session-manager
305     sh
306   )
307   optdepends=('jack-example-tools: for official JACK example-clients and tools')
308   conflicts=(jack jack2)
309   provides=(jack libjack.so libjackserver.so libjacknet.so)
311   mv jack/* "$pkgdir"
313   install -Dm644 /dev/null \
314     "$pkgdir/usr/share/pipewire/media-session.d/with-jack"
316   # directories for overrides
317   mkdir -p "$pkgdir/etc/pipewire/jack.conf.d"
319   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
322 package_pipewire-pulse() {
323   pkgdesc+=" - PulseAudio replacement"
324   depends=(
325     libavahi-{client,common}.so
326     libglib-2.0.so
327     libpipewire-$_ver.so
328     libpulse.so
329     pipewire
330     pipewire-audio
331     pipewire-session-manager
332   )
333   provides=(pulseaudio pulseaudio-bluetooth)
334   conflicts=(pulseaudio pulseaudio-bluetooth)
335   install=pipewire-pulse.install
337   mv pulse/* "$pkgdir"
339   # directory for overrides
340   mkdir -p "$pkgdir/etc/pipewire/pipewire-pulse.conf.d"
342   install -Dm644 /dev/null \
343     "$pkgdir/usr/share/pipewire/media-session.d/with-pulseaudio"
345   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
348 package_pipewire-roc() {
349   pkgdesc+=" - ROC streaming support"
350   depends=(
351     libpipewire-$_ver.so
352     libroc.so
353     pipewire
354     pipewire-audio
355     roc-toolkit
356   )
358   mv roc/* "$pkgdir"
360   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
363 package_gst-plugin-pipewire() {
364   pkgdesc="Multimedia graph framework - pipewire plugin"
365   depends=(
366     gst-plugins-base-libs
367     libpipewire-$_ver.so
368     pipewire
369     pipewire-session-manager
370   )
372   mv gst/* "$pkgdir"
374   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
377 package_pipewire-zeroconf() {
378   pkgdesc+=" - Zeroconf support"
379   depends=(
380     libavahi-{client,common}.so
381     libpipewire-$_ver.so
382     openssl
383     pipewire
384   )
386   mv zeroconf/* "$pkgdir"
388   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
391 package_pipewire-v4l2() {
392   pkgdesc+=" - V4L2 interceptor"
393   depends=(
394     libpipewire-$_ver.so
395     pipewire
396     pipewire-session-manager
397     sh
398   )
400   mv v4l2/* "$pkgdir"
402   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
405 package_pipewire-x11-bell() {
406   pkgdesc+=" - X11 bell"
407   depends=(
408     libcanberra.so
409     libpipewire-$_ver.so
410     libx11
411     libxfixes
412     pipewire
413     pipewire-audio
414   )
416   mv x11-bell/* "$pkgdir"
418   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
421 # vim:set sw=2 sts=-1 et: