mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 18:17:14 +08:00
133 lines
4.6 KiB
Bash
133 lines
4.6 KiB
Bash
# Maintainer: AlmAck
|
|
# Note: remember to build lib32 counterpart when bumping pkgver
|
|
|
|
pkgbase=pulseaudio
|
|
pkgname=(pulseaudio libpulse)
|
|
pkgdesc="A featureful, general-purpose sound server"
|
|
pkgver=6.0
|
|
pkgrel=1
|
|
arch=('x86_64')
|
|
url="http://www.freedesktop.org/wiki/Software/PulseAudio"
|
|
license=(GPL LGPL)
|
|
makedepends=(libasyncns libcap attr libxtst libsm libtool rtkit
|
|
speex tdb systemd dbus avahi bluez-libs bluez intltool jack sbc
|
|
lirc-utils openssl fftw orc json-c webrtc-audio-processing)
|
|
options=(!emptydirs)
|
|
source=("http://freedesktop.org/software/$pkgbase/releases/$pkgbase-$pkgver.tar.xz")
|
|
md5sums=('b691e83b7434c678dffacfa3a027750e')
|
|
|
|
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-rpath \
|
|
--disable-default-build-tests \
|
|
--disable-bluez5-ofono-headset \
|
|
--enable-bluez5-native-headset \
|
|
--disable-bluez4 \
|
|
--disable-oss-output \
|
|
--disable-oss-wrapper \
|
|
|
|
# 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 speex tdb systemd fftw orc
|
|
libsamplerate webrtc-audio-processing sbc)
|
|
optdepends=('pulseaudio-alsa: ALSA configuration (recommended)'
|
|
'avahi: zeroconf support'
|
|
'bluez: bluetooth support'
|
|
'bluez-libs: bluetooth headset support'
|
|
'jack: jack support'
|
|
'lirc-utils: infra-red support'
|
|
'openssl: RAOP support'
|
|
'python2-pyqt4: Equalizer GUI (qpaeq)')
|
|
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
|
|
|
|
|
|
# Disable cork-request module, can result in e.g. media players unpausing
|
|
# when there's a Skype call incoming
|
|
# https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1004607
|
|
sed -e 's|/usr/bin/pactl load-module module-x11-cork-request|#&|' \
|
|
-i "$pkgdir/usr/bin/start-pulseaudio-x11"
|
|
|
|
# PulseAudio is started automatically with autosawn=yes (default value)
|
|
sed -e 's|/usr/bin/pulseaudio --start "$@"|#&|' \
|
|
-i "$pkgdir/usr/bin/start-pulseaudio-x11"
|
|
|
|
# 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"
|
|
# Unbind main volume control to per application setting
|
|
sed -e 's|; flat-volumes = yes|flat-volumes = no|' -i "$pkgdir/etc/pulse/daemon.conf"
|
|
|
|
#### default.pa ####
|
|
# Delay of sound notification workaround, needs to be removed once fixed in systemd
|
|
#sed -e 's/load-module module-udev-detect/load-module module-udev-detect tsched=0/' \
|
|
# -i "${pkgdir}/etc/pulse/default.pa"z
|
|
|
|
# Used only for SystemWide no needed for us
|
|
# http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/
|
|
rm "$pkgdir/etc/dbus-1/system.d/pulseaudio-system.conf"
|
|
|
|
### Split libpulse
|
|
|
|
mkdir -p "$srcdir"/libpulse/{etc/pulse,usr/{bin,lib/pulseaudio,share/man/man{1,5}}}
|
|
|
|
mv {"$pkgdir","$srcdir/libpulse"}/etc/pulse/client.conf
|
|
|
|
mv "$pkgdir"/usr/bin/pa{cat,ctl,mon,play,rec,record} \
|
|
"$srcdir/libpulse/usr/bin"
|
|
|
|
mv "$pkgdir"/usr/lib/libpulse{,-simple,-mainloop-glib}.so* \
|
|
"$srcdir/libpulse/usr/lib"
|
|
|
|
mv "$pkgdir"/usr/lib/pulseaudio/libpulsecommon-*.so \
|
|
"$srcdir/libpulse/usr/lib/pulseaudio"
|
|
|
|
mv {"$pkgdir","$srcdir/libpulse"}/usr/lib/cmake
|
|
mv {"$pkgdir","$srcdir/libpulse"}/usr/lib/pkgconfig
|
|
|
|
mv {"$pkgdir","$srcdir/libpulse"}/usr/include
|
|
|
|
mv "$pkgdir"/usr/share/man/man1/pa{cat,ctl,play}.1 \
|
|
"$srcdir/libpulse/usr/share/man/man1"
|
|
|
|
mv {"$pkgdir","$srcdir/libpulse"}/usr/share/man/man5/pulse-client.conf.5
|
|
mv {"$pkgdir","$srcdir/libpulse"}/usr/share/vala
|
|
}
|
|
|
|
package_libpulse() {
|
|
pkgdesc="$pkgdesc (client library)"
|
|
depends=(dbus libasyncns libcap libxtst libsm libsndfile json-c)
|
|
optdepends=('alsa-plugins: ALSA support'
|
|
'avahi: zeroconf support')
|
|
backup=(etc/pulse/client.conf)
|
|
|
|
mv "$srcdir"/libpulse/* "$pkgdir"
|
|
}
|