]> git.sesse.net Git - vlc/blob - vlc.ebuild
* httpd: added HEAD command support.
[vlc] / vlc.ebuild
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 $
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 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"
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         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"
82
83 # Missing support for
84 #       tarkin
85 #       theora
86 #       tremor
87
88 # get kde and arts paths
89 if [ -n "`use kde`" -o -n "`use arts`" ]; then
90     inherit kde-functions
91     set-kdedir 3
92     # $KDEDIR is now set to arts/kdelibs location
93 fi
94
95 src_unpack() {
96         
97         unpack ${A}
98         cd ${S}
99
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" ]
103         then
104                 cp configure configure.orig
105                 sed -e "s:-lkfile::" configure.orig > configure
106
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
111
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
115         fi
116         )
117
118         # Change the location of the glide headers
119         cd ${S}
120         cp configure configure.orig
121         sed -e "s:/usr/include/glide:/usr/include/glide3:" configure.orig > configure
122         
123         # patch libmpeg2
124         cd ${SLIBMPEG2}
125         cp configure configure.orig
126         sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
127                 configure.orig > configure
128
129 }
130
131 src_compile(){
132         # configure and building of libmpeg2
133         cd ${SLIBMPEG2}
134         econf --disable-sdl --without-x \
135                 || die "./configure of libmpeg2 failed"
136         
137         emake || make || die "make of libmpeg2 failed"
138
139         # configure and building of ffmpeg
140         cd ${SFFMPEG}
141         myconf=""
142         use mmx || myconf="--disable-mmx"
143
144         ./configure ${myconf} \
145                 --enable-mp3lame \
146                 --disable-vorbis || die "./configure of ffmpeg failed"
147         
148         cd libavcodec
149         make || die "make of ffmpeg failed"
150         cd libpostproc
151         make || die "make of libpostproc failed"
152
153         # Configure and build VLC
154         cd ${S}
155         myconf=""
156
157         use X || myconf="${myconf} --disable-x11"
158
159         use xv || myconf="${myconf} --disable-xvideo"
160
161         use ggi && myconf="${myconf} --enable-ggi"
162
163         use 3dfx && myconf="${myconf} --enable-glide"
164
165         use svga && myconf="${myconf} --enable-svgalib"
166
167         use sdl || myconf="${myconf} --disable-sdl"
168
169         use fbcon || myconf="${myconf} --disable-fb"
170
171         use aalib && myconf="${myconf} --enable-aa"
172
173         use dvd \
174                 && myconf="${myconf} --enable-dvdread" \
175                 || myconf="${myconf} \
176                         --disable-dvd \
177                         --disable-dvdread \
178                         --disable-dvdplay \
179                         --disable-vcd"
180
181         use alsa && myconf="${myconf} --enable-alsa"
182
183         use oss || myconf="${myconf} --disable-oss"
184
185         use esd && myconf="${myconf} --enable-esd"
186
187         use arts && myconf="${myconf} --enable-arts"
188
189         use nls || myconf="${myconf} --disable-nls"
190
191         # the current gtk2 and gnome2 are prelimenary frameworks
192         use gtk \
193                 && myconf="${myconf} --disable-gtk2" \
194                 || myconf="${myconf} --disable-gtk --disable-gtk2"
195
196         use gnome && myconf="${myconf} --enable-gnome --disable-gnome2"
197
198         use ncurses && myconf="${myconf} --enable-ncurses"
199
200         use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
201
202         use lirc && myconf="${myconf} --enable-lirc"
203
204         use slp || myconf="${myconf} --disable-slp"
205
206         use mad || myconf="${myconf} --disable-mad"
207
208         # xvid is a local USE var, see /usr/portage/profiles/use.local.desc for more details
209         use xvid && myconf="${myconf} --enable-xvid"
210
211         use truetype || myconf="${myconf} --disable-freetype"
212
213         # v4l is a local USE var, see /usr/portage/profiles/use.local.desc for more details
214         use v4l && myconf="${myconf} --enable-v4l"
215
216         # If we use wxwindows and imlib, then we can also use skins
217         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
218
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"
222
223         use dvb && myconf="${myconf} --enable-satellite"
224
225         # pvr is a local USE var, see /usr/portage/profiles/use.local.desc for more details
226         use pvr && myconf="${myconf} --enable-pvr"
227
228         if [ "`use mozilla`" ]; then
229           myconf="${myconf} --enable-mozilla \
230             MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
231             XPIDL=/usr/bin/xpidl"
232         fi
233
234         use debug \
235                 && myconf="${myconf} --enable-debug" \
236                 || myconf="${myconf} --enable-release"
237
238         # vlc uses its own ultraoptimizaed CXXFLAGS
239         # and forcing custom ones generally fails building
240         export CXXFLAGS=""
241         export CFLAGS=""
242         export WANT_AUTOCONF_2_5=1
243         export WANT_AUTOMAKE_1_6=1
244
245         # Avoid timestamp skews with autotools
246         touch configure.ac
247         touch aclocal.m4
248         touch configure
249         touch config.h.in
250         touch `find . -name Makefile.in`
251
252         myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
253                 --with-ffmpeg-mp3lame \
254                 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
255                 --enable-dvbpsi \
256                 --enable-faad \
257                 --enable-flac \
258                 --enable-a52 \
259                 --disable-kde \
260                 --disable-qt"
261
262         ewarn ${myconf}
263         econf ${myconf} || die "configure of VLC failed"
264
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"
270 }
271
272 src_install() {
273         
274         einstall || die "make install failed"
275
276         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
277         MAINTAINERS NEWS README* THANKS doc/ChangeLog-*
278
279 }