1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.18 2003/07/21 01:38:37 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 # Instructions: http://wiki.videolan.org/index.php/Linux%20Gentoo
24 # Some of the ideas in this ebuild are derived from the official Gentoo ebuild
25 # Thanks to the Gentoo Team for supporting us.
26 ###############################################################################
28 IUSE="arts ncurses dvd gtk nls 3dfx svga fbcon esd X alsa ggi oggvorbis gnome xv oss sdl fbcon aalib slp truetype v4l lirc wxwindows imlib matroska dvb pvr mozilla mad debug xvid"
30 # Change these to correspond with the
31 # unpacked dirnames of the CVS snapshots.
32 PFFMPEG=ffmpeg-20030622
33 PLIBMPEG2=mpeg2dec-20030612
36 SFFMPEG=${WORKDIR}/${PFFMPEG}
37 SLIBMPEG2=${WORKDIR}/${PLIBMPEG2}
39 DESCRIPTION="VLC media player - Video player and streamer"
40 SRC_URI="http://www.videolan.org/pub/${PN}/${PV}/${P}.tar.bz2
41 http://www.videolan.org/pub/${PN}/${PV}/contrib/mpeg2dec-20030612.tar.bz2
42 http://www.videolan.org/pub/${PN}/${PV}/contrib/ffmpeg-20030622.tar.bz2"
44 HOMEPAGE="http://www.videolan.org/vlc"
48 KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~amd64"
50 DEPEND="X? ( virtual/x11 )
51 aalib? ( >=media-libs/aalib-1.4_rc4-r2 )
52 alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
53 dvb? ( media-libs/libdvb
54 media-tv/linuxtv-dvb )
55 dvd? ( >=media-libs/libdvdread-0.9.3
56 >=media-libs/libdvdcss-1.2.6
57 >=media-libs/libdvdplay-1.0.1 )
58 esd? ( >=media-sound/esound-0.2.22 )
59 ggi? ( >=media-libs/libggi-2.0_beta3 )
60 gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
61 gtk? ( =x11-libs/gtk+-1.2* )
62 imlib? ( >=media-libs/imlib2-1.0.6 )
63 lirc? ( app-misc/lirc )
64 mad? ( media-libs/libmad
65 media-libs/libid3tag )
66 matroska? ( media-libs/libmatroska )
67 mozilla? ( >=net-www/mozilla-1.4 )
68 ncurses? ( sys-libs/ncurses )
69 nls? ( sys-devel/gettext )
70 oggvorbis? ( >=media-libs/libvorbis-1.0
71 >=media-libs/libogg-1.0 )
72 sdl? ( >=media-libs/libsdl-1.2.5 )
73 slp? ( >=net-libs/openslp-1.0.10 )
74 truetype? ( >=media-libs/freetype-2.1.4 )
75 wxwindows? ( >=x11-libs/wxGTK-2.4.1 )
76 xvid? ( >=media-libs/xvid-0.9.1 )
77 >=media-sound/lame-3.93.1
78 >=media-libs/libdvbpsi-0.1.2
79 >=media-libs/faad2-1.1
80 >=media-libs/a52dec-0.7.4
81 >=media-libs/flac-1.1.0"
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
100 # if qt3 is installed, patch vlc to work with it instead of qt2
101 ( use qt || use kde ) && ( \
102 if [ ${QTDIR} = "/usr/qt/3" ]
104 cp configure configure.orig
105 sed -e "s:-lkfile::" configure.orig > configure
107 cd ${S}/modules/gui/kde
108 cp interface.h interface.h.orig
109 sed -e "s:\(#include <kmainwindow.h>\):\1\n#include <kstatusbar.h>:" \
110 interface.h.orig > interface.h
112 cp preferences.cpp preferences.cpp.orig
113 sed -e 's:\("vlc preferences", true, false, \)\("Save\):\1(KGuiItem)\2:' \
114 preferences.cpp.orig > preferences.cpp
118 # Change the location of the glide headers
120 cp configure configure.orig
121 sed -e "s:/usr/include/glide:/usr/include/glide3:" configure.orig > configure
125 cp configure configure.orig
126 sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
127 configure.orig > configure
132 # configure and building of libmpeg2
134 econf --disable-sdl --without-x \
135 || die "./configure of libmpeg2 failed"
137 emake || make || die "make of libmpeg2 failed"
139 # configure and building of ffmpeg
142 use mmx || myconf="--disable-mmx"
144 ./configure ${myconf} \
146 --disable-vorbis || die "./configure of ffmpeg failed"
149 make || die "make of ffmpeg failed"
151 make || die "make of libpostproc failed"
153 # Configure and build VLC
157 use X || myconf="${myconf} --disable-x11"
159 use xv || myconf="${myconf} --disable-xvideo"
161 use ggi && myconf="${myconf} --enable-ggi"
163 use 3dfx && myconf="${myconf} --enable-glide"
165 use svga && myconf="${myconf} --enable-svgalib"
167 use sdl || myconf="${myconf} --disable-sdl"
169 use fbcon || myconf="${myconf} --disable-fb"
171 use aalib && myconf="${myconf} --enable-aa"
174 && myconf="${myconf} --enable-dvdread" \
175 || myconf="${myconf} \
181 use alsa && myconf="${myconf} --enable-alsa"
183 use oss || myconf="${myconf} --disable-oss"
185 use esd && myconf="${myconf} --enable-esd"
187 use arts && myconf="${myconf} --enable-arts"
189 use nls || myconf="${myconf} --disable-nls"
191 # the current gtk2 and gnome2 are prelimenary frameworks
193 && myconf="${myconf} --disable-gtk2" \
194 || myconf="${myconf} --disable-gtk --disable-gtk2"
196 use gnome && myconf="${myconf} --enable-gnome --disable-gnome2"
198 use ncurses && myconf="${myconf} --enable-ncurses"
200 use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
202 use lirc && myconf="${myconf} --enable-lirc"
204 use slp || myconf="${myconf} --disable-slp"
206 use mad || myconf="${myconf} --disable-mad"
208 # xvid is a local USE var, see /usr/portage/profiles/use.local.desc for more details
209 use xvid && myconf="${myconf} --enable-xvid"
211 use truetype || myconf="${myconf} --disable-freetype"
213 # v4l is a local USE var, see /usr/portage/profiles/use.local.desc for more details
214 use v4l && myconf="${myconf} --enable-v4l"
216 # If we use wxwindows and imlib, then we can also use skins
217 (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
219 # matroska is a local USE var.
220 # http://forums.gentoo.org/viewtopic.php?t=63722&highlight=matroska
221 use matroska && myconf="${myconf} --enable-mkv"
223 use dvb && myconf="${myconf} --enable-satellite"
225 # pvr is a local USE var, see /usr/portage/profiles/use.local.desc for more details
226 use pvr && myconf="${myconf} --enable-pvr"
228 if [ "`use mozilla`" ]; then
229 myconf="${myconf} --enable-mozilla \
230 MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
231 XPIDL=/usr/bin/xpidl"
235 && myconf="${myconf} --enable-debug" \
236 || myconf="${myconf} --enable-release"
238 # vlc uses its own ultraoptimizaed CXXFLAGS
239 # and forcing custom ones generally fails building
242 export WANT_AUTOCONF_2_5=1
243 export WANT_AUTOMAKE_1_6=1
245 # Avoid timestamp skews with autotools
250 touch `find . -name Makefile.in`
252 myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
253 --with-ffmpeg-mp3lame \
254 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
263 econf ${myconf} || die "configure of VLC failed"
265 # parallel make doesn't work with our complicated makefile
266 # this is also the reason as why you shouldn't run autoconf
267 # or automake yourself. (or bootstrap for that matter)
268 MAKEOPTS="${MAKEOPTS} -j1
269 emake || die "make of VLC failed"
274 einstall || die "make install failed"
276 dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
277 MAINTAINERS NEWS README* THANKS doc/ChangeLog-*