1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.2 2003/05/15 15:35:55 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-cvs-2003-05-14
28 PLIBMPEG2=mpeg2dec-0.3.2-cvs
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/videolan/${PN}/${PV}/${P}.tar.bz2
39 http://www.videolan.org/pub/videolan/${PN}/${PV}/contrib/libmpeg2.tar.gz
40 http://www.videolan.org/pub/videolan/${PN}/${PV}/contrib/ffmpeg.tar.gz"
41 HOMEPAGE="http://www.videolan.org"
47 DEPEND="X? ( virtual/x11 )
49 dvd? ( >=media-libs/libdvdread-0.9.3
50 >=media-libs/libdvdcss-1.2.6
51 >=media-libs/libdvdplay-1.0.1 )
52 sdl? ( >=media-libs/libsdl-1.2.5 )
53 esd? ( >=media-sound/esound-0.2.22 )
54 ggi? ( >=media-libs/libggi-2.0_beta3 )
55 gtk? ( =x11-libs/gtk+-1.2* )
56 kde? ( kde-base/kdelibs )
57 arts? ( kde-base/kdelibs )
58 gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
59 ncurses? ( sys-libs/ncurses )
60 oggvorbis? ( >=media-libs/libvorbis-1.0
61 >=media-libs/libogg-1.0 )
62 alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
63 aalib? ( >=media-libs/aalib-1.4_rc4-r2 )
64 avi? ( >=media-libs/xvid-0.9.1 )
65 slp? ( >=net-libs/openslp-1.0.10 )
66 truetype? ( >=media-libs/freetype-2.1.4 )
67 >=media-sound/mad-0.14.2b
68 >=media-libs/a52dec-0.7.4
69 >=media-libs/faad2-1.1
70 >=media-libs/libdvbpsi-0.1.2"
71 # other optional libraries
72 # >=media-libs/flac-1.1.0
73 # >=media-libs/libdv-0.98
74 # wxwindows ought to be a USE variable, like all the others
75 # >=x11-libs/wxGTK-2.4.0
82 RDEPEND="nls? ( sys-devel/gettext )"
84 # get kde and arts paths
85 if [ -n "`use kde`" -o -n "`use arts`" ]; then
88 # $KDEDIR is now set to arts/kdelibs location
95 # if qt3 is installed, patch vlc to work with it instead of qt2
96 ( use qt || use kde ) && ( \
97 if [ ${QTDIR} = "/usr/qt/3" ]
99 cp configure.ac configure.ac.orig
101 configure.ac.orig > configure.ac
102 # adding configure.ac.in
103 cp configure.ac.in configure.ac.in.orig
105 configure.ac.in.orig > configure.ac.in
107 cd ${S}/modules/gui/kde
108 cp interface.h interface.h.orig
109 sed "s:\(#include <kmainwindow.h>\):\1\n#include <kstatusbar.h>:" \
110 interface.h.orig > interface.h
112 cp preferences.cpp preferences.cpp.orig
113 sed 's:\("vlc preferences", true, false, \)\("Save\):\1(KGuiItem)\2:' \
114 preferences.cpp.orig > preferences.cpp
120 cp configure configure.orig
121 sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
122 configure.orig > configure
127 # configure and building of libmpeg2
129 econf --disable-sdl --without-x \
130 || die "./configure of libmpeg2 failed"
132 emake || make || die "make of libmpeg2 failed"
134 # configure and building of ffmpeg
137 use mmx || myconf="--disable-mmx"
139 ./configure ${myconf} \
141 --disable-vorbis || die "./configure of ffmpeg failed"
144 make || die "make of ffmpeg failed"
146 make || die "make of libpostproc failed"
148 # Configure and build VLC
153 && myconf="${myconf} --enable-x11" \
154 || myconf="${myconf} --disable-x11"
157 && myconf="${myconf} --enable-xvideo" \
158 || myconf="${myconf} --diable-xvideo"
161 && myconf="${myconf} --enable-qt" \
162 || myconf="${myconf} --disable-qt"
165 && myconf="${myconf} \
169 || myconf="${myconf} \
175 && myconf="${myconf} --enable-esd" \
176 || myconf="${myconf} --disable-esd"
179 && myconf="${myconf} --enable-ggi" \
180 || myconf="${myconf} --disable-ggi"
182 # the current gtk2 and gnome2 are prelimenary frameworks
184 && myconf="${myconf} --enable-gtk --disable-gtk2" \
185 || myconf="${myconf} --disable-gtki --disable-gtk2"
188 && myconf="${myconf} --enable-kde" \
189 || myconf="${myconf} --disable-kde"
192 || myconf="${myconf} --disable-nls"
195 && myconf="${myconf} --enable-glide" \
196 || myconf="${myconf} --disable-glide"
199 && myconf="${myconf} --enable-arts" \
200 || myconf="${myconf} --disable-arts"
203 && myconf="${myconf} --enable-gnome --disable-gnome2" \
204 || myconf="${myconf} --disable-gnome --disable-gnome2"
207 && myconf="${myconf} --enable-ncurses" \
208 || myconf="${myconf} --disable-ncurses"
211 && myconf="${myconf} --enable-vorbis --enable-ogg" \
212 || myconf="${myconf} --disable-vorbis --disable-ogg"
215 && myconf="${myconf} --enable-alsa" \
216 || myconf="${myconf} --disable-alsa"
219 && myconf="${myconf} --enable-oss" \
220 || myconf="${myconf} --disable-oss"
223 && myconf="${myconf} --enable-sdl" \
224 || myconf="${myconf} --disable-sdl"
227 && myconf="${myconf} --enable-fb" \
228 || myconf="${myconf} --disable-fb"
231 && myconf="${myconf} --enable-aa" \
232 || myconf="${myconf} --disable-aa"
234 # there is no xvid USE variable
235 # it is pretty reasonable that users with the avi USE variable
236 # want xvid too cq. not.
238 && myconf="${myconf} --enable-xvid" \
239 || myconf="${myconf} --disable-xvid"
242 && myconf="${myconf} --enable-slp" \
243 || myconf="${myconf} --disable-slp"
245 # vlc uses its own ultraoptimizaed CXXFLAGS
246 # and forcing custom ones generally fails building
249 export WANT_AUTOCONF_2_5=1
250 export WANT_AUTOMAKE_1_6=1
253 --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
254 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
260 ${myconf} || die "configure of VLC failed"
262 # parallel make doesn't work with our complicated makefile
263 # this is also the reason as why you shouldn't run autoconf
264 # or automake yourself. (or bootstrap for that matter)
265 make || die "make of VLC failed"
270 einstall || die "make install failed"
272 dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
273 MAINTAINERS NEWS README* MODULES THANKS