PKGBUILD 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. # Maintainer (Arch): Jan Alexander Steffens (heftig) <heftig@archlinux.org>
  3. pkgbase=pulseaudio
  4. pkgname=(pulseaudio libpulse pulseaudio-{zeroconf,lirc,jack,bluetooth,equalizer,rtp})
  5. pkgdesc="A featureful, general-purpose sound server"
  6. pkgver=14.2
  7. pkgrel=2
  8. pkgrel+=.nonsystemd1
  9. arch=(x86_64)
  10. arch+=(i686 armv7h)
  11. url="https://www.freedesktop.org/wiki/Software/PulseAudio/"
  12. license=(GPL)
  13. makedepends=(libasyncns libcap attr libxtst libsm libsndfile rtkit libsoxr
  14. speexdsp tdb elogind dbus avahi bluez bluez-libs jack2 sbc
  15. lirc openssl fftw orc gtk3 webrtc-audio-processing check git meson
  16. xmltoman)
  17. _commit=6a487c5244563f49a025088de3510c80824fc99e # tags/v14.2^0
  18. source=("git+https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git#commit=$_commit"
  19. "meson-elogind-support.patch")
  20. sha256sums=('SKIP'
  21. 'fea0e09a9f026bc3c9160b53018b8e1dd1f3493c60f68405a758de7d3cb592cf')
  22. pkgver() {
  23. cd pulseaudio
  24. git describe --tags | sed 's/^v//;s/-/+/g'
  25. }
  26. prepare() {
  27. cd pulseaudio
  28. # Freeze version before patching
  29. patch -Np 1 -i ../meson-elogind-support.patch
  30. ./git-version-gen doesnt-exist >.tarball-version
  31. }
  32. build() {
  33. arch-meson pulseaudio build \
  34. -D pulsedsp-location='/usr/\$LIB/pulseaudio' \
  35. -D stream-restore-clear-old-devices=true \
  36. -D udevrulesdir=/usr/lib/udev/rules.d \
  37. -D systemd=disabled \
  38. -D elogind=enabled
  39. meson compile -C build
  40. }
  41. check() {
  42. meson test -C build --print-errorlogs
  43. ninja -C build test-daemon
  44. }
  45. _pick() {
  46. local p="$1" f d; shift
  47. for f; do
  48. d="$srcdir/$p/${f#$pkgdir/}"
  49. mkdir -p "$(dirname "$d")"
  50. mv "$f" "$d"
  51. rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  52. done
  53. }
  54. package_pulseaudio() {
  55. depends=("libpulse=$pkgver-$pkgrel" rtkit libltdl speexdsp tdb orc libsoxr
  56. webrtc-audio-processing libxtst)
  57. optdepends=('pulseaudio-alsa: ALSA configuration (recommended)'
  58. 'pulseaudio-zeroconf: Zeroconf support'
  59. 'pulseaudio-lirc: IR (lirc) support'
  60. 'pulseaudio-jack: Jack support'
  61. 'pulseaudio-bluetooth: Bluetooth support'
  62. 'pulseaudio-equalizer: Graphical equalizer'
  63. 'pulseaudio-rtp: RTP and RAOP support')
  64. backup=(etc/pulse/{daemon.conf,default.pa,system.pa})
  65. replaces=('pulseaudio-xen<=9.0' 'pulseaudio-gconf<=11.1')
  66. local pulsever=$(cd pulseaudio; ./git-version-gen .tarball-version)
  67. while [[ $pulsever = *.*.* ]]; do
  68. pulsever=${pulsever%.*}
  69. done
  70. pulsever=${pulsever%%-*}
  71. DESTDIR="$pkgdir" meson install -C build
  72. cd "$pkgdir"
  73. # Superseded by socket activation
  74. sed -e '/autospawn/iautospawn = yes' \
  75. -i etc/pulse/client.conf
  76. # Disable cork-request module, can result in e.g. media players unpausing
  77. # when there's a Skype call incoming
  78. sed -e 's|/usr/bin/pactl load-module module-x11-cork-request|#&|' \
  79. -i usr/bin/start-pulseaudio-x11
  80. # Required by qpaeq
  81. sed -e '/Load several protocols/aload-module module-dbus-protocol' \
  82. -i etc/pulse/default.pa
  83. rm -r etc/dbus-1
  84. # Split packages
  85. _pick libpulse etc/pulse/client.conf
  86. _pick libpulse usr/bin/pa{cat,ctl,dsp,mon,play,rec,record}
  87. _pick libpulse usr/lib/libpulse{,-simple,-mainloop-glib}.so*
  88. _pick libpulse usr/lib/{cmake,pkgconfig}
  89. _pick libpulse usr/lib/pulseaudio/libpulse{dsp,common-*}.so
  90. _pick libpulse usr/include
  91. _pick libpulse usr/share/man/man1/pa{cat,ctl,dsp,mon,play,rec,record}.1
  92. _pick libpulse usr/share/man/man5/pulse-client.conf.5
  93. _pick libpulse usr/share/vala
  94. local moddir=usr/lib/pulse-$pulsever/modules
  95. _pick zeroconf $moddir/libavahi-wrap.so
  96. _pick zeroconf $moddir/module-zeroconf-{publish,discover}.so
  97. _pick zeroconf $moddir/module-raop-discover.so
  98. _pick lirc $moddir/module-lirc.so
  99. _pick jack $moddir/module-jack-{sink,source}.so
  100. _pick jack $moddir/module-jackdbus-detect.so
  101. _pick bluetooth $moddir/libbluez5-util.so
  102. _pick bluetooth $moddir/module-bluetooth-{discover,policy}.so
  103. _pick bluetooth $moddir/module-bluez5-{discover,device}.so
  104. _pick equalizer $moddir/module-equalizer-sink.so
  105. _pick equalizer usr/bin/qpaeq
  106. _pick rtp $moddir/lib{rtp,raop}.so
  107. _pick rtp $moddir/module-rtp-{send,recv}.so
  108. _pick rtp $moddir/module-raop-sink.so
  109. }
  110. package_libpulse() {
  111. pkgdesc="$pkgdesc (client library)"
  112. depends=(dbus libasyncns libcap libxcb libsm libsndfile elogind)
  113. optdepends=('glib2: mainloop integration')
  114. provides=(libpulse{,-simple,-mainloop-glib}.so)
  115. license=(LGPL)
  116. backup=(etc/pulse/client.conf)
  117. mv libpulse/* "$pkgdir"
  118. }
  119. package_pulseaudio-zeroconf() {
  120. pkgdesc="Zeroconf support for PulseAudio"
  121. depends=("pulseaudio=$pkgver-$pkgrel" avahi openssl)
  122. mv zeroconf/* "$pkgdir"
  123. }
  124. package_pulseaudio-lirc() {
  125. pkgdesc="IR (lirc) support for PulseAudio"
  126. depends=("pulseaudio=$pkgver-$pkgrel" lirc)
  127. mv lirc/* "$pkgdir"
  128. }
  129. package_pulseaudio-jack() {
  130. pkgdesc="Jack support for PulseAudio"
  131. depends=("pulseaudio=$pkgver-$pkgrel" jack)
  132. mv jack/* "$pkgdir"
  133. }
  134. package_pulseaudio-bluetooth() {
  135. pkgdesc="Bluetooth support for PulseAudio"
  136. depends=("pulseaudio=$pkgver-$pkgrel" bluez bluez-libs sbc)
  137. mv bluetooth/* "$pkgdir"
  138. }
  139. package_pulseaudio-equalizer() {
  140. pkgdesc="Graphical equalizer for PulseAudio"
  141. depends=("pulseaudio=$pkgver-$pkgrel" python-{pyqt5,dbus} fftw)
  142. mv equalizer/* "$pkgdir"
  143. }
  144. package_pulseaudio-rtp() {
  145. pkgdesc="RTP and RAOP support for PulseAudio"
  146. depends=("pulseaudio=$pkgver-$pkgrel")
  147. mv rtp/* "$pkgdir"
  148. }
  149. # vim:set sw=2 et: