mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 17:57:13 +08:00
140 lines
4.4 KiB
Bash
140 lines
4.4 KiB
Bash
# Note: remember to build lib32 counterpart when bumping pkgver
|
|
|
|
pkgbase=pulseaudio
|
|
pkgname=(pulseaudio libpulse)
|
|
pkgdesc="A featureful, general-purpose sound server"
|
|
pkgver=9.0
|
|
pkgrel=1
|
|
arch=('x86_64')
|
|
url="http://www.freedesktop.org/wiki/Software/PulseAudio"
|
|
license=(LGPL)
|
|
makedepends=(libasyncns libcap attr libxtst libsm libsndfile libtool rtkit libsoxr
|
|
speexdsp tdb systemd dbus avahi bluez bluez-libs intltool jack2-dbus sbc
|
|
lirc openssl xenstore fftw orc json-c webrtc-audio-processing
|
|
check)
|
|
options=(!emptydirs)
|
|
source=(http://freedesktop.org/software/$pkgbase/releases/$pkgbase-$pkgver.tar.xz
|
|
padsp-lib32.patch)
|
|
sha256sums=('c3d3d66b827f18fbe903fe3df647013f09fc1e2191c035be1ee2d82a9e404686'
|
|
'7832fc59df76538ff10aedd297c03cb7ff117235da8bfad26082994bb5b84332')
|
|
|
|
prepare() {
|
|
cd $pkgbase-$pkgver
|
|
}
|
|
|
|
build() {
|
|
cd $pkgbase-$pkgver
|
|
|
|
./configure --prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--libexecdir=/usr/lib \
|
|
--localstatedir=/var \
|
|
--with-udev-rules-dir=/usr/lib/udev/rules.d \
|
|
--with-database=tdb \
|
|
--disable-tcpwrap \
|
|
--disable-bluez4 \
|
|
--disable-samplerate \
|
|
--disable-rpath \
|
|
--disable-default-build-tests \
|
|
DATADIRNAME=share
|
|
|
|
# fight unused direct deps
|
|
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
|
|
|
|
make
|
|
}
|
|
|
|
package_pulseaudio() {
|
|
depends=("libpulse=$pkgver-$pkgrel" rtkit libltdl speexdsp tdb orc
|
|
webrtc-audio-processing sbc libsoxr)
|
|
optdepends=('pulseaudio-alsa: ALSA configuration (recommended)'
|
|
'avahi: Zeroconf support for PulseAudio'
|
|
'openssl: Zeroconf support for PulseAudio'
|
|
'lirc: IR (lirc) support for PulseAudio'
|
|
'xenstore: Xen support for PulseAudio'
|
|
'jack2: Jack support for PulseAudio'
|
|
'bluez: Bluetooth support for PulseAudio'
|
|
'bluez-libs: Bluetooth support for PulseAudio'
|
|
'python3-pyqt4: Equalizer for PulseAudio'
|
|
'fftw: Equalizer for PulseAudio'
|
|
'gconf: GConf support for PulseAudio')
|
|
backup=(etc/pulse/{daemon.conf,default.pa,system.pa})
|
|
install=pulseaudio.install
|
|
|
|
cd $pkgbase-$pkgver
|
|
make -j1 DESTDIR="$pkgdir" install \
|
|
bashcompletiondir=/usr/share/bash-completion/completions
|
|
|
|
cd "$pkgdir"
|
|
patch -Np1 -i "$srcdir/padsp-lib32.patch"
|
|
|
|
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
|
|
|
|
rm etc/dbus-1/system.d/pulseaudio-system.conf
|
|
|
|
mkdir usr/lib/systemd/user/sockets.target.wants
|
|
ln -s ../pulseaudio.socket \
|
|
usr/lib/systemd/user/sockets.target.wants/pulseaudio.socket
|
|
|
|
# Avoid kde to show the "remove unused sound devices" if bell sound is executed by an application
|
|
sed -e '27i\ /usr/bin/pactl load-module module-x11-bell "display=$DISPLAY" "sample=bell.ogg" > /dev/null' \
|
|
-i "$pkgdir/usr/bin/start-pulseaudio-x11"
|
|
|
|
# Python fix
|
|
sed -i '1s:python$:&2:' "$pkgdir/usr/bin/qpaeq"
|
|
|
|
#### daemon.conf ####
|
|
# Speed up pulseaudio shutdown
|
|
# Lower resample quality, saves CPU
|
|
sed -e '/exit-idle-time/iexit-idle-time=0' \
|
|
-e '/resample-method/iresample-method=speex-float-1' \
|
|
-i "$pkgdir/etc/pulse/daemon.conf"
|
|
|
|
### Split libpulse
|
|
|
|
mkdir -p "$srcdir"/libpulse/{etc/pulse,usr/{bin,lib/pulseaudio,share/man/man{1,5}}}
|
|
|
|
mv etc/pulse/client.conf \
|
|
"$srcdir/libpulse/etc/pulse"
|
|
|
|
mv usr/bin/pa{cat,ctl,dsp,mon,play,rec,record} \
|
|
"$srcdir/libpulse/usr/bin"
|
|
|
|
mv usr/lib/libpulse{,-simple,-mainloop-glib}.so* \
|
|
usr/lib/{cmake,pkgconfig} \
|
|
"$srcdir/libpulse/usr/lib"
|
|
|
|
mv usr/lib/pulseaudio/libpulse{dsp,common-*}.so \
|
|
"$srcdir/libpulse/usr/lib/pulseaudio"
|
|
|
|
mv usr/include \
|
|
"$srcdir/libpulse/usr"
|
|
|
|
mv usr/share/man/man1/pa{cat,ctl,dsp,mon,play,rec,record}.1 \
|
|
"$srcdir/libpulse/usr/share/man/man1"
|
|
|
|
mv usr/share/man/man5/pulse-client.conf.5 \
|
|
"$srcdir/libpulse/usr/share/man/man5"
|
|
|
|
mv usr/share/vala \
|
|
"$srcdir/libpulse/usr/share"
|
|
}
|
|
|
|
package_libpulse() {
|
|
pkgdesc="$pkgdesc (client library)"
|
|
depends=(dbus libasyncns libcap libxtst libsm libsndfile json-c systemd)
|
|
backup=(etc/pulse/client.conf)
|
|
|
|
mv "$srcdir"/libpulse/* "$pkgdir"
|
|
}
|