]> git.draconx.ca Git - gentoo-fixes.git/blob - media-sound/apulse/apulse-0.1.13-r2.ebuild
app-emulation/wine-vanilla-4.0.4: Adapt mpg123 dependency.
[gentoo-fixes.git] / media-sound / apulse / apulse-0.1.13-r2.ebuild
1 # This is a modified version of the original ebuild from Gentoo GNU/Linux,
2 # covered by the following copyright and permission notice:
3 #
4 #   Copyright 1999-2022 Gentoo Authors
5 #   Distributed under the terms of the GNU General Public License v2
6 #
7 # The modifications include:
8 #
9 #   * Removed pointless alsa-plugins blocker (2022-04)
10
11 EAPI=7
12
13 CMAKE_ECLASS=cmake
14 inherit cmake-multilib multiprocessing
15
16 DESCRIPTION="PulseAudio emulation for ALSA"
17 HOMEPAGE="https://github.com/i-rinat/apulse"
18 SRC_URI="https://github.com/i-rinat/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
19
20 LICENSE="MIT LGPL-2.1"
21 SLOT="0"
22 KEYWORDS="amd64 ~ppc64 x86"
23
24 IUSE="debug sdk test"
25 RESTRICT="!test? ( test )"
26
27 DEPEND="dev-libs/glib:2[${MULTILIB_USEDEP}]
28         media-libs/alsa-lib[${MULTILIB_USEDEP}]
29         sdk? ( !media-libs/libpulse !media-sound/pulseaudio ) "
30 RDEPEND="${DEPEND}"
31
32 PATCHES=(
33         "${FILESDIR}/sdk.patch"
34         "${FILESDIR}/check-key-before-remove.patch"
35         "${FILESDIR}/man.patch"
36 )
37
38 src_prepare() {
39         cmake_src_prepare
40
41         if ! use sdk; then
42                 # Ensure all relevant libdirs are added, to support all ABIs
43                 DIRS=
44                 _add_dir() { DIRS="${EPREFIX}/usr/$(get_libdir)/apulse${DIRS:+:${DIRS}}"; }
45                 multilib_foreach_abi _add_dir
46                 sed -e "s#@@DIRS@@#${DIRS}#g" "${FILESDIR}"/apulse > "${T}"/apulse || die
47         fi
48 }
49
50 multilib_src_configure() {
51         local mycmakeargs=(
52                 "-DINSTALL_SDK=$(usex sdk)"
53                 "-DLOG_TO_STDERR=$(usex debug)"
54                 "-DWITH_TRACE=$(usex debug)"
55         )
56         cmake_src_configure
57 }
58
59 multilib_src_test() {
60         _test() {
61                 pushd tests || die
62                 cmake -S "${S}/tests" -B . || die
63                 emake test_ringbuffer
64                 ctest -j "$(makeopts_jobs)" --test-load "$(makeopts_loadavg)" || die
65                 popd || die
66         }
67         multilib_foreach_abi _test
68 }
69
70 multilib_src_install_all() {
71         if ! use sdk; then
72                 _install_wrapper() { newbin "${BUILD_DIR}/apulse" "${CHOST}-apulse"; }
73                 multilib_foreach_abi _install_wrapper
74                 dobin "${T}/apulse"
75         fi
76         einstalldocs
77 }