1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2017 Gentoo Foundation
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=6
|
5 |
5 |
|
6 |
|
inherit cmake-multilib multiprocessing
|
|
6 |
inherit multilib cmake-multilib git-r3
|
7 |
7 |
|
8 |
8 |
DESCRIPTION="PulseAudio emulation for ALSA"
|
9 |
9 |
HOMEPAGE="https://github.com/i-rinat/apulse"
|
10 |
|
SRC_URI="https://github.com/i-rinat/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
10 |
|
|
11 |
EGIT_REPO_URI="https://github.com/i-rinat/apulse.git"
|
11 |
12 |
|
12 |
13 |
LICENSE="MIT LGPL-2.1"
|
13 |
14 |
SLOT="0"
|
14 |
|
KEYWORDS="amd64 ~ppc64 x86"
|
15 |
|
|
16 |
|
IUSE="debug sdk test"
|
17 |
|
RESTRICT="!test? ( test )"
|
|
15 |
KEYWORDS=""
|
18 |
16 |
|
19 |
17 |
DEPEND="dev-libs/glib:2[${MULTILIB_USEDEP}]
|
20 |
|
media-libs/alsa-lib[${MULTILIB_USEDEP}]
|
21 |
|
sdk? ( !media-libs/libpulse !media-sound/pulseaudio ) "
|
22 |
|
RDEPEND="${DEPEND}
|
23 |
|
!media-plugins/alsa-plugins[pulseaudio]"
|
24 |
|
|
25 |
|
PATCHES=(
|
26 |
|
"${FILESDIR}/sdk.patch"
|
27 |
|
"${FILESDIR}/check-key-before-remove.patch"
|
28 |
|
"${FILESDIR}/man.patch"
|
29 |
|
)
|
|
18 |
media-libs/alsa-lib[${MULTILIB_USEDEP}]"
|
|
19 |
RDEPEND="${DEPEND}"
|
|
20 |
|
|
21 |
MULTILIB_CHOST_TOOLS=( /usr/bin/apulse )
|
30 |
22 |
|
31 |
23 |
src_prepare() {
|
32 |
|
cmake_src_prepare
|
|
24 |
cmake-utils_src_prepare
|
33 |
25 |
|
34 |
|
if ! use sdk; then
|
35 |
|
# Ensure all relevant libdirs are added, to support all ABIs
|
36 |
|
DIRS=
|
37 |
|
_add_dir() { DIRS="${EPREFIX}/usr/$(get_libdir)/apulse${DIRS:+:${DIRS}}"; }
|
38 |
|
multilib_foreach_abi _add_dir
|
39 |
|
sed -e "s#@@DIRS@@#${DIRS}#g" "${FILESDIR}"/apulse > "${T}"/apulse || die
|
40 |
|
fi
|
|
26 |
# Ensure all relevant libdirs are added, to support all ABIs
|
|
27 |
DIRS=
|
|
28 |
_add_dir() { DIRS="${EPREFIX}/usr/$(get_libdir)/apulse${DIRS:+:${DIRS}}"; }
|
|
29 |
multilib_foreach_abi _add_dir
|
|
30 |
sed -e "s#@@DIRS@@#${DIRS}#g" "${FILESDIR}"/apulse > "${T}"/apulse || die
|
41 |
31 |
}
|
42 |
32 |
|
43 |
33 |
multilib_src_configure() {
|
44 |
|
local mycmakeargs=(
|
45 |
|
"-DINSTALL_SDK=$(usex sdk)"
|
46 |
|
"-DLOG_TO_STDERR=$(usex debug)"
|
47 |
|
"-DWITH_TRACE=$(usex debug)"
|
48 |
|
)
|
49 |
|
cmake_src_configure
|
50 |
|
}
|
51 |
|
|
52 |
|
multilib_src_test() {
|
53 |
|
_test() {
|
54 |
|
pushd tests || die
|
55 |
|
cmake -S "${S}/tests" -B . || die
|
56 |
|
emake test_ringbuffer
|
57 |
|
ctest -j "$(makeopts_jobs "${MAKEOPTS}" 999)" \
|
58 |
|
--test-load "$(makeopts_loadavg)" || die
|
59 |
|
popd || die
|
60 |
|
}
|
61 |
|
multilib_foreach_abi _test
|
|
34 |
local mycmakeargs=("-DAPULSEPATH=${EPREFIX}/usr/$(get_libdir)/apulse")
|
|
35 |
cmake-utils_src_configure
|
62 |
36 |
}
|
63 |
37 |
|
64 |
38 |
multilib_src_install_all() {
|
65 |
|
if ! use sdk; then
|
66 |
|
_install_wrapper() { newbin "${BUILD_DIR}/apulse" "${CHOST}-apulse"; }
|
67 |
|
multilib_foreach_abi _install_wrapper
|
68 |
|
dobin "${T}/apulse"
|
69 |
|
fi
|
|
39 |
cmake-utils_src_install
|
70 |
40 |
einstalldocs
|
|
41 |
dobin "${T}"/apulse
|
71 |
42 |
}
|