aboutsummaryrefslogtreecommitdiffstats
path: root/community/pulseaudio/APKBUILD
blob: 686ccacda45a875e6382cfe1a10120843317a0d0 (plain) (blame)
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
232
233
234
235
236
237
238
239
240
# 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: Leo <thinkabit.ukim@gmail.com>
pkgname=pulseaudio
pkgver=14.0
pkgrel=0
pkgdesc="featureful, general-purpose sound server"
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
	speexdsp-dev
	eudev-dev
	libcap-dev
	bluez-dev
	check-dev
	libtool
	perl
	perl-xml-parser
	m4
	"
depends_openrc="alsa-utils-openrc"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-bluez
	libpulse:_libpulse
	libpulse-mainloop-glib:_libpulse_mainloop_glib
	$pkgname-alsa
	$pkgname-utils
	$pkgname-jack
	$pkgname-zeroconf
	$pkgname-openrc
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-lang
	$pkgname-equalizer
	"
install="pulseaudio.post-install"
source="https://freedesktop.org/software/pulseaudio/releases/pulseaudio-$pkgver.tar.xz
	link-libintl.patch
	$pkgname.initd
	$pkgname.confd
	"

case "$CARCH" in
	x86|ppc64le)
		options="$options !check" # once-test fails, all others pass
		;;
	s390x|mips*)
		options="$options !check" # mix-test fails, all others pass
		;;
esac

build() {
	# -Dgstreamer=disabled because the GStreamer RTP protocol implementation is
	# cosnidered experimental by upstream.
	# See: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/14.0/
	abuild-meson \
		-Dgcov=false \
		-Dman=true \
		-Dtests=true \
		-Dsystem_user=pulse \
		-Dsystem_group=pulse \
		-Ddatabase=tdb \
		-Dalsa=enabled \
		-Dasyncns=enabled \
		-Davahi=enabled \
		-Dbluez5=true \
		-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=disabled \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -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 -e '/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 -e 's|/usr/bin/pactl load-module module-x11-cork-request|#&|' \
		-i "$pkgdir"/usr/bin/start-pulseaudio-x11

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

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

_libpulse() {
	replaces="$pkgname-libs"
	pkgdesc="Pulseaudio libraries"
	mkdir -p "$subpkgdir"/usr/lib \
		"$subpkgdir"/etc/pulse
	mv "$pkgdir"/usr/lib/pulseaudio \
		"$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/libpulse.so.0* \
		"$pkgdir"/usr/lib/libpulse-simple.so.0* \
		"$subpkgdir"/usr/lib/
	mv "$pkgdir"/etc/pulse/client.conf \
		"$subpkgdir"/etc/pulse/
}

_libpulse_mainloop_glib() {
	pkgdesc="Pulseaudio mainloop-glib library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpulse-mainloop-glib.so.* "$subpkgdir"/usr/lib
}

bluez() {
	pkgdesc="Pulseaudio bluetooth support"
	install_if="$pkgname bluez"
	mkdir -p "$subpkgdir"/usr/lib/pulse-$pkgver/modules
	mv "$pkgdir"/usr/lib/pulse-$pkgver/modules/*bluez*.so \
		"$pkgdir"/usr/lib/pulse-$pkgver/modules/*bluetooth*.so \
		"$subpkgdir"/usr/lib/pulse-$pkgver/modules/
}

alsa() {
	pkgdesc="Pulseaudio alsa support"
	install_if="$pkgname alsa-lib"
	mkdir -p "$subpkgdir"/usr/lib/pulse-$pkgver/modules
	mv "$pkgdir"/usr/lib/pulse-$pkgver/modules/*alsa*.so \
		"$subpkgdir"/usr/lib/pulse-$pkgver/modules/
}

utils() {
	pkgdesc="Pulseaudio utilities"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/pa* \
		"$subpkgdir"/usr/bin/
}

jack() {
	pkgdesc="Pulseaudio jack support"
	mkdir -p "$subpkgdir"/usr/lib/pulse-$pkgver/modules
	mv "$pkgdir"/usr/lib/pulse-$pkgver/modules/*jack*.so \
		"$subpkgdir"/usr/lib/pulse-$pkgver/modules/
}

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

	mkdir -p "$subpkgdir"/usr/lib/pulse-$pkgver/modules
	mv "$pkgdir"/usr/lib/pulse-$pkgver/modules/*avahi*.so \
		"$pkgdir"/usr/lib/pulse-$pkgver/modules/*zeroconf*.so \
		"$pkgdir"/usr/lib/pulse-$pkgver/modules/*raop*.so \
		"$subpkgdir"/usr/lib/pulse-$pkgver/modules/
}

bashcomp() {
	depends=""
	pkgdesc="Bash completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
	install -dm755 "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"
	install -dm755 "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/zsh "$subpkgdir"/usr/share
}

equalizer() {
	pkgdesc="Equalizer for $pkgname"
	depends="pulseaudio=$pkgver-r$pkgrel py3-qt5 py3-dbus"
	mkdir -p "$subpkgdir"/usr/lib/pulse-$pkgver/modules "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/lib/pulse-$pkgver/modules/module-equalizer-sink.so \
		"$subpkgdir"/usr/lib/pulse-$pkgver/modules/
	mv "$pkgdir"/usr/bin/qpaeq \
		"$subpkgdir"/usr/bin/
}

sha512sums="0c89806c00d2719cb981b2f8883bedd9bf63b16f0347d8591b8b33cc1f8c1d7864d4bcc80016308d1cede5eff2c7d5eb90a340c004047235463c7a6d1c6ec65f  pulseaudio-14.0.tar.xz
2c31c5bc592e748248215f8f62f85687cfec230b05f65441e6dafa5fa77d4967e97636209b2011a4501ed1337ecd880b264baa175586fc85183a980846cb8146  link-libintl.patch
34fe54ece5df60ce63a7955cd828a2716670fef71f40960698ae5518fdaf9cd599f4d8f8852e2c88d715600a9ad06a38984415e5eb320071012e5eb6e5c1b8b1  pulseaudio.initd
75b54581591519d63a3362b155c0f9b0501a60763ab394693a456c44d0216138cf3a40bdd0f7442028663bc045e9ffee286f8f8eaf2ee3bb17379b43615fee0e  pulseaudio.confd"