Merge remote-tracking branch 'github/pr/850'.
[gentoo.git] / media-plugins / audacious-plugins / audacious-plugins-3.6.2-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils
7
8 MY_P="${P/_/-}"
9 S="${WORKDIR}/${MY_P}"
10 DESCRIPTION="Audacious Player - Your music, your way, no exceptions"
11 HOMEPAGE="http://audacious-media-player.org/"
12 SRC_URI="!gtk3? ( http://distfiles.audacious-media-player.org/${MY_P}.tar.bz2 )
13          gtk3? ( http://distfiles.audacious-media-player.org/${MY_P}-gtk3.tar.bz2 )"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="alpha amd64 ~arm ~hppa ppc ppc64 x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux"
18 IUSE="aac adplug alsa bs2b cdda cue ffmpeg flac fluidsynth gnome http gtk3 jack
19 lame libnotify libsamplerate lirc mms mp3 nls pulseaudio qt5 scrobbler sdl sid sndfile vorbis wavpack"
20 REQUIRED_USE="|| ( alsa flac lame jack pulseaudio qt5 sdl )"
21
22 RDEPEND="app-arch/unzip
23         >=dev-libs/dbus-glib-0.60
24         dev-libs/libxml2:2
25         media-libs/libmodplug
26         ~media-sound/audacious-${PV}
27         ( || ( >=dev-libs/glib-2.32.2[utils] dev-util/gdbus-codegen ) )
28         aac? ( >=media-libs/faad2-2.7 )
29         adplug? ( >=dev-cpp/libbinio-1.4 )
30         alsa? ( >=media-libs/alsa-lib-1.0.16 )
31         bs2b? ( media-libs/libbs2b )
32         cdda? ( >=media-libs/libcddb-1.2.1
33                 dev-libs/libcdio-paranoia )
34         cue? ( media-libs/libcue )
35         ffmpeg? ( >=virtual/ffmpeg-0.7.3 )
36         flac? ( >=media-libs/libvorbis-1.0
37                 >=media-libs/flac-1.2.1-r1 )
38         fluidsynth? ( media-sound/fluidsynth )
39         http? ( >=net-libs/neon-0.26.4 )
40         !gtk3? ( x11-libs/gtk+:2 )
41         gtk3? ( x11-libs/gtk+:3 )
42         qt5? ( dev-qt/qtcore:5
43               dev-qt/qtgui:5
44               dev-qt/qtmultimedia:5
45               dev-qt/qtwidgets:5 )
46         jack? ( >=media-libs/bio2jack-0.4
47                 media-sound/jack-audio-connection-kit )
48         lame? ( media-sound/lame )
49         libnotify? ( x11-libs/libnotify )
50         libsamplerate? ( media-libs/libsamplerate )
51         lirc? ( app-misc/lirc )
52         mms? ( >=media-libs/libmms-0.3 )
53         mp3? ( >=media-sound/mpg123-1.12.1 )
54         pulseaudio? ( >=media-sound/pulseaudio-0.9.3 )
55         scrobbler? ( net-misc/curl )
56         sdl? ( media-libs/libsdl[sound] )
57         sid? ( >=media-libs/libsidplayfp-1.0.0 )
58         sndfile? ( >=media-libs/libsndfile-1.0.17-r1 )
59         vorbis? ( >=media-libs/libvorbis-1.2.0
60                   >=media-libs/libogg-1.1.3 )
61         wavpack? ( >=media-sound/wavpack-4.50.1-r1 )"
62
63 DEPEND="${RDEPEND}
64         nls? ( dev-util/intltool )
65         virtual/pkgconfig"
66
67 mp3_warning() {
68         if ! use mp3 ; then
69                 ewarn "MP3 support is optional, you may want to enable the mp3 USE-flag"
70         fi
71 }
72
73 src_unpack() {
74         default
75         if use gtk3 ; then
76                 mv "${MY_P}-gtk3" "${MY_P}"
77         fi
78 }
79
80 src_prepare() {
81         has_version "<dev-libs/glib-2.32" && \
82                 cd "${S}"/src/mpris2 && \
83                 gdbus-codegen --interface-prefix org.mpris. \
84                         --c-namespace Mpris --generate-c-code object-core mpris2.xml && \
85                 gdbus-codegen --interface-prefix org.mpris. \
86                         --c-namespace Mpris \
87                         --generate-c-code object-player mpris2-player.xml && \
88                 cd "${S}"
89 }
90
91 src_configure() {
92         mp3_warning
93
94         if use ffmpeg && has_version media-video/ffmpeg ; then
95                 ffmpeg="--with-ffmpeg=ffmpeg"
96         elif use ffmpeg && has_version media-video/libav ; then
97                 ffmpeg="--with-ffmpeg=libav"
98         else
99                 ffmpeg="--with-ffmpeg=none"
100         fi
101
102         econf \
103                 ${ffmpeg} \
104                 --enable-modplug \
105                 --enable-statusicon \
106                 --disable-soxr \
107                 $(use_enable adplug) \
108                 $(use_enable aac) \
109                 $(use_enable alsa) \
110                 $(use_enable bs2b) \
111                 $(use_enable cdda cdaudio) \
112                 $(use_enable cue) \
113                 $(use_enable flac flacng) \
114                 $(use_enable fluidsynth amidiplug) \
115                 $(use_enable flac filewriter_flac) \
116                 $(use_enable http neon) \
117                 $(use_enable jack) \
118                 $(use_enable gnome gnomeshortcuts) \
119                 $(use_enable lame filewriter_mp3) \
120                 $(use_enable libnotify notify) \
121                 $(use_enable libsamplerate resample) \
122                 $(use_enable lirc) \
123                 $(use_enable mms) \
124                 $(use_enable mp3) \
125                 $(use_enable nls) \
126                 $(use_enable pulseaudio pulse) \
127                 $(use_enable qt5 qt) \
128                 $(use_enable scrobbler scrobbler2) \
129                 $(use_enable sdl sdlout) \
130                 $(use_enable sid) \
131                 $(use_enable sndfile) \
132                 $(use_enable vorbis) \
133                 $(use_enable wavpack)
134 }