1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.9 2003/06/23 00:18:50 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 matrox svga fbcon esd kde X alsa ggi oggvorbis gnome xv oss sdl fbcon aalib slp truetype v4l xvid lirc wxwindows imlib"
25 # Change these to correspond with the
26 # unpacked dirnames of the CVS snapshots.
27 PFFMPEG=ffmpeg-20030622
28 PLIBMPEG2=mpeg2dec-20030612
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 SRC_URI="http://www.videolan.org/pub/${PN}/${PV}/${P}.tar.bz2
38 http://www.videolan.org/pub/${PN}/${PV}/contrib/mpeg2dec-20030612.tar.bz2
39 http://www.videolan.org/pub/${PN}/${PV}/contrib/ffmpeg-20030622.tar.bz2"
41 HOMEPAGE="http://www.videolan.org/vlc"
47 DEPEND="X? ( virtual/x11 )
48 nls? ( sys-devel/gettext )
50 dvd? ( >=media-libs/libdvdread-0.9.3
51 >=media-libs/libdvdcss-1.2.6
52 >=media-libs/libdvdplay-1.0.1 )
53 sdl? ( >=media-libs/libsdl-1.2.5 )
54 esd? ( >=media-sound/esound-0.2.22 )
55 ggi? ( >=media-libs/libggi-2.0_beta3 )
56 gtk? ( =x11-libs/gtk+-1.2* )
57 kde? ( kde-base/kdelibs )
58 arts? ( kde-base/kdelibs )
59 gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
60 ncurses? ( sys-libs/ncurses )
61 oggvorbis? ( >=media-libs/libvorbis-1.0
62 >=media-libs/libogg-1.0 )
63 alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
64 aalib? ( >=media-libs/aalib-1.4_rc4-r2 )
65 xvid? ( >=media-libs/xvid-0.9.1 )
66 slp? ( >=net-libs/openslp-1.0.10 )
67 truetype? ( >=media-libs/freetype-2.1.4 )
68 lirc? ( app-misc/lirc )
69 imlib? ( >=media-libs/imlib2-1.0.6 )
70 wxwindows? ( >=x11-libs/wxGTK-2.4.0 )
71 >=media-libs/libdvbpsi-0.1.2
72 >=media-sound/mad-0.14.2b
73 >=media-libs/faad2-1.1
74 >=media-libs/a52dec-0.7.4"
75 # other optional libraries
76 # >=media-libs/flac-1.1.0
77 # >=media-libs/libdv-0.98
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
96 # if qt3 is installed, patch vlc to work with it instead of qt2
97 ( use qt || use kde ) && ( \
98 if [ ${QTDIR} = "/usr/qt/3" ]
100 cp configure.ac configure.ac.orig
102 configure.ac.orig > configure.ac
104 cd ${S}/modules/gui/kde
105 cp interface.h interface.h.orig
106 sed "s:\(#include <kmainwindow.h>\):\1\n#include <kstatusbar.h>:" \
107 interface.h.orig > interface.h
109 cp preferences.cpp preferences.cpp.orig
110 sed 's:\("vlc preferences", true, false, \)\("Save\):\1(KGuiItem)\2:' \
111 preferences.cpp.orig > preferences.cpp
117 cp configure configure.orig
118 sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
119 configure.orig > configure
124 # configure and building of libmpeg2
126 econf --disable-sdl --without-x \
127 || die "./configure of libmpeg2 failed"
129 emake || make || die "make of libmpeg2 failed"
131 # configure and building of ffmpeg
134 use mmx || myconf="--disable-mmx"
136 ./configure ${myconf} \
138 --disable-vorbis || die "./configure of ffmpeg failed"
141 make || die "make of ffmpeg failed"
143 make || die "make of libpostproc failed"
145 # Configure and build VLC
149 use X || myconf="${myconf} --disable-x11"
151 use xv || myconf="${myconf} --disable-xvideo"
153 use ggi && myconf="${myconf} --enable-ggi"
155 use 3dfx && myconf="${myconf} --enable-glide"
157 use matrox && myconf="${myconf} --enable-mga"
159 use svga && myconf="${myconf} --enable-svgalib"
161 use sdl || myconf="${myconf} --disable-sdl"
163 use fbcon || myconf="${myconf} --disable-fb"
165 use aalib && myconf="${myconf} --enable-aa"
168 && myconf="${myconf} --enable-dvdread" \
169 || myconf="${myconf} \
175 use alsa && myconf="${myconf} --enable-alsa"
177 use oss || myconf="${myconf} --disable-oss"
179 use esd && myconf="${myconf} --enable-esd"
181 use arts && myconf="${myconf} --enable-arts"
183 use nls || myconf="${myconf} --disable-nls"
185 # the current gtk2 and gnome2 are prelimenary frameworks
187 && myconf="${myconf} --disable-gtk2" \
188 || myconf="${myconf} --disable-gtk --disable-gtk2"
190 use gnome && myconf="${myconf} --enable-gnome --disable-gnome2"
192 use kde && myconf="${myconf} --enable-kde"
194 use qt && myconf="${myconf} --enable-qt"
196 use ncurses && myconf="${myconf} --enable-ncurses"
198 use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
200 use lirc && myconf="${myconf} --enable-lirc"
202 use slp || myconf="${myconf} --disable-slp"
204 # xvid is a local USE var, see /usr/portage/profiles/use.local.desc for more details
205 use xvid && myconf="${myconf} --enable-xvid"
207 # v4l is a local USE var, see /usr/portage/profiles/use.local.desc for more details
208 use v4l && myconf="${myconf} --enable-v4l"
210 # wxwindows is a local USE var. already enabled by default, but depends on wxGTK
211 # but if we use wxwindows and imlib, then we can also use skins
212 (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
214 # vlc uses its own ultraoptimizaed CXXFLAGS
215 # and forcing custom ones generally fails building
218 export WANT_AUTOCONF_2_5=1
219 export WANT_AUTOMAKE_1_6=1
221 myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
222 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
230 econf ${myconf} || die "configure of VLC failed"
232 # parallel make doesn't work with our complicated makefile
233 # this is also the reason as why you shouldn't run autoconf
234 # or automake yourself. (or bootstrap for that matter)
235 make || die "make of VLC failed"
240 einstall || die "make install failed"
242 dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
243 MAINTAINERS NEWS README* MODULES THANKS