1 |
# Copyright 1999-2010 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/media-video/vlc/vlc-9999.ebuild,v 1.54 2010/01/09 11:55:40 aballier Exp $ |
4 |
|
5 |
EAPI="2" |
6 |
|
7 |
SCM="" |
8 |
if [ "${PV%9999}" != "${PV}" ] ; then |
9 |
SCM=git |
10 |
EGIT_BOOTSTRAP="bootstrap" |
11 |
EGIT_BRANCH=master |
12 |
EGIT_PROJECT=${P} |
13 |
if [ "${PV%.9999}" != "${PV}" ] ; then |
14 |
EGIT_REPO_URI="git://git.videolan.org/vlc/vlc-${PV%.9999}.git" |
15 |
else |
16 |
EGIT_REPO_URI="git://git.videolan.org/vlc.git" |
17 |
fi |
18 |
fi |
19 |
|
20 |
inherit eutils multilib autotools toolchain-funcs gnome2 nsplugins qt4 flag-o-matic ${SCM} |
21 |
|
22 |
MY_PV="${PV/_/-}" |
23 |
MY_PV="${MY_PV/-beta/-test}" |
24 |
MY_P="${PN}-${MY_PV}" |
25 |
VLC_SNAPSHOT_TIME="0013" |
26 |
|
27 |
PATCHLEVEL="80" |
28 |
DESCRIPTION="VLC media player - Video player and streamer" |
29 |
HOMEPAGE="http://www.videolan.org/vlc/" |
30 |
if [ "${PV%9999}" != "${PV}" ] ; then # Live ebuild |
31 |
SRC_URI="" |
32 |
elif [[ "${P}" == *_alpha* ]]; then # Snapshots taken from nightlies.videolan.org |
33 |
SRC_URI="http://nightlies.videolan.org/build/source/trunk-${PV/*_alpha/}-${VLC_SNAPSHOT_TIME}/${PN}-snapshot-${PV/*_alpha/}.tar.bz2" |
34 |
MY_P="${P/_alpha*/}-git" |
35 |
elif [[ "${MY_P}" == "${P}" ]]; then |
36 |
SRC_URI="http://download.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.bz2" |
37 |
else |
38 |
SRC_URI="http://download.videolan.org/pub/videolan/testing/${MY_P}/${MY_P}.tar.bz2" |
39 |
fi |
40 |
|
41 |
SRC_URI="${SRC_URI} |
42 |
mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2" |
43 |
|
44 |
LICENSE="GPL-2" |
45 |
SLOT="0" |
46 |
|
47 |
KEYWORDS="" |
48 |
IUSE="a52 aac aalib alsa altivec atmo avahi bidi cdda cddb cdio dbus dc1394 |
49 |
debug dirac directfb dts dvb dvd elibc_glibc fbcon fluidsynth +ffmpeg flac fontconfig |
50 |
+gcrypt ggi gnome gnutls httpd id3tag ieee1394 jack kate libass libcaca |
51 |
libnotify libproxy libsysfs libtiger libv4l libv4l2 lirc live lua matroska mmx |
52 |
modplug mp3 mpeg mtp musepack ncurses nsplugin ogg opengl optimisememory oss |
53 |
png projectm pulseaudio pvr +qt4 remoteosd rtsp run-as-root samba |
54 |
schroedinger sdl sdl-image shine shout skins speex sqlite sse stream |
55 |
svg svga taglib theora truetype twolame udev upnp v4l v4l2 vcdinfo vcdx vlm |
56 |
vorbis win32codecs wma-fixed x264 +xcb xml xosd xv zvbi" |
57 |
|
58 |
RDEPEND=" |
59 |
!!<=media-video/vlc-1.0.99999 |
60 |
sys-libs/zlib |
61 |
>=media-libs/libdvbpsi-0.1.6 |
62 |
a52? ( >=media-libs/a52dec-0.7.4-r3 ) |
63 |
aalib? ( media-libs/aalib ) |
64 |
aac? ( >=media-libs/faad2-2.6.1 ) |
65 |
alsa? ( media-libs/alsa-lib ) |
66 |
avahi? ( >=net-dns/avahi-0.6 ) |
67 |
bidi? ( >=dev-libs/fribidi-0.10.4 ) |
68 |
cdda? ( cddb? ( >=media-libs/libcddb-1.2.0 ) ) |
69 |
cdio? ( >=dev-libs/libcdio-0.78.2 ) |
70 |
dbus? ( >=sys-apps/dbus-1.0.2 ) |
71 |
dc1394? ( >=sys-libs/libraw1394-2.0.1 |
72 |
>=media-libs/libdc1394-2.0.2 ) |
73 |
dirac? ( >=media-video/dirac-0.10.0 ) |
74 |
directfb? ( dev-libs/DirectFB sys-libs/zlib ) |
75 |
dts? ( media-libs/libdca ) |
76 |
dvd? ( media-libs/libdvdread |
77 |
>=media-libs/libdvdnav-0.1.9 |
78 |
media-libs/libdvdplay ) |
79 |
elibc_glibc? ( >=sys-libs/glibc-2.8 ) |
80 |
ffmpeg? ( >=media-video/ffmpeg-0.4.9_p20090201 ) |
81 |
flac? ( media-libs/libogg |
82 |
>=media-libs/flac-1.1.2 ) |
83 |
fluidsynth? ( media-sound/fluidsynth ) |
84 |
fontconfig? ( media-libs/fontconfig ) |
85 |
gcrypt? ( >=dev-libs/libgcrypt-1.2.0 ) |
86 |
ggi? ( media-libs/libggi ) |
87 |
gnome? ( gnome-base/gnome-vfs ) |
88 |
gnutls? ( >=net-libs/gnutls-1.7.4 ) |
89 |
id3tag? ( media-libs/libid3tag sys-libs/zlib ) |
90 |
ieee1394? ( >=sys-libs/libraw1394-2.0.1 >=sys-libs/libavc1394-0.5.3 ) |
91 |
jack? ( >=media-sound/jack-audio-connection-kit-0.99.0-r1 ) |
92 |
kate? ( >=media-libs/libkate-0.1.1 ) |
93 |
libass? ( >=media-libs/libass-0.9.6 media-libs/fontconfig ) |
94 |
libcaca? ( >=media-libs/libcaca-0.99_beta14 ) |
95 |
libnotify? ( x11-libs/libnotify ) |
96 |
libproxy? ( net-libs/libproxy ) |
97 |
libsysfs? ( sys-fs/sysfsutils ) |
98 |
libtiger? ( media-libs/libtiger ) |
99 |
lirc? ( app-misc/lirc ) |
100 |
live? ( >=media-plugins/live-2008.07.06 ) |
101 |
lua? ( >=dev-lang/lua-5.1 ) |
102 |
matroska? ( |
103 |
>=dev-libs/libebml-0.7.6 |
104 |
>=media-libs/libmatroska-0.8.0 ) |
105 |
modplug? ( >=media-libs/libmodplug-0.8 ) |
106 |
mp3? ( media-libs/libmad ) |
107 |
mpeg? ( >=media-libs/libmpeg2-0.3.2 ) |
108 |
mtp? ( >=media-libs/libmtp-0.3.0 ) |
109 |
musepack? ( >=media-sound/musepack-tools-444 ) |
110 |
ncurses? ( sys-libs/ncurses ) |
111 |
nsplugin? ( >=net-libs/xulrunner-1.8 ) |
112 |
ogg? ( media-libs/libogg ) |
113 |
opengl? ( virtual/opengl ) |
114 |
png? ( media-libs/libpng sys-libs/zlib ) |
115 |
projectm? ( media-libs/libprojectm ) |
116 |
pulseaudio? ( >=media-sound/pulseaudio-0.9.11 ) |
117 |
qt4? ( x11-libs/qt-gui:4 x11-libs/qt-core:4 x11-libs/libX11 ) |
118 |
remoteosd? ( >=dev-libs/libgcrypt-1.2.0 ) |
119 |
samba? ( || ( >=net-fs/samba-libs-3.4[smbclient] |
120 |
<net-fs/samba-3.4 ) ) |
121 |
schroedinger? ( >=media-libs/schroedinger-1.0.6 ) |
122 |
sdl? ( >=media-libs/libsdl-1.2.8 |
123 |
sdl-image? ( media-libs/sdl-image sys-libs/zlib ) ) |
124 |
shout? ( media-libs/libshout ) |
125 |
skins? ( x11-libs/qt-gui:4 x11-libs/qt-core:4 x11-libs/libXext x11-libs/libX11 ) |
126 |
speex? ( media-libs/speex ) |
127 |
sqlite? ( >=dev-db/sqlite-3.6.0:3 ) |
128 |
svg? ( >=gnome-base/librsvg-2.9.0 ) |
129 |
svga? ( media-libs/svgalib ) |
130 |
taglib? ( >=media-libs/taglib-1.5 sys-libs/zlib ) |
131 |
theora? ( >=media-libs/libtheora-1.0_beta3 ) |
132 |
truetype? ( media-libs/freetype |
133 |
media-fonts/dejavu ) |
134 |
twolame? ( media-sound/twolame ) |
135 |
udev? ( >=sys-fs/udev-142 ) |
136 |
upnp? ( net-libs/libupnp ) |
137 |
v4l2? ( libv4l2? ( media-libs/libv4l ) ) |
138 |
v4l? ( libv4l? ( media-libs/libv4l ) ) |
139 |
vcdinfo? ( >=media-video/vcdimager-0.7.22 ) |
140 |
vorbis? ( media-libs/libvorbis ) |
141 |
win32codecs? ( media-libs/win32codecs ) |
142 |
x264? ( >=media-libs/x264-0.0.20090923 ) |
143 |
xcb? ( x11-libs/libxcb x11-libs/xcb-util ) |
144 |
xml? ( dev-libs/libxml2 ) |
145 |
xosd? ( x11-libs/xosd ) |
146 |
zvbi? ( >=media-libs/zvbi-0.2.25 ) |
147 |
" |
148 |
|
149 |
DEPEND="${RDEPEND} |
150 |
dvb? ( sys-kernel/linux-headers ) |
151 |
v4l? ( sys-kernel/linux-headers ) |
152 |
v4l2? ( >=sys-kernel/linux-headers-2.6.25 ) |
153 |
xcb? ( x11-proto/xproto ) |
154 |
dev-util/pkgconfig" |
155 |
|
156 |
S="${WORKDIR}/${MY_P}" |
157 |
|
158 |
# Displays a warning if the first use flag is set but the second is not |
159 |
vlc_use_needs() { |
160 |
use $1 && use !$2 && ewarn "USE=$1 requires $2, $1 will be disabled." |
161 |
} |
162 |
|
163 |
# Notify the user that some useflag have been forced on |
164 |
vlc_use_force() { |
165 |
use $1 && use !$2 && ewarn "USE=$1 requires $2, $2 will be enabled." |
166 |
} |
167 |
|
168 |
# Use when $2 depends strictly on $3 |
169 |
# if use $1 then enable $2 and $3, otherwise disable $2 |
170 |
vlc_use_enable_force() { |
171 |
if use $1 ; then |
172 |
echo "--enable-$2 --enable-$3" |
173 |
else |
174 |
echo "--disable-$2" |
175 |
fi |
176 |
} |
177 |
|
178 |
pkg_setup() { |
179 |
if has_version '<=media-video/vlc-1.0.99999'; then |
180 |
eerror "Please unmerge vlc-1.0.x first before installing ${P}" |
181 |
eerror "If you don't do that, some plugins will get linked against" |
182 |
eerror "the old ${PN} version and will not work." |
183 |
die "Unmerge vlc 1.0.x first" |
184 |
fi |
185 |
vlc_use_needs skins truetype |
186 |
vlc_use_force skins qt4 |
187 |
vlc_use_needs vcdx cdio |
188 |
vlc_use_needs vcdx vcdinfo |
189 |
vlc_use_needs vcdinfo cdio |
190 |
vlc_use_needs bidi truetype |
191 |
vlc_use_force remoteosd gcrypt |
192 |
vlc_use_needs fontconfig truetype |
193 |
vlc_use_needs libv4l2 v4l2 |
194 |
vlc_use_needs libv4l v4l |
195 |
vlc_use_needs libtiger kate |
196 |
vlc_use_needs xv xcb |
197 |
vlc_use_needs cddb cdda |
198 |
if use qt4 || use skins ; then |
199 |
qt4_pkg_setup |
200 |
else |
201 |
ewarn "You have disabled the qt4 useflag, ${PN} will not have any" |
202 |
ewarn "graphical interface. Maybe that is not what you want..." |
203 |
fi |
204 |
} |
205 |
|
206 |
src_unpack() { |
207 |
unpack ${A} |
208 |
if [ "${PV%9999}" != "${PV}" ] ; then |
209 |
git_src_unpack |
210 |
fi |
211 |
} |
212 |
|
213 |
src_prepare() { |
214 |
if [ "${PV%9999}" != "${PV}" ] ; then |
215 |
git_src_prepare |
216 |
fi |
217 |
# Make it build with libtool 1.5 |
218 |
rm -f m4/lt* m4/libtool.m4 |
219 |
|
220 |
EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
221 |
eautoreconf |
222 |
} |
223 |
|
224 |
src_configure() { |
225 |
|
226 |
# It would fail if -fforce-addr is used due to too few registers... |
227 |
use x86 && filter-flags -fforce-addr |
228 |
|
229 |
local MOZILLA_PC |
230 |
|
231 |
if use nsplugin; then |
232 |
if has_version 'net-libs/xulrunner:1.9' ; then |
233 |
MOZILLA_PC=libxul |
234 |
else |
235 |
MOZILLA_PC=xulrunner-plugin |
236 |
fi |
237 |
fi |
238 |
|
239 |
econf \ |
240 |
$(use_enable a52) \ |
241 |
$(use_enable aalib aa) \ |
242 |
$(use_enable aac faad) \ |
243 |
$(use_enable alsa) \ |
244 |
$(use_enable altivec) \ |
245 |
--disable-asademux \ |
246 |
$(use_enable atmo) \ |
247 |
$(use_enable avahi bonjour) \ |
248 |
$(use_enable bidi fribidi) \ |
249 |
$(use_enable cdda vcd) \ |
250 |
$(use_enable cddb libcddb) \ |
251 |
$(use_enable cdio libcdio) \ |
252 |
$(use_enable dbus) $(use_enable dbus dbus-control) \ |
253 |
$(use_enable dirac) \ |
254 |
$(use_enable directfb) \ |
255 |
$(use_enable dc1394) \ |
256 |
$(use_enable debug) \ |
257 |
$(use_enable dts dca) \ |
258 |
$(use_enable dvb) \ |
259 |
$(use_enable dvd dvdread) $(use_enable dvd dvdnav) \ |
260 |
$(use_enable fbcon fb) \ |
261 |
$(use_enable ffmpeg avcodec) $(use_enable ffmpeg avformat) $(use_enable ffmpeg swscale) $(use_enable ffmpeg postproc) \ |
262 |
$(use_enable flac) \ |
263 |
$(use_enable fluidsynth) \ |
264 |
$(use_enable fontconfig) \ |
265 |
$(use_enable ggi) \ |
266 |
$(use_enable gnome gnomevfs) \ |
267 |
$(use_enable gnutls) \ |
268 |
$(use_enable httpd) \ |
269 |
$(use_enable id3tag) \ |
270 |
$(use_enable ieee1394 dv) \ |
271 |
$(use_enable jack) \ |
272 |
$(use_enable kate) \ |
273 |
$(use_enable libass) \ |
274 |
$(use_enable libcaca caca) \ |
275 |
$(use_enable gcrypt libgcrypt) \ |
276 |
$(use_enable libnotify notify) \ |
277 |
$(use_enable libproxy) \ |
278 |
--disable-libtar \ |
279 |
$(use_enable libtiger tiger) \ |
280 |
$(use_enable libsysfs) \ |
281 |
$(use_enable libv4l) \ |
282 |
$(use_enable libv4l2) \ |
283 |
$(use_enable lirc) \ |
284 |
$(use_enable live live555) \ |
285 |
$(use_enable lua) \ |
286 |
$(use_enable matroska mkv) \ |
287 |
$(use_enable mmx) \ |
288 |
$(use_enable modplug mod) \ |
289 |
$(use_enable mp3 mad) \ |
290 |
$(use_enable mpeg libmpeg2) \ |
291 |
$(use_enable mtp) \ |
292 |
$(use_enable musepack mpc) \ |
293 |
$(use_enable ncurses) \ |
294 |
$(use_enable nsplugin mozilla) --with-mozilla-pkg="${MOZILLA_PC}" \ |
295 |
$(use_enable ogg) \ |
296 |
$(use_enable opengl glx) $(use_enable opengl) \ |
297 |
$(use_enable optimisememory optimize-memory) \ |
298 |
$(use_enable oss) \ |
299 |
$(use_enable png) \ |
300 |
--disable-portaudio \ |
301 |
$(use_enable projectm) \ |
302 |
$(use_enable pulseaudio pulse) \ |
303 |
$(use_enable pvr) \ |
304 |
$(use_enable qt4) \ |
305 |
$(use_enable rtsp realrtsp) \ |
306 |
$(use_enable run-as-root) \ |
307 |
$(use_enable samba smb) \ |
308 |
$(use_enable schroedinger) \ |
309 |
$(use_enable sdl) \ |
310 |
$(use_enable sdl-image) \ |
311 |
$(use_enable shine) \ |
312 |
$(use_enable shout) \ |
313 |
$(use_enable skins skins2) \ |
314 |
$(use_enable speex) \ |
315 |
$(use_enable sqlite) \ |
316 |
$(use_enable sse) \ |
317 |
$(use_enable stream sout) \ |
318 |
$(use_enable svg) \ |
319 |
$(use_enable svga svgalib) \ |
320 |
$(use_enable taglib) \ |
321 |
$(use_enable theora) \ |
322 |
$(use_enable truetype freetype) \ |
323 |
$(use_enable twolame) \ |
324 |
$(use_enable udev) \ |
325 |
$(use_enable upnp) \ |
326 |
$(use_enable v4l) \ |
327 |
$(use_enable v4l2) \ |
328 |
$(use_enable vcdinfo) \ |
329 |
$(use_enable vcdx) \ |
330 |
$(use_enable vorbis) \ |
331 |
$(use_enable win32codecs loader) \ |
332 |
$(use_enable wma-fixed) \ |
333 |
$(use_enable x264) \ |
334 |
$(use_enable xcb) \ |
335 |
$(use_enable xml libxml2) \ |
336 |
$(use_enable xosd) \ |
337 |
$(use_enable xv xvideo) \ |
338 |
$(use_enable zvbi) $(use_enable !zvbi telx) \ |
339 |
--disable-snapshot \ |
340 |
--disable-growl \ |
341 |
--disable-optimizations \ |
342 |
--enable-fast-install \ |
343 |
$(vlc_use_enable_force vlm vlm sout) \ |
344 |
$(vlc_use_enable_force skins skins2 qt4) \ |
345 |
$(vlc_use_enable_force remoteosd remoteosd libgcrypt) |
346 |
} |
347 |
|
348 |
src_install() { |
349 |
emake DESTDIR="${D}" install || die "make install failed" |
350 |
|
351 |
dodoc AUTHORS HACKING THANKS NEWS README \ |
352 |
doc/fortunes.txt doc/intf-cdda.txt doc/intf-vcd.txt |
353 |
|
354 |
rm -rf "${D}/usr/share/doc/vlc" \ |
355 |
"${D}"/usr/share/vlc/vlc{16x16,32x32,48x48,128x128}.{png,xpm,ico} |
356 |
|
357 |
if use nsplugin; then |
358 |
dodir "/usr/$(get_libdir)/${PLUGINS_DIR}" |
359 |
mv "${D}"/usr/$(get_libdir)/mozilla/plugins/* \ |
360 |
"${D}/usr/$(get_libdir)/${PLUGINS_DIR}/" |
361 |
fi |
362 |
|
363 |
use skins || rm -rf "${D}/usr/share/vlc/skins2" |
364 |
|
365 |
for res in 16 32 48; do |
366 |
insinto /usr/share/icons/hicolor/${res}x${res}/apps/ |
367 |
newins "${S}"/share/vlc${res}x${res}.png vlc.png |
368 |
done |
369 |
} |