1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.4 2003/05/23 00:00:48 hartman Exp $
7 # Authors: Derk-Jan Hartman <thedj at users.sf.net>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 ###############################################################################
23 IUSE="arts qt ncurses dvd gtk nls 3dfx esd kde X alsa ggi oggvorbis gnome xv oss sdl fbcon aalib avi slp truetype"
25 # Change these to correspond with the
26 # unpacked dirnames of the CVS snapshots.
27 PFFMPEG=ffmpeg-20030517
28 PLIBMPEG2=mpeg2dec-20030418
31 SFFMPEG=${WORKDIR}/${PFFMPEG}
32 SLIBMPEG2=${WORKDIR}/${PLIBMPEG2}
34 DESCRIPTION="VLC media player - A videoplayer that plays DVD,
35 VCD, files and networkstreams o.a."
37 # Use the correct CVS snapshot links.
38 SRC_URI="http://www.videolan.org/pub/testing/${P}/${P}.tar.bz2
39 http://www.videolan.org/pub/testing/contrib/ffmpeg-20030517.tar.bz2
40 http://www.videolan.org/pub/testing/contrib/mpeg2dec-20030418.tar.bz2"
42 #SRC_URI="http://www.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.bz2
43 # http://www.videolan.org/pub/videolan/${PN}/${PV}/contrib/libmpeg2.tar.bz2
44 # http://www.videolan.org/pub/videolan/${PN}/${PV}/contrib/ffmpeg.tar.bz2"
45 HOMEPAGE="http://www.videolan.org"
51 DEPEND="X? ( virtual/x11 )
53 dvd? ( >=media-libs/libdvdread-0.9.3
54 >=media-libs/libdvdcss-1.2.6
55 >=media-libs/libdvdplay-1.0.1 )
56 sdl? ( >=media-libs/libsdl-1.2.5 )
57 esd? ( >=media-sound/esound-0.2.22 )
58 ggi? ( >=media-libs/libggi-2.0_beta3 )
59 gtk? ( =x11-libs/gtk+-1.2* )
60 kde? ( kde-base/kdelibs )
61 arts? ( kde-base/kdelibs )
62 gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
63 ncurses? ( sys-libs/ncurses )
64 oggvorbis? ( >=media-libs/libvorbis-1.0
65 >=media-libs/libogg-1.0 )
66 alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
67 aalib? ( >=media-libs/aalib-1.4_rc4-r2 )
68 avi? ( >=media-libs/xvid-0.9.1 )
69 slp? ( >=net-libs/openslp-1.0.10 )
70 truetype? ( >=media-libs/freetype-2.1.4 )
71 >=media-sound/mad-0.14.2b
72 >=media-libs/a52dec-0.7.4
73 >=media-libs/faad2-1.1
74 >=media-libs/libdvbpsi-0.1.2"
75 # other optional libraries
76 # >=media-libs/flac-1.1.0
77 # >=media-libs/libdv-0.98
78 # wxwindows ought to be a USE variable, like all the others
79 # >=x11-libs/wxGTK-2.4.0
86 RDEPEND="nls? ( sys-devel/gettext )"
88 # get kde and arts paths
89 if [ -n "`use kde`" -o -n "`use arts`" ]; then
92 # $KDEDIR is now set to arts/kdelibs location
99 # if qt3 is installed, patch vlc to work with it instead of qt2
100 ( use qt || use kde ) && ( \
101 if [ ${QTDIR} = "/usr/qt/3" ]
103 cp configure.ac configure.ac.orig
105 configure.ac.orig > configure.ac
106 # adding configure.ac.in
107 cp configure.ac.in configure.ac.in.orig
109 configure.ac.in.orig > configure.ac.in
111 cd ${S}/modules/gui/kde
112 cp interface.h interface.h.orig
113 sed "s:\(#include <kmainwindow.h>\):\1\n#include <kstatusbar.h>:" \
114 interface.h.orig > interface.h
116 cp preferences.cpp preferences.cpp.orig
117 sed 's:\("vlc preferences", true, false, \)\("Save\):\1(KGuiItem)\2:' \
118 preferences.cpp.orig > preferences.cpp
124 cp configure configure.orig
125 sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
126 configure.orig > configure
131 # configure and building of libmpeg2
133 econf --disable-sdl --without-x \
134 || die "./configure of libmpeg2 failed"
136 emake || make || die "make of libmpeg2 failed"
138 # configure and building of ffmpeg
141 use mmx || myconf="--disable-mmx"
143 ./configure ${myconf} \
145 --disable-vorbis || die "./configure of ffmpeg failed"
148 make || die "make of ffmpeg failed"
150 make || die "make of libpostproc failed"
152 # Configure and build VLC
157 && myconf="${myconf} --enable-x11" \
158 || myconf="${myconf} --disable-x11"
161 && myconf="${myconf} --enable-xvideo" \
162 || myconf="${myconf} --diable-xvideo"
165 && myconf="${myconf} --enable-qt" \
166 || myconf="${myconf} --disable-qt"
169 && myconf="${myconf} \
173 || myconf="${myconf} \
179 && myconf="${myconf} --enable-esd" \
180 || myconf="${myconf} --disable-esd"
183 && myconf="${myconf} --enable-ggi" \
184 || myconf="${myconf} --disable-ggi"
186 # the current gtk2 and gnome2 are prelimenary frameworks
188 && myconf="${myconf} --enable-gtk --disable-gtk2" \
189 || myconf="${myconf} --disable-gtki --disable-gtk2"
192 && myconf="${myconf} --enable-kde" \
193 || myconf="${myconf} --disable-kde"
196 || myconf="${myconf} --disable-nls"
199 && myconf="${myconf} --enable-glide" \
200 || myconf="${myconf} --disable-glide"
203 && myconf="${myconf} --enable-arts" \
204 || myconf="${myconf} --disable-arts"
207 && myconf="${myconf} --enable-gnome --disable-gnome2" \
208 || myconf="${myconf} --disable-gnome --disable-gnome2"
211 && myconf="${myconf} --enable-ncurses" \
212 || myconf="${myconf} --disable-ncurses"
215 && myconf="${myconf} --enable-vorbis --enable-ogg" \
216 || myconf="${myconf} --disable-vorbis --disable-ogg"
219 && myconf="${myconf} --enable-alsa" \
220 || myconf="${myconf} --disable-alsa"
223 && myconf="${myconf} --enable-oss" \
224 || myconf="${myconf} --disable-oss"
227 && myconf="${myconf} --enable-sdl" \
228 || myconf="${myconf} --disable-sdl"
231 && myconf="${myconf} --enable-fb" \
232 || myconf="${myconf} --disable-fb"
235 && myconf="${myconf} --enable-aa" \
236 || myconf="${myconf} --disable-aa"
238 # there is no xvid USE variable
239 # it is pretty reasonable that users with the avi USE variable
240 # want xvid too cq. not.
242 && myconf="${myconf} --enable-xvid" \
243 || myconf="${myconf} --disable-xvid"
246 && myconf="${myconf} --enable-slp" \
247 || myconf="${myconf} --disable-slp"
249 # vlc uses its own ultraoptimizaed CXXFLAGS
250 # and forcing custom ones generally fails building
253 export WANT_AUTOCONF_2_5=1
254 export WANT_AUTOMAKE_1_6=1
257 --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
258 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
264 ${myconf} || die "configure of VLC failed"
266 # parallel make doesn't work with our complicated makefile
267 # this is also the reason as why you shouldn't run autoconf
268 # or automake yourself. (or bootstrap for that matter)
269 make || die "make of VLC failed"
274 einstall || die "make install failed"
276 dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
277 MAINTAINERS NEWS README* MODULES THANKS