]> git.sesse.net Git - vlc/blob - vlc.ebuild
* src/input/input_ext-plugins.c: fixed previous commit.
[vlc] / vlc.ebuild
1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.16 2003/07/20 19:48:30 hartman Exp $
6 #
7 # Authors: Derk-Jan Hartman <thedj at users.sf.net>
8 #
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.
13
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.
18 #
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 ###############################################################################
27
28 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 lirc wxwindows imlib matroska dvb pvr mozilla mad debug xvid"
29
30 # Change these to correspond with the
31 # unpacked dirnames of the CVS snapshots.
32 PFFMPEG=ffmpeg-20030622
33 PLIBMPEG2=mpeg2dec-20030612
34
35 S=${WORKDIR}/${P}
36 SFFMPEG=${WORKDIR}/${PFFMPEG}
37 SLIBMPEG2=${WORKDIR}/${PLIBMPEG2}
38
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"
43
44 HOMEPAGE="http://www.videolan.org/vlc"
45
46 SLOT="0"
47 LICENSE="GPL-2"
48 KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~amd64"
49
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 )
73         qt? ( x11-libs/qt )
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"
84
85 # Missing support for
86 #       tarkin
87 #       theora
88 #       tremor
89
90 # get kde and arts paths
91 if [ -n "`use kde`" -o -n "`use arts`" ]; then
92     inherit kde-functions
93     set-kdedir 3
94     # $KDEDIR is now set to arts/kdelibs location
95 fi
96
97 src_unpack() {
98         
99         unpack ${A}
100         cd ${S}
101
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" ]
105         then
106                 cp configure configure.orig
107                 sed -e "s:-lkfile::" configure.orig > configure
108
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
113
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
117         fi
118         )
119
120         # Change the location of the glide headers
121         cd ${S}
122         cp configure configure.orig
123         sed -e "s:/usr/include/glide:/usr/include/glide3:" configure.orig > configure
124         
125         # patch libmpeg2
126         cd ${SLIBMPEG2}
127         cp configure configure.orig
128         sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
129                 configure.orig > configure
130
131 }
132
133 src_compile(){
134         # configure and building of libmpeg2
135         cd ${SLIBMPEG2}
136         econf --disable-sdl --without-x \
137                 || die "./configure of libmpeg2 failed"
138         
139         emake || make || die "make of libmpeg2 failed"
140
141         # configure and building of ffmpeg
142         cd ${SFFMPEG}
143         myconf=""
144         use mmx || myconf="--disable-mmx"
145
146         ./configure ${myconf} \
147                 --enable-mp3lame \
148                 --disable-vorbis || die "./configure of ffmpeg failed"
149         
150         cd libavcodec
151         make || die "make of ffmpeg failed"
152         cd libpostproc
153         make || die "make of libpostproc failed"
154
155         # Configure and build VLC
156         cd ${S}
157         myconf=""
158
159         use X || myconf="${myconf} --disable-x11"
160
161         use xv || myconf="${myconf} --disable-xvideo"
162
163         use ggi && myconf="${myconf} --enable-ggi"
164
165         use 3dfx && myconf="${myconf} --enable-glide"
166
167         use matrox && myconf="${myconf} --enable-mga"
168
169         use svga && myconf="${myconf} --enable-svgalib"
170
171         use sdl || myconf="${myconf} --disable-sdl"
172
173         use fbcon || myconf="${myconf} --disable-fb"
174
175         use aalib && myconf="${myconf} --enable-aa"
176
177         use dvd \
178                 && myconf="${myconf} --enable-dvdread" \
179                 || myconf="${myconf} \
180                         --disable-dvd \
181                         --disable-dvdread \
182                         --disable-dvdplay \
183                         --disable-vcd"
184
185         use alsa && myconf="${myconf} --enable-alsa"
186
187         use oss || myconf="${myconf} --disable-oss"
188
189         use esd && myconf="${myconf} --enable-esd"
190
191         use arts && myconf="${myconf} --enable-arts"
192
193         use nls || myconf="${myconf} --disable-nls"
194
195         # the current gtk2 and gnome2 are prelimenary frameworks
196         use gtk \
197                 && myconf="${myconf} --disable-gtk2" \
198                 || myconf="${myconf} --disable-gtk --disable-gtk2"
199
200         use gnome && myconf="${myconf} --enable-gnome --disable-gnome2"
201
202         use kde && myconf="${myconf} --enable-kde"
203
204         use qt && myconf="${myconf} --enable-qt"
205
206         use ncurses && myconf="${myconf} --enable-ncurses"
207
208         use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
209
210         use lirc && myconf="${myconf} --enable-lirc"
211
212         use slp || myconf="${myconf} --disable-slp"
213
214         use mad && myconf="${myconf} --enable-mad"
215
216         # xvid is a local USE var, see /usr/portage/profiles/use.local.desc for more details
217         use xvid && myconf="${myconf} --enable-xvid"
218
219         use truetype && myconf="${myconf} --enable-freetype"
220
221         # v4l is a local USE var, see /usr/portage/profiles/use.local.desc for more details
222         use v4l && myconf="${myconf} --enable-v4l"
223
224         # If we use wxwindows and imlib, then we can also use skins
225         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
226
227         # matroska is a local USE var. 
228         # http://forums.gentoo.org/viewtopic.php?t=63722&highlight=matroska
229         use matroska && myconf="${myconf} --enable-mkv"
230
231         use dvb && myconf="${myconf} --enable-satellite"
232
233         # pvr is a local USE var, see /usr/portage/profiles/use.local.desc for more details
234         use pvr && myconf="${myconf} --enable-pvr"
235
236         if [ "`use mozilla`" ]; then
237           myconf="${myconf} --enable-mozilla \
238             MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
239             XPIDL=/usr/bin/xpidl"
240         fi
241
242         use debug \
243                 && myconf="${myconf} --enable-debug" \
244                 || myconf="${myconf} --enable-release"
245
246         # vlc uses its own ultraoptimizaed CXXFLAGS
247         # and forcing custom ones generally fails building
248         export CXXFLAGS=""
249         export CFLAGS=""
250         export WANT_AUTOCONF_2_5=1
251         export WANT_AUTOMAKE_1_6=1
252
253         # Avoid timestamp skews with autotools
254         touch configure.ac
255         touch aclocal.m4
256         touch configure
257         touch config.h.in
258         touch `find . -name Makefile.in`
259
260         myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
261                 --with-ffmpeg-mp3lame \
262                 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
263                 --enable-dvbpsi \
264                 --enable-faad \
265                 --enable-flac \
266                 --enable-a52"
267
268         ewarn ${myconf}
269         econf ${myconf} || die "configure of VLC failed"
270
271         # parallel make doesn't work with our complicated makefile
272         # this is also the reason as why you shouldn't run autoconf
273         # or automake yourself. (or bootstrap for that matter)
274         MAKEOPTS="${MAKEOPTS} -j1
275         emake || die "make of VLC failed"
276 }
277
278 src_install() {
279         
280         einstall || die "make install failed"
281
282         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
283         MAINTAINERS NEWS README* THANKS doc/ChangeLog-*
284
285 }