summaryrefslogtreecommitdiff
path: root/community/pulseaudio/APKBUILD
blob: 11042b0de7a8ac58a81ae358243f10030b07100e (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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Pedro Filipe <xpecex@outlook.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer:
pkgname=pulseaudio
pkgver=16.1
pkgrel=10
pkgdesc="featureful, general-purpose sound server"
provider_priority=10
url="https://www.freedesktop.org/wiki/Software/PulseAudio/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	meson
	tdb-dev
	alsa-lib-dev
	libasyncns-dev
	dbus-dev
	glib-dev
	gtk+3.0-dev
	orc-dev
	orc-compiler
	libsndfile-dev
	soxr-dev
	libx11-dev
	libxcb-dev
	libice-dev
	libsm-dev
	libxtst-dev
	avahi-dev
	sbc-dev
	fftw-dev
	jack-dev
	openssl-dev>3
	speexdsp-dev
	eudev-dev
	libcap-dev
	bluez-dev
	check-dev
	libtool
	perl
	perl-xml-parser
	m4
	gstreamer-dev
	gst-plugins-base-dev
	"
depends_openrc="alsa-utils alsa-utils-openrc"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-bluez
	libpulse-mainloop-glib:_libpulse_mainloop_glib
	$pkgname-alsa
	$pkgname-utils
	$pkgname-jack
	$pkgname-zeroconf
	$pkgname-openrc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-lang
	$pkgname-equalizer
	libpulse:_libpulse
	"
install="pulseaudio.post-install"
source="https://freedesktop.org/software/pulseaudio/releases/pulseaudio-$pkgver.tar.xz
	link-libintl.patch
	remove-once-test.patch
	$pkgname.initd
	$pkgname.confd
	"

case "$CARCH" in
	x86|x86_64|aarch64)
		makedepends="$makedepends webrtc-audio-processing-dev"
		_webrtc_aec="enabled"
		;;
	* )
		_webrtc_aec="disabled" # webrtc-audio-processing not available
		;;
esac

prepare() {
	default_prepare

	sed "s|sysconfdir, 'dbus-1'|datadir, 'dbus-1'|" \
		-i src/daemon/meson.build
}

build() {
	abuild-meson \
		-Db_lto=true \
		-Dgcov=false \
		-Dman=true \
		-Dtests="$(want_check && echo true || echo false)" \
		-Dsystem_user=pulse \
		-Dsystem_group=pulse \
		-Ddatabase=tdb \
		-Dalsa=enabled \
		-Dasyncns=enabled \
		-Davahi=enabled \
		-Dbluez5=enabled \
		-Ddbus=enabled \
		-Dfftw=enabled \
		-Dglib=enabled \
		-Dgsettings=enabled \
		-Dgtk=enabled \
		-Dhal-compat=false \
		-Dipv6=true \
		-Djack=enabled \
		-Dlirc=disabled \
		-Dopenssl=enabled \
		-Dorc=enabled \
		-Dsamplerate=disabled \
		-Dsoxr=enabled \
		-Dspeex=enabled \
		-Dsystemd=disabled \
		-Dudev=enabled \
		-Dx11=enabled \
		-Dudevrulesdir=/usr/lib/udev/rules.d \
		-Dgstreamer=enabled \
		-Dwebrtc-aec="$_webrtc_aec" \
		-Ddoxygen=false \
		-Dstream-restore-clear-old-devices=true \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	XDG_RUNTIME_DIR="$(mktemp -d)" \
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname

	# 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 '/flat-volumes/iflat-volumes = no' -i "$pkgdir"/etc/pulse/daemon.conf

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

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

openrc() {
	replaces="$pkgname-system" # Backward compatibility
	default_openrc
}

_libpulse() {
	pkgdesc="Pulseaudio libraries"
	replaces="$pkgname-libs"

	amove usr/lib/pulseaudio/libpulse*
	amove usr/lib/libpulse.so.0*
	amove usr/lib/libpulse-simple.so.0*
	amove etc/pulse/client.conf
}

_libpulse_mainloop_glib() {
	pkgdesc="Pulseaudio mainloop-glib library"

	amove usr/lib/libpulse-mainloop-glib.so.*
}

bluez() {
	pkgdesc="Pulseaudio Bluetooth support"
	install_if="$pkgname=$pkgver-r$pkgrel bluez"
	provider_priority=10  # highest (other provider is pipewire-pulse)

	amove usr/lib/pulseaudio/modules/*bluez*.so
	amove usr/lib/pulseaudio/modules/*bluetooth*.so
}

alsa() {
	pkgdesc="Pulseaudio ALSA support"
	install_if="$pkgname=$pkgver-r$pkgrel alsa-lib"

	amove usr/lib/pulseaudio/modules/*alsa*.so
}

utils() {
	pkgdesc="Pulseaudio utilities"

	amove usr/bin/pa*
	amove usr/bin/start-pulseaudio-x11
}

jack() {
	pkgdesc="Pulseaudio JACK support"

	amove usr/lib/pulseaudio/modules/*jack*.so
}

zeroconf() {
	pkgdesc="Pulseaudio Zeroconf support"
	depends="avahi"

	amove usr/lib/pulseaudio/modules/*avahi*.so
	amove usr/lib/pulseaudio/modules/*zeroconf*.so
	amove usr/lib/pulseaudio/modules/*raop*.so
}

equalizer() {
	pkgdesc="Equalizer for $pkgname"
	depends="pulseaudio=$pkgver-r$pkgrel py3-qt5 py3-dbus"

	amove usr/bin/qpaeq
	amove usr/lib/pulseaudio/modules/module-equalizer-sink.so
}

sha512sums="
33b0b4292f05e0882f3ec822cf5720414bb34c523d80fe287b9740d6be219787c562e8024c9b0d9e2ee010771ca72c7ae4f27df1bbef9c9cb6bb6a23cbcc412f  pulseaudio-16.1.tar.xz
2c31c5bc592e748248215f8f62f85687cfec230b05f65441e6dafa5fa77d4967e97636209b2011a4501ed1337ecd880b264baa175586fc85183a980846cb8146  link-libintl.patch
c1223cf42538d91f31dbcb1a167537a1d3b6e8a3bf1b454cdebf95c25ca6f3b444848e9d546f092988851f71fe2c9dd9c4a781a58795e2f57d98563963a4630a  remove-once-test.patch
d3a95453361d4b12e2d4df73a72bbdc9343e2a46e8f5f3aac07b3cb1f9e016fd89816745f485468d144911900a2b38741a371f91cf08285c4b4988e4403d91a0  pulseaudio.initd
75b54581591519d63a3362b155c0f9b0501a60763ab394693a456c44d0216138cf3a40bdd0f7442028663bc045e9ffee286f8f8eaf2ee3bb17379b43615fee0e  pulseaudio.confd
"