media-sound/alsa-utils: arm64 stable, bug #705758
[gentoo.git] / media-sound / alsa-utils / alsa-utils-1.2.1.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 systemd udev
6
7 DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
8 HOMEPAGE="https://alsa-project.org/"
9 SRC_URI="https://www.alsa-project.org/files/pub/utils/${P}.tar.bz2"
10
11 LICENSE="GPL-2"
12 SLOT="0.9"
13 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~sh sparc x86"
14 IUSE="bat doc +libsamplerate +ncurses nls selinux"
15
16 CDEPEND=">=media-libs/alsa-lib-${PV}
17         libsamplerate? ( media-libs/libsamplerate )
18         ncurses? ( >=sys-libs/ncurses-5.7-r7:0= )
19         bat? ( sci-libs/fftw:= )"
20 DEPEND="${CDEPEND}
21         doc? ( app-text/xmlto )"
22 RDEPEND="${CDEPEND}
23         selinux? ( sec-policy/selinux-alsa )"
24 BDEPEND="virtual/pkgconfig"
25
26 PATCHES=(
27         "${FILESDIR}"/${PN}-1.1.8-missing_header.patch
28 )
29
30 src_configure() {
31         local myeconfargs=(
32                 # --disable-alsaconf because it doesn't work with sys-apps/kmod wrt #456214
33                 --disable-alsaconf
34                 --disable-maintainer-mode
35                 --with-asound-state-dir="${EPREFIX}"/var/lib/alsa
36                 --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
37                 --with-udev-rules-dir="${EPREFIX}/$(get_udevdir)"/rules.d
38                 $(use_enable bat)
39                 $(use_enable libsamplerate alsaloop)
40                 $(use_enable ncurses alsamixer)
41                 $(use_enable nls)
42                 $(usex doc '' --disable-xmlto)
43         )
44         econf "${myeconfargs[@]}"
45 }
46
47 src_install() {
48         default
49         dodoc seq/*/README.*
50
51         newinitd "${FILESDIR}"/alsasound.initd-r8 alsasound
52         newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
53
54         insinto /etc/modprobe.d
55         newins "${FILESDIR}"/alsa-modules.conf-rc alsa.conf
56
57         keepdir /var/lib/alsa
58
59         # ALSA lib parser.c:1266:(uc_mgr_scan_master_configs) error: could not
60         # scan directory /usr/share/alsa/ucm: No such file or directory
61         # alsaucm: unable to obtain card list: No such file or directory
62         keepdir /usr/share/alsa/ucm
63 }
64
65 pkg_postinst() {
66         if [[ -z ${REPLACING_VERSIONS} ]]; then
67                 elog
68                 elog "To take advantage of the init script, and automate the process of"
69                 elog "saving and restoring sound-card mixer levels you should"
70                 elog "add alsasound to the boot runlevel. You can do this as"
71                 elog "root like so:"
72                 elog "# rc-update add alsasound boot"
73                 ewarn
74                 ewarn "The ALSA core should be built into the kernel or loaded through other"
75                 ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
76         fi
77 }