196 lines
5.2 KiB
Bash
196 lines
5.2 KiB
Bash
# Copyright 1999-2019 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=6
|
|
inherit autotools bash-completion-r1 flag-o-matic gnome2-utils linux-info systemd user udev multilib-minimal
|
|
|
|
DESCRIPTION="A networked sound server with an advanced plugin system"
|
|
HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
|
|
SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${P}.tar.xz"
|
|
|
|
LICENSE="LGPL-2.1"
|
|
|
|
SLOT="0"
|
|
KEYWORDS="alpha amd64 ~arm arm64 ~hppa ~ia64 ppc ppc64 ~sh sparc x86 ~amd64-linux ~x86-linux"
|
|
|
|
# +alsa-plugin as discussed in bug #519530
|
|
IUSE="+caps +glib headers-only ipv6 libressl cpu_flags_arm_neon selinux ssl"
|
|
|
|
# libpcre needed in some cases, bug #472228
|
|
CDEPEND="
|
|
|| (
|
|
elibc_glibc? ( virtual/libc )
|
|
elibc_uclibc? ( virtual/libc )
|
|
dev-libs/libpcre
|
|
)
|
|
>=media-libs/libsndfile-1.0.20[${MULTILIB_USEDEP}]
|
|
caps? ( >=sys-libs/libcap-2.22-r2[${MULTILIB_USEDEP}] )
|
|
glib? ( >=dev-libs/glib-2.26.0:2[${MULTILIB_USEDEP}] )
|
|
ssl? (
|
|
!libressl? ( dev-libs/openssl:0= )
|
|
libressl? ( dev-libs/libressl:= )
|
|
)
|
|
dev-libs/libltdl:0
|
|
selinux? ( sec-policy/selinux-pulseaudio )
|
|
" # libltdl is a valid RDEPEND, libltdl.so is used for native abi in pulsecore and daemon
|
|
|
|
RDEPEND="${CDEPEND}
|
|
"
|
|
|
|
DEPEND="${RDEPEND}
|
|
sys-devel/m4
|
|
dev-libs/libatomic_ops
|
|
virtual/pkgconfig
|
|
>=sys-devel/gettext-0.19.3
|
|
"
|
|
|
|
PATCHES=(
|
|
"${FILESDIR}"/pulseaudio-11.1-disable-flat-volumes.patch # bug 627894
|
|
)
|
|
|
|
pkg_pretend() {
|
|
CONFIG_CHECK="~HIGH_RES_TIMERS"
|
|
WARNING_HIGH_RES_TIMERS="CONFIG_HIGH_RES_TIMERS:\tis not set (required for enabling timer-based scheduling in pulseaudio)\n"
|
|
check_extra_config
|
|
|
|
if linux_config_exists; then
|
|
local snd_hda_prealloc_size=$(linux_chkconfig_string SND_HDA_PREALLOC_SIZE)
|
|
if [ -n "${snd_hda_prealloc_size}" ] && [ "${snd_hda_prealloc_size}" -lt 2048 ]; then
|
|
ewarn "A preallocated buffer-size of 2048 (kB) or higher is recommended for the HD-audio driver!"
|
|
ewarn "CONFIG_SND_HDA_PREALLOC_SIZE=${snd_hda_prealloc_size}"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
pkg_setup() {
|
|
linux-info_pkg_setup
|
|
gnome2_environment_reset #543364
|
|
|
|
enewgroup audio 18 # Just make sure it exists
|
|
}
|
|
|
|
src_prepare() {
|
|
default
|
|
|
|
# Skip test that cannot work with sandbox, bug #501846
|
|
sed -i -e '/lock-autospawn-test /d' src/Makefile.am || die
|
|
sed -i -e 's/lock-autospawn-test$(EXEEXT) //' src/Makefile.in || die
|
|
|
|
eautoreconf
|
|
}
|
|
|
|
multilib_src_configure() {
|
|
local myconf=(
|
|
--disable-adrian-aec
|
|
--disable-esound
|
|
--disable-gconf
|
|
--disable-solaris
|
|
--enable-largefile
|
|
--localstatedir="${EPREFIX}"/var
|
|
--with-systemduserunitdir=$(systemd_get_userunitdir)
|
|
--with-udev-rules-dir="${EPREFIX}/$(get_udevdir)"/rules.d
|
|
--disable-alsa
|
|
--disable-bluez5
|
|
--disable-gtk3
|
|
--disable-jack
|
|
--disable-samplerate
|
|
--disable-lirc
|
|
--disable-orc
|
|
--disable-oss-output
|
|
$(multilib_native_use_enable glib gsettings)
|
|
$(multilib_native_use_enable ssl openssl)
|
|
# tests involve random modules, so just do them for the native
|
|
--disable-default-build-tests
|
|
--disable-udev
|
|
--disable-webrtc-aec
|
|
--disable-avahi
|
|
--without-fftw
|
|
--without-soxr
|
|
--with-database=simple
|
|
--disable-asyncns
|
|
$(use_enable glib glib2)
|
|
$(use_enable cpu_flags_arm_neon neon-opt)
|
|
--disable-tcpwrap
|
|
--disable-dbus
|
|
--disable-x11
|
|
--disable-systemd-daemon
|
|
--disable-systemd-login
|
|
--disable-systemd-journal
|
|
$(use_enable ipv6)
|
|
$(use_with caps)
|
|
)
|
|
|
|
if ! multilib_is_native_abi; then
|
|
myconf+=(
|
|
# hack around unnecessary checks
|
|
# (results don't matter, we're not building anything using it)
|
|
ac_cv_lib_ltdl_lt_dladvise_init=yes
|
|
LIBSPEEX_CFLAGS=' '
|
|
LIBSPEEX_LIBS=' '
|
|
)
|
|
else
|
|
# Make padsp work for non-native ABI, supposedly only possible with glibc; this is used by /usr/bin/padsp that comes from native build, thus we need this argument for native build
|
|
if use elibc_glibc ; then
|
|
myconf+=( --with-pulsedsp-location="${EPREFIX}"'/usr/\\$$LIB/pulseaudio' )
|
|
fi
|
|
fi
|
|
|
|
ECONF_SOURCE=${S} \
|
|
econf "${myconf[@]}"
|
|
}
|
|
|
|
multilib_src_compile() {
|
|
if multilib_is_native_abi; then
|
|
emake
|
|
else
|
|
local targets=( libpulse.la libpulsedsp.la libpulse-simple.la )
|
|
use glib && targets+=( libpulse-mainloop-glib.la )
|
|
emake -C src ${targets[*]}
|
|
fi
|
|
}
|
|
|
|
multilib_src_test() {
|
|
# We avoid running the toplevel check target because that will run
|
|
# po/'s tests too, and they are broken. Officially, it should work
|
|
# with intltool 0.41, but that doesn't look like a stable release.
|
|
if multilib_is_native_abi; then
|
|
emake -C src check
|
|
fi
|
|
}
|
|
|
|
multilib_src_install() {
|
|
if multilib_is_native_abi; then
|
|
emake -j1 DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" install
|
|
else
|
|
local targets=( libpulse.la libpulse-simple.la )
|
|
use glib && targets+=( libpulse-mainloop-glib.la )
|
|
emake DESTDIR="${D}" install-pkgconfigDATA
|
|
emake DESTDIR="${D}" -C src \
|
|
install-libLTLIBRARIES \
|
|
install-padsplibLTLIBRARIES \
|
|
lib_LTLIBRARIES="${targets[*]}" \
|
|
install-pulseincludeHEADERS
|
|
fi
|
|
}
|
|
|
|
multilib_src_install_all() {
|
|
dodoc NEWS README todo
|
|
|
|
# Create the state directory
|
|
use prefix || diropts -o pulse -g pulse -m0755
|
|
|
|
find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
|
|
|
|
if use headers-only ; then
|
|
rm -rf "${D}"/usr/bin "${D}"/usr/lib "${D}"/usr/lib64/{[a-o]*,[q-z]*,pu*} "${D}"/usr/share "${D}"/etc || die
|
|
fi
|
|
}
|
|
|
|
pkg_postinst() {
|
|
gnome2_schemas_update
|
|
}
|
|
|
|
pkg_postrm() {
|
|
gnome2_schemas_update
|
|
}
|