summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eb59379e5e054a33c21b8e0614561bf285ca2d9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Maintainer: Mr. Tao <tao@post.cz>
# Contributtor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Corrado Primier <bardo@aur.archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=(pulseaudio-airplay libpulse-airplay pulseaudio-airplay-{zeroconf,lirc,jack,bluetooth,equalizer})
pkgdesc="A featureful, general-purpose sound server"
pkgver=13.99.1+104+gcc93eb360
pkgrel=1
arch=(x86_64)
url="https://www.freedesktop.org/wiki/Software/PulseAudio/"
license=(GPL)
makedepends=(libasyncns libcap attr libxtst libsm libsndfile rtkit libsoxr
             speexdsp tdb systemd dbus avahi bluez bluez-libs jack2 sbc
             lirc openssl fftw orc gtk3 webrtc-audio-processing check git meson
             xmltoman gst-plugins-base-libs)
_commit=cc93eb360afeafb9bc8ac72c0511894aaa647769  # tags/v13.99.1
source=("git+https://gitlab.freedesktop.org/mr-tao/pulseaudio.git#commit=$_commit"
        0001-meson-Define-TUNNEL_SINK-for-module-tunnel-sink.patch)
sha256sums=('SKIP'
            '4ff133e2847baad5bb6798b5816d67551cfba2efabb2f1f348628d7217abd07d')

pkgver() {
  cd pulseaudio
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd pulseaudio

  # Freeze version before patching
  ./git-version-gen doesnt-exist >.tarball-version

  # https://bugs.archlinux.org/task/63755
  git apply -3 ../0001-meson-Define-TUNNEL_SINK-for-module-tunnel-sink.patch
}

build() {
  arch-meson pulseaudio build \
    -D gcov=false \
    -D pulsedsp-location='/usr/\$LIB/pulseaudio' \
    -D udevrulesdir=/usr/lib/udev/rules.d
  ninja -C build
}

check() {
  meson test -C build --print-errorlogs
  ninja -C build test-daemon
}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_pulseaudio-airplay() {
  provides=(pulseaudio)
  conflicts=(pulseaudio)
  depends=("libpulse-airplay=$pkgver-$pkgrel" rtkit libltdl speexdsp tdb orc libsoxr
           webrtc-audio-processing)
  optdepends=('pulseaudio-alsa: ALSA configuration (recommended)')
  backup=(etc/pulse/{daemon.conf,default.pa,system.pa})
  install=pulseaudio.install
  replaces=('pulseaudio-xen<=9.0' 'pulseaudio-gconf<=11.1')

  local pulsever=$(cd pulseaudio; ./git-version-gen .tarball-version)
  while [[ $pulsever = *.*.* ]]; do
    pulsever=${pulsever%.*}
  done
  pulsever=${pulsever%%-*}

  DESTDIR="$pkgdir" meson install -C build

  cd "$pkgdir"

  # Assumes that any volume adjustment is intended by the user, who can control
  # each app's volume. Misbehaving clients can trigger earsplitting volume
  # jumps. App volumes can diverge wildly and cause apps without their own
  # volume control to fall below sink volume; a sink-only volume control will
  # suddenly be unable to make such an app loud enough.
  sed -e '/flat-volumes/iflat-volumes = no' \
      -i etc/pulse/daemon.conf

  # Superseded by socket activation
  sed -e '/autospawn/iautospawn = no' \
      -i etc/pulse/client.conf

  # Disable cork-request module, can result in e.g. media players unpausing
  # when there's a Skype call incoming
  sed -e 's|/usr/bin/pactl load-module module-x11-cork-request|#&|' \
      -i usr/bin/start-pulseaudio-x11

  # Required by qpaeq
  sed -e '/Load several protocols/aload-module module-dbus-protocol' \
      -i etc/pulse/default.pa

  rm -r etc/dbus-1

### Split libpulse
  _pick libpulse etc/pulse/client.conf
  _pick libpulse usr/bin/pa{cat,ctl,dsp,mon,play,rec,record}
  _pick libpulse usr/lib/libpulse{,-simple,-mainloop-glib}.so*
  _pick libpulse usr/lib/{cmake,pkgconfig}
  _pick libpulse usr/lib/pulseaudio/libpulse{dsp,common-*}.so
  _pick libpulse usr/include
  _pick libpulse usr/share/man/man1/pa{cat,ctl,dsp,mon,play,rec,record}.1
  _pick libpulse usr/share/man/man5/pulse-client.conf.5
  _pick libpulse usr/share/vala

### Split modules
  local moddir=usr/lib/pulse-$pulsever/modules

  _pick zeroconf $moddir/libavahi-wrap.so
  _pick zeroconf $moddir/module-zeroconf-{publish,discover}.so
  _pick zeroconf $moddir/module-raop-discover.so

  _pick lirc $moddir/module-lirc.so

  _pick jack $moddir/module-jack-{sink,source}.so
  _pick jack $moddir/module-jackdbus-detect.so

  _pick bluetooth $moddir/libbluez5-util.so
  _pick bluetooth $moddir/module-bluetooth-{discover,policy}.so
  _pick bluetooth $moddir/module-bluez5-{discover,device}.so

  _pick equalizer $moddir/module-equalizer-sink.so
  _pick equalizer usr/bin/qpaeq
}

package_libpulse-airplay() {
  conflicts=(libpulse)
  pkgdesc="$pkgdesc (client library)"
  depends=(dbus libasyncns libcap libxtst libsm libsndfile systemd)
  provides=(libpulse libpulse{,-simple,-mainloop-glib}.so)
  license=(LGPL)
  backup=(etc/pulse/client.conf)

  mv libpulse/* "$pkgdir"
}

package_pulseaudio-airplay-zeroconf(){
  provides=(pulseaudio-zeroconf)
  conflicts=(pulseaudio-zeroconf)
  pkgdesc="Zeroconf support for PulseAudio"
  depends=("pulseaudio-airplay=$pkgver-$pkgrel" avahi openssl)

  mv zeroconf/* "$pkgdir"
}

package_pulseaudio-airplay-lirc(){
  provides=(pulseaudio-lirc)
  conflicts=(pulseaudio-lirc)
  pkgdesc="IR (lirc) support for PulseAudio"
  depends=("pulseaudio-airplay=$pkgver-$pkgrel" lirc)

  mv lirc/* "$pkgdir"
}

package_pulseaudio-airplay-jack(){
  provides=(pulseaudio-jack)
  conflicts=(pulseaudio-jack)
  pkgdesc="Jack support for PulseAudio"
  depends=("pulseaudio-airplay=$pkgver-$pkgrel" jack)

  mv jack/* "$pkgdir"
}

package_pulseaudio-airplay-bluetooth(){
  provides=(pulseaudio-bluetooth)
  conflicts=(pulseaudio-bluetooth)
  pkgdesc="Bluetooth support for PulseAudio"
  depends=("pulseaudio-airplay=$pkgver-$pkgrel" bluez bluez-libs sbc)

  mv bluetooth/* "$pkgdir"
}

package_pulseaudio-airplay-equalizer(){
  provides=(pulseaudio-equalizer)
  conflicts=(pulseaudio-equalizer)
  pkgdesc="Equalizer for PulseAudio"
  depends=("pulseaudio-airplay=$pkgver-$pkgrel" python-{pyqt5,dbus,sip} fftw)

  mv equalizer/* "$pkgdir"
}

# vim:set sw=2 et: