media-sound/qtgain: EAPI-7 bump, use desktop.eclass
[gentoo.git] / media-sound / bluez-alsa / bluez-alsa-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit autotools multilib-minimal systemd
6
7 DESCRIPTION="Bluetooth Audio ALSA Backend"
8 HOMEPAGE="https://github.com/Arkq/bluez-alsa"
9
10 if [[ ${PV} == "9999" ]] ; then
11         inherit git-r3
12         EGIT_REPO_URI="https://github.com/Arkq/${PN}"
13 else
14         SRC_URI="https://github.com/Arkq/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15         KEYWORDS="~amd64 ~x86"
16 fi
17
18 LICENSE="MIT"
19 SLOT="0"
20 IUSE="aac debug hcitop ldac ofono static-libs test upower"
21 RESTRICT="!test? ( test )"
22
23 # bluez-alsa does not directly link to upower but
24 # is using the upower interface via dbus calls.
25 RDEPEND="
26         >=dev-libs/glib-2.26[dbus,${MULTILIB_USEDEP}]
27         >=media-libs/alsa-lib-1.1.2[${MULTILIB_USEDEP}]
28         >=media-libs/sbc-1.2[${MULTILIB_USEDEP}]
29         >=net-wireless/bluez-5.0[${MULTILIB_USEDEP}]
30         sys-apps/dbus[${MULTILIB_USEDEP}]
31         sys-libs/readline:0=
32         aac? ( >=media-libs/fdk-aac-0.1.1:=[${MULTILIB_USEDEP}] )
33         hcitop? (
34                 dev-libs/libbsd
35                 sys-libs/ncurses:0=
36         )
37         ldac? ( >=media-libs/libldac-2.0.0 )
38         upower? ( sys-power/upower )
39 "
40 DEPEND="${RDEPEND}"
41 BDEPEND="virtual/pkgconfig"
42
43 src_prepare() {
44         default
45         eautoreconf
46 }
47
48 multilib_src_configure() {
49         local myeconfargs=(
50                 --enable-rfcomm
51                 $(use_enable aac)
52                 $(use_enable debug)
53                 $(use_enable ofono)
54                 $(use_enable static-libs static)
55                 $(use_enable test)
56                 $(multilib_native_use_enable hcitop)
57                 $(multilib_native_use_enable ldac)
58                 $(multilib_native_use_enable upower)
59         )
60         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
61 }
62
63 multilib_src_install_all() {
64         default
65         find "${ED}" -type f -name "*.la" -delete || die
66
67         newinitd "${FILESDIR}"/bluealsa-init.d bluealsa
68         newconfd "${FILESDIR}"/bluealsa-conf.d-2 bluealsa
69         systemd_dounit "${FILESDIR}"/bluealsa.service
70 }
71
72 pkg_postinst() {
73         elog "Users can use this service when they are members of the \"audio\" group."
74 }