PKGBUILD 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. # Maintainer (arch): David Runge <dvzrv@archlinux.org>
  3. # Maintainer (arch): Jan Alexander Steffens (heftig) <heftig@archlinux.org>
  4. # Contributor: Jan de Groot <jgc@archlinux.org>
  5. # differences with the Artix package:
  6. # - install an XDG autostart script to launch pipewire-pulse, like Gentoo
  7. pkgbase=pipewire
  8. pkgname=(pipewire alsa-card-profiles pipewire-docs pipewire-alsa pipewire-jack
  9. pipewire-pulse gst-plugin-pipewire pipewire-zeroconf pipewire-v4l2
  10. pipewire-x11-bell)
  11. _commit=ebc775674a0cf254cebd6d4694944006405807e3 # tags/0.3.51
  12. pkgver=0.3.51
  13. pkgrel=1
  14. pkgrel+=.nonsystemd1
  15. epoch=1
  16. pkgdesc="Low-latency audio/video router and processor"
  17. url="https://pipewire.org"
  18. arch=(x86_64)
  19. arch+=(i686 armv7h)
  20. license=(MIT)
  21. makedepends=(git meson doxygen graphviz python-docutils valgrind libpulse
  22. alsa-lib libusb gst-plugins-base rtkit dbus sdl2 ncurses
  23. libcanberra libsndfile bluez-libs sbc libldac libfreeaptx
  24. libfdk-aac avahi lilv webrtc-audio-processing libx11 libxfixes)
  25. checkdepends=(desktop-file-utils)
  26. options=(debug)
  27. source=("git+https://gitlab.freedesktop.org/pipewire/pipewire.git#commit=$_commit"
  28. pipewire.desktop pipewire-launcher)
  29. sha256sums=('SKIP'
  30. 'b5b68d711ff070b6217c4da5de0c5488b36a012b7e5484bf1d89d1969a778026'
  31. '47f4d64dd4583963ce493828c171b608949dcc9f6e20d5dc2cdcb3a2f3ba6bac')
  32. pkgver() {
  33. cd pipewire
  34. git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
  35. }
  36. prepare() {
  37. cd pipewire
  38. # remove export of LD_LIBRARY_PATH for pw-jack as it would add /usr/lib
  39. sed -i '/LD_LIBRARY_PATH/d' pipewire-jack/src/pw-jack.in
  40. }
  41. build() {
  42. local meson_options=(
  43. -D docs=enabled
  44. -D jack=disabled
  45. -D jack-devel=true
  46. -D libjack-path=/usr/lib
  47. -D libcamera=disabled
  48. -D udevrulesdir=/usr/lib/udev/rules.d
  49. -D systemd=disabled
  50. -D roc=disabled
  51. -D session-managers=[]
  52. )
  53. arch-meson pipewire build "${meson_options[@]}"
  54. meson compile -C build
  55. }
  56. check() {
  57. meson test -C build --print-errorlogs
  58. }
  59. _pick() {
  60. local p="$1" f d; shift
  61. for f; do
  62. d="$srcdir/$p/${f#$pkgdir/}"
  63. mkdir -p "$(dirname "$d")"
  64. mv "$f" "$d"
  65. rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  66. done
  67. }
  68. _ver=${pkgver:0:3}
  69. package_pipewire() {
  70. license+=(LGPL) # libspa-alsa
  71. depends=(alsa-card-profiles libdbus-1.so libncursesw.so libsndfile.so
  72. libudev.so libusb-1.0.so libasound.so libbluetooth.so
  73. libsbc.so libldacBT_enc.so libfreeaptx.so libfdk-aac.so liblilv-0.so
  74. libwebrtc_audio_processing.so)
  75. optdepends=('pipewire-docs: Documentation'
  76. 'pipewire-session-manager: Session manager'
  77. 'pipewire-alsa: ALSA configuration'
  78. 'pipewire-jack: JACK support'
  79. 'pipewire-pulse: PulseAudio replacement'
  80. 'gst-plugin-pipewire: GStreamer plugin'
  81. 'pipewire-zeroconf: Zeroconf support'
  82. 'pipewire-v4l2: V4L2 interceptor'
  83. 'pipewire-x11-bell: X11 bell'
  84. 'realtime-privileges: realtime privileges with rt module'
  85. 'rtkit: realtime privileges with rtkit module')
  86. provides=(libpipewire-$_ver.so)
  87. meson install -C build --destdir "$pkgdir"
  88. ( cd "$pkgdir"
  89. _pick acp usr/lib/udev
  90. _pick acp usr/share/alsa-card-profile
  91. _pick docs usr/share/doc
  92. _pick jack usr/bin/pw-jack
  93. _pick jack usr/include/jack
  94. _pick jack usr/lib/libjack*
  95. _pick jack usr/lib/pkgconfig/jack.pc
  96. _pick jack usr/share/man/man1/pw-jack.1
  97. _pick jack usr/share/pipewire/jack.conf
  98. _pick pulse usr/bin/pipewire-pulse
  99. _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-protocol-pulse.so
  100. _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-pulse-tunnel.so
  101. _pick gst usr/lib/gstreamer-1.0
  102. _pick zeroconf usr/lib/pipewire-$_ver/libpipewire-module-{raop,zeroconf}-discover.so
  103. _pick v4l2 usr/bin/pw-v4l2 usr/lib/pipewire-$_ver/v4l2
  104. _pick x11-bell usr/lib/pipewire-$_ver/libpipewire-module-x11-bell.so
  105. )
  106. mkdir -p "$pkgdir/etc/alsa/conf.d"
  107. ln -st "$pkgdir/etc/alsa/conf.d" \
  108. /usr/share/alsa/alsa.conf.d/50-pipewire.conf
  109. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  110. }
  111. package_alsa-card-profiles() {
  112. pkgdesc+=" - ALSA card profiles"
  113. license=(LGPL)
  114. mv acp/* "$pkgdir"
  115. }
  116. package_pipewire-docs() {
  117. pkgdesc+=" - documentation"
  118. mv docs/* "$pkgdir"
  119. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  120. }
  121. package_pipewire-alsa() {
  122. pkgdesc+=" - ALSA configuration"
  123. depends=(pipewire-session-manager)
  124. provides=(pulseaudio-alsa)
  125. mkdir -p "$pkgdir/etc/alsa/conf.d"
  126. ln -st "$pkgdir/etc/alsa/conf.d" \
  127. /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf
  128. install -Dm644 /dev/null \
  129. "$pkgdir/usr/share/pipewire/media-session.d/with-alsa"
  130. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  131. }
  132. package_pipewire-jack() {
  133. pkgdesc+=" - JACK support"
  134. license+=(GPL2) # libjackserver
  135. depends=(pipewire-session-manager libpipewire-$_ver.so sh)
  136. optdepends=('jack-example-tools: for official JACK example-clients and tools')
  137. conflicts=(jack jack2)
  138. provides=(jack libjack.so libjackserver.so libjacknet.so)
  139. mv jack/* "$pkgdir"
  140. install -Dm644 /dev/null \
  141. "$pkgdir/usr/share/pipewire/media-session.d/with-jack"
  142. # directories for overrides
  143. mkdir -p "$pkgdir/etc/pipewire/jack.conf.d"
  144. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  145. }
  146. package_pipewire-pulse() {
  147. pkgdesc+=" - PulseAudio replacement"
  148. depends=(pipewire-session-manager libpipewire-$_ver.so libpulse.so
  149. libavahi-{client,common}.so)
  150. provides=(pulseaudio pulseaudio-bluetooth)
  151. conflicts=(pulseaudio pulseaudio-bluetooth)
  152. mv pulse/* "$pkgdir"
  153. install -Dm644 /dev/null \
  154. "$pkgdir/usr/share/pipewire/media-session.d/with-pulseaudio"
  155. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  156. # borrowed from Gentoo's media-video/pipewire, with pipewire-media-session support
  157. mkdir -p "$pkgdir/etc/xdg/autostart"
  158. install -m644 pipewire.desktop "$pkgdir/etc/xdg/autostart/pipewire.desktop"
  159. install -m755 pipewire-launcher "$pkgdir/usr/bin/pipewire-launcher"
  160. }
  161. package_gst-plugin-pipewire() {
  162. pkgdesc="Multimedia graph framework - pipewire plugin"
  163. depends=(pipewire-session-manager libpipewire-$_ver.so gst-plugins-base-libs)
  164. mv gst/* "$pkgdir"
  165. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  166. }
  167. package_pipewire-zeroconf() {
  168. pkgdesc+=" - Zeroconf support"
  169. depends=(pipewire libpipewire-$_ver.so libavahi-{client,common}.so)
  170. mv zeroconf/* "$pkgdir"
  171. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  172. }
  173. package_pipewire-v4l2() {
  174. pkgdesc+=" - V4L2 interceptor"
  175. depends=(pipewire-session-manager libpipewire-$_ver.so sh)
  176. mv v4l2/* "$pkgdir"
  177. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  178. }
  179. package_pipewire-x11-bell() {
  180. pkgdesc+=" - X11 bell"
  181. depends=(pipewire libpipewire-$_ver.so libx11 libxfixes libcanberra.so)
  182. mv x11-bell/* "$pkgdir"
  183. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  184. }
  185. # vim:set sw=2 et: