1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.17 2003/07/20 20:54:01 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 qt ncurses dvd gtk nls 3dfx svga fbcon esd kde 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 kde? ( kde-base/kdelibs )
64 lirc? ( app-misc/lirc )
65 mad? ( media-libs/libmad
66 media-libs/libid3tag )
67 matroska? ( media-libs/libmatroska )
68 mozilla? ( >=net-www/mozilla-1.4 )
69 ncurses? ( sys-libs/ncurses )
70 nls? ( sys-devel/gettext )
71 oggvorbis? ( >=media-libs/libvorbis-1.0
72 >=media-libs/libogg-1.0 )
74 sdl? ( >=media-libs/libsdl-1.2.5 )
75 slp? ( >=net-libs/openslp-1.0.10 )
76 truetype? ( >=media-libs/freetype-2.1.4 )
77 wxwindows? ( >=x11-libs/wxGTK-2.4.1 )
78 xvid? ( >=media-libs/xvid-0.9.1 )
79 >=media-sound/lame-3.93.1
80 >=media-libs/libdvbpsi-0.1.2
81 >=media-libs/faad2-1.1
82 >=media-libs/a52dec-0.7.4
83 >=media-libs/flac-1.1.0"
90 # get kde and arts paths
91 if [ -n "`use kde`" -o -n "`use arts`" ]; then
94 # $KDEDIR is now set to arts/kdelibs location
102 # if qt3 is installed, patch vlc to work with it instead of qt2
103 ( use qt || use kde ) && ( \
104 if [ ${QTDIR} = "/usr/qt/3" ]
106 cp configure configure.orig
107 sed -e "s:-lkfile::" configure.orig > configure
109 cd ${S}/modules/gui/kde
110 cp interface.h interface.h.orig
111 sed -e "s:\(#include <kmainwindow.h>\):\1\n#include <kstatusbar.h>:" \
112 interface.h.orig > interface.h
114 cp preferences.cpp preferences.cpp.orig
115 sed -e 's:\("vlc preferences", true, false, \)\("Save\):\1(KGuiItem)\2:' \
116 preferences.cpp.orig > preferences.cpp
120 # Change the location of the glide headers
122 cp configure configure.orig
123 sed -e "s:/usr/include/glide:/usr/include/glide3:" configure.orig > configure
127 cp configure configure.orig
128 sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
129 configure.orig > configure
134 # configure and building of libmpeg2
136 econf --disable-sdl --without-x \
137 || die "./configure of libmpeg2 failed"
139 emake || make || die "make of libmpeg2 failed"
141 # configure and building of ffmpeg
144 use mmx || myconf="--disable-mmx"
146 ./configure ${myconf} \
148 --disable-vorbis || die "./configure of ffmpeg failed"
151 make || die "make of ffmpeg failed"
153 make || die "make of libpostproc failed"
155 # Configure and build VLC
159 use X || myconf="${myconf} --disable-x11"
161 use xv || myconf="${myconf} --disable-xvideo"
163 use ggi && myconf="${myconf} --enable-ggi"
165 use 3dfx && myconf="${myconf} --enable-glide"
167 use svga && myconf="${myconf} --enable-svgalib"
169 use sdl || myconf="${myconf} --disable-sdl"
171 use fbcon || myconf="${myconf} --disable-fb"
173 use aalib && myconf="${myconf} --enable-aa"
176 && myconf="${myconf} --enable-dvdread" \
177 || myconf="${myconf} \
183 use alsa && myconf="${myconf} --enable-alsa"
185 use oss || myconf="${myconf} --disable-oss"
187 use esd && myconf="${myconf} --enable-esd"
189 use arts && myconf="${myconf} --enable-arts"
191 use nls || myconf="${myconf} --disable-nls"
193 # the current gtk2 and gnome2 are prelimenary frameworks
195 && myconf="${myconf} --disable-gtk2" \
196 || myconf="${myconf} --disable-gtk --disable-gtk2"
198 use gnome && myconf="${myconf} --enable-gnome --disable-gnome2"
200 use kde && myconf="${myconf} --enable-kde"
202 use qt && myconf="${myconf} --enable-qt"
204 use ncurses && myconf="${myconf} --enable-ncurses"
206 use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
208 use lirc && myconf="${myconf} --enable-lirc"
210 use slp || myconf="${myconf} --disable-slp"
212 use mad && myconf="${myconf} --enable-mad"
214 # xvid is a local USE var, see /usr/portage/profiles/use.local.desc for more details
215 use xvid && myconf="${myconf} --enable-xvid"
217 use truetype && myconf="${myconf} --enable-freetype"
219 # v4l is a local USE var, see /usr/portage/profiles/use.local.desc for more details
220 use v4l && myconf="${myconf} --enable-v4l"
222 # If we use wxwindows and imlib, then we can also use skins
223 (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
225 # matroska is a local USE var.
226 # http://forums.gentoo.org/viewtopic.php?t=63722&highlight=matroska
227 use matroska && myconf="${myconf} --enable-mkv"
229 use dvb && myconf="${myconf} --enable-satellite"
231 # pvr is a local USE var, see /usr/portage/profiles/use.local.desc for more details
232 use pvr && myconf="${myconf} --enable-pvr"
234 if [ "`use mozilla`" ]; then
235 myconf="${myconf} --enable-mozilla \
236 MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
237 XPIDL=/usr/bin/xpidl"
241 && myconf="${myconf} --enable-debug" \
242 || myconf="${myconf} --enable-release"
244 # vlc uses its own ultraoptimizaed CXXFLAGS
245 # and forcing custom ones generally fails building
248 export WANT_AUTOCONF_2_5=1
249 export WANT_AUTOMAKE_1_6=1
251 # Avoid timestamp skews with autotools
256 touch `find . -name Makefile.in`
258 myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
259 --with-ffmpeg-mp3lame \
260 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
267 econf ${myconf} || die "configure of VLC failed"
269 # parallel make doesn't work with our complicated makefile
270 # this is also the reason as why you shouldn't run autoconf
271 # or automake yourself. (or bootstrap for that matter)
272 MAKEOPTS="${MAKEOPTS} -j1
273 emake || die "make of VLC failed"
278 einstall || die "make install failed"
280 dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
281 MAINTAINERS NEWS README* THANKS doc/ChangeLog-*