PKGBUILD 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. # Maintainer (Arch): Jan Alexander Steffens (heftig) <heftig@archlinux.org>
  3. # Contributor (Arch): Jan de Groot <jgc@archlinux.org>
  4. pkgbase=pipewire
  5. pkgname=(pipewire alsa-card-profiles pipewire-docs pipewire-media-session
  6. pipewire-alsa pipewire-jack pipewire-pulse gst-plugin-pipewire
  7. pipewire-zeroconf)
  8. pkgver=0.3.31
  9. pkgrel=1
  10. pkgrel+=.nonsystemd1
  11. epoch=1
  12. pkgdesc="Low-latency audio/video router and processor"
  13. url="https://pipewire.org"
  14. license=(MIT)
  15. arch=(x86_64)
  16. arch+=(i686 armv7h)
  17. makedepends=(git meson doxygen xmltoman valgrind libpulse alsa-lib
  18. gst-plugins-base rtkit dbus sdl2 ncurses libsndfile bluez-libs sbc
  19. libldac libopenaptx libfdk-aac avahi webrtc-audio-processing)
  20. checkdepends=(desktop-file-utils)
  21. _commit=c43dabcc96e2e072cdf08e5f094bb677d9017c6b # tags/0.3.31
  22. source=("git+https://gitlab.freedesktop.org/pipewire/pipewire.git#commit=$_commit")
  23. sha256sums=('SKIP')
  24. pkgver() {
  25. cd pipewire
  26. git describe --tags | sed 's/-/+/g'
  27. }
  28. prepare() {
  29. cd pipewire
  30. }
  31. build() {
  32. local meson_options=(
  33. -D docs=enabled
  34. -D jack=disabled
  35. -D libcamera=disabled
  36. -D udevrulesdir=/usr/lib/udev/rules.d
  37. -D systemd=disabled
  38. -D roc=disabled
  39. )
  40. arch-meson pipewire build "${meson_options[@]}"
  41. meson compile -C build
  42. }
  43. check() {
  44. meson test -C build --print-errorlogs
  45. }
  46. _pick() {
  47. local p="$1" f d; shift
  48. for f; do
  49. d="$srcdir/$p/${f#$pkgdir/}"
  50. mkdir -p "$(dirname "$d")"
  51. mv "$f" "$d"
  52. rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  53. done
  54. }
  55. _ver=${pkgver:0:3}
  56. package_pipewire() {
  57. license+=(LGPL) # libspa-alsa
  58. depends=(rtkit alsa-card-profiles libdbus-1.so libncursesw.so libsndfile.so
  59. libudev.so libusb-1.0.so libasound.so libbluetooth.so
  60. libsbc.so libldacBT_enc.so libopenaptx.so libfdk-aac.so
  61. libwebrtc_audio_processing.so)
  62. optdepends=('pipewire-docs: Documentation'
  63. 'pipewire-media-session: Default session manager'
  64. 'pipewire-alsa: ALSA configuration'
  65. 'pipewire-jack: JACK support'
  66. 'pipewire-pulse: PulseAudio replacement'
  67. 'gst-plugin-pipewire: GStreamer support'
  68. 'pipewire-zeroconf: Zeroconf support')
  69. provides=(libpipewire-$_ver.so)
  70. meson install -C build --destdir "$pkgdir"
  71. ( cd "$pkgdir"
  72. _pick acp usr/lib/udev
  73. _pick acp usr/share/alsa-card-profile
  74. _pick docs usr/share/doc
  75. _pick pms usr/bin/pipewire-media-session
  76. _pick pms usr/share/pipewire/media-session.d/*.conf
  77. _pick jack usr/bin/pw-jack usr/lib/pipewire-$_ver/jack
  78. _pick jack usr/share/man/man1/pw-jack.1
  79. _pick jack usr/share/pipewire/{jack.conf,media-session.d/with-jack}
  80. _pick pulse usr/bin/pipewire-pulse
  81. _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-protocol-pulse.so
  82. _pick pulse usr/lib/pipewire-$_ver/libpipewire-module-pulse-tunnel.so
  83. _pick pulse usr/share/pipewire/media-session.d/with-pulseaudio
  84. _pick gst usr/lib/gstreamer-1.0
  85. _pick zeroconf usr/lib/pipewire-$_ver/libpipewire-module-zeroconf-discover.so
  86. )
  87. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  88. }
  89. package_alsa-card-profiles() {
  90. pkgdesc+=" - ALSA card profiles"
  91. license=(LGPL)
  92. mv acp/* "$pkgdir"
  93. }
  94. package_pipewire-docs() {
  95. pkgdesc+=" - documentation"
  96. mv docs/* "$pkgdir"
  97. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  98. }
  99. package_pipewire-media-session() {
  100. pkgdesc+=" - Session manager"
  101. depends=(pipewire libpipewire-$_ver.so)
  102. mv pms/* "$pkgdir"
  103. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  104. }
  105. package_pipewire-alsa() {
  106. pkgdesc+=" - ALSA configuration"
  107. depends=(pipewire-media-session)
  108. provides=(pulseaudio-alsa)
  109. mkdir -p "$pkgdir/etc/alsa/conf.d"
  110. ln -st "$pkgdir/etc/alsa/conf.d" \
  111. /usr/share/alsa/alsa.conf.d/{50-pipewire,99-pipewire-default}.conf
  112. install -Dm644 /dev/null \
  113. "$pkgdir/usr/share/pipewire/media-session.d/with-alsa"
  114. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  115. }
  116. package_pipewire-jack() {
  117. pkgdesc+=" - JACK support"
  118. license+=(GPL2) # libjackserver
  119. depends=(pipewire-media-session libpipewire-$_ver.so)
  120. mv jack/* "$pkgdir"
  121. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  122. }
  123. package_pipewire-pulse() {
  124. pkgdesc+=" - PulseAudio replacement"
  125. depends=(pipewire-media-session libpipewire-$_ver.so libpulse.so
  126. libavahi-{client,common}.so)
  127. provides=(pulseaudio pulseaudio-bluetooth)
  128. conflicts=(pulseaudio pulseaudio-bluetooth)
  129. mv pulse/* "$pkgdir"
  130. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  131. }
  132. package_gst-plugin-pipewire() {
  133. pkgdesc="Multimedia graph framework - pipewire plugin"
  134. depends=(pipewire-media-session libpipewire-$_ver.so gst-plugins-base-libs)
  135. mv gst/* "$pkgdir"
  136. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  137. }
  138. package_pipewire-zeroconf() {
  139. pkgdesc+=" - Zeroconf support"
  140. depends=(pipewire libpipewire-$_ver.so libavahi-{client,common}.so)
  141. mv zeroconf/* "$pkgdir"
  142. install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 pipewire/COPYING
  143. }
  144. # vim:set sw=2 et: