media-plugins/gst-plugins-faad: remove gstreamer 0.10
[gentoo.git] / media-plugins / alsa-plugins / alsa-plugins-1.1.1-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit autotools eutils flag-o-matic multilib multilib-minimal
6
7 DESCRIPTION="ALSA extra plugins"
8 HOMEPAGE="http://www.alsa-project.org/"
9 SRC_URI="mirror://alsaproject/plugins/${P}.tar.bz2"
10
11 LICENSE="GPL-2 LGPL-2.1"
12 SLOT="0"
13 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86 ~amd64-linux"
14 IUSE="debug ffmpeg jack libav libsamplerate pulseaudio speex"
15
16 RDEPEND="
17         >=media-libs/alsa-lib-${PV}:=[${MULTILIB_USEDEP}]
18         ffmpeg? (
19                 libav? ( media-video/libav:= )
20                 !libav? ( media-video/ffmpeg:0= )
21         )
22         jack? ( virtual/jack[${MULTILIB_USEDEP}] )
23         libsamplerate? ( >=media-libs/libsamplerate-0.1.8-r1:=[${MULTILIB_USEDEP}] )
24         pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
25         speex? (
26                 >=media-libs/speex-1.2.0:=[${MULTILIB_USEDEP}]
27                 media-libs/speexdsp[${MULTILIB_USEDEP}]
28         )
29 "
30 DEPEND="${RDEPEND}
31         virtual/pkgconfig"
32
33 PATCHES=(
34         "${FILESDIR}/${PN}-1.0.23-automagic.patch"
35         "${FILESDIR}/${PN}-1.0.28-libav10.patch"
36 )
37
38 src_prepare() {
39         default
40
41         # For some reasons the polyp/pulse plugin does fail with alsaplayer with a
42         # failed assert. As the code works just fine with asserts disabled, for now
43         # disable them waiting for a better solution.
44         sed -i \
45                 -e '/AM_CFLAGS/s:-Wall:-DNDEBUG -Wall:' \
46                 pulse/Makefile.am || die
47
48         eautoreconf
49 }
50
51 multilib_src_configure() {
52         use debug || append-cppflags -DNDEBUG
53
54         local myspeex=no
55         use speex && myspeex=lib
56
57         ECONF_SOURCE=${S} \
58         econf \
59                 $(use_enable ffmpeg avcodec) \
60                 $(use_enable jack) \
61                 $(use_enable libsamplerate samplerate) \
62                 $(use_enable pulseaudio) \
63                 --with-speex=${myspeex}
64 }
65
66 multilib_src_install_all() {
67         einstalldocs
68
69         cd doc || die
70         dodoc upmix.txt vdownmix.txt README-pcm-oss
71         use jack && dodoc README-jack
72         use libsamplerate && dodoc samplerate.txt
73         use ffmpeg && dodoc lavcrate.txt a52.txt
74
75         if use pulseaudio; then
76                 dodoc README-pulse
77                 # install ALSA configuration files
78                 # making PA to be used by alsa clients
79                 insinto /usr/share/alsa
80                 doins "${FILESDIR}"/pulse-default.conf
81                 insinto /usr/share/alsa/alsa.conf.d
82                 doins "${FILESDIR}"/51-pulseaudio-probe.conf
83                 # bug #410261, comment 5+
84                 # seems to work fine without any path
85                 sed -i \
86                         -e "s:/usr/lib/alsa-lib/::" \
87                         "${ED}"/usr/share/alsa/alsa.conf.d/51-pulseaudio-probe.conf || die #410261
88         fi
89
90         prune_libtool_files --all
91 }
92
93 pkg_postinst() {
94         if use pulseaudio; then
95                 einfo "The PulseAudio device is now set as the default device if the"
96                 einfo "PulseAudio server is found to be running. Any custom"
97                 einfo "configuration in /etc/asound.conf or ~/.asoundrc for this"
98                 einfo "purpose should now be unnecessary."
99         fi
100 }