]> git.sesse.net Git - vlc/blob - vlc.ebuild
* ./doc/skins/events-howto.txt: added some events
[vlc] / vlc.ebuild
1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.6 2003/06/20 01:27:55 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 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"
24
25 # Change these to correspond with the
26 # unpacked dirnames of the CVS snapshots.
27 PFFMPEG=ffmpeg-20030612
28 PLIBMPEG2=mpeg2dec-20030612
29
30 S=${WORKDIR}/${P}
31 SFFMPEG=${WORKDIR}/${PFFMPEG}
32 SLIBMPEG2=${WORKDIR}/${PLIBMPEG2}
33
34 DESCRIPTION="VLC media player - A videoplayer that plays DVD,
35              VCD, files and networkstreams o.a."
36
37 SRC_URI="http://www.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.bz2
38                  http://www.videolan.org/pub/testing/contrib/mpeg2dec-20030612.tar.bz2
39                  http://www.videolan.org/pub/testing/contrib/ffmpeg-20030612.tar.bz2"
40
41 HOMEPAGE="http://www.videolan.org/vlc"
42
43 SLOT="0"
44 LICENSE="GPL-2"
45 KEYWORDS="~x86 ~ppc"
46
47 DEPEND="X? ( virtual/x11 )
48         nls? ( sys-devel/gettext )
49         qt? ( x11-libs/qt )
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
78
79 # not in gentoo
80 #       tarkin
81 #       theora
82 #       tremor
83
84 # get kde and arts paths
85 if [ -n "`use kde`" -o -n "`use arts`" ]; then
86     inherit kde-functions
87     set-kdedir 3
88     # $KDEDIR is now set to arts/kdelibs location
89 fi
90
91 src_unpack() {
92         
93         unpack ${A}
94         cd ${S}
95
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" ]
99         then
100                 cp configure.ac configure.ac.orig
101                 sed "s:-lkfile::" \
102                         configure.ac.orig > configure.ac
103                 # adding configure.ac.in
104                 cp configure.ac.in configure.ac.in.orig
105                 sed "s:-lkfile::" \
106                         configure.ac.in.orig > configure.ac.in
107
108                 cd ${S}/modules/gui/kde
109                 cp interface.h interface.h.orig
110                 sed "s:\(#include <kmainwindow.h>\):\1\n#include <kstatusbar.h>:" \
111                         interface.h.orig > interface.h
112
113                 cp preferences.cpp preferences.cpp.orig
114                 sed 's:\("vlc preferences", true, false, \)\("Save\):\1(KGuiItem)\2:' \
115                         preferences.cpp.orig > preferences.cpp
116         fi
117         )
118         
119         # patch libmpeg2
120         cd ${SLIBMPEG2}
121         cp configure configure.orig
122         sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
123                 configure.orig > configure
124
125 }
126
127 src_compile(){
128         # configure and building of libmpeg2
129         cd ${SLIBMPEG2}
130         econf --disable-sdl --without-x \
131                 || die "./configure of libmpeg2 failed"
132         
133         emake || make || die "make of libmpeg2 failed"
134
135         # configure and building of ffmpeg
136         cd ${SFFMPEG}
137         myconf=""
138         use mmx || myconf="--disable-mmx"
139
140         ./configure ${myconf} \
141                 --disable-mp3lame \
142                 --disable-vorbis || die "./configure of ffmpeg failed"
143         
144         cd libavcodec
145         make || die "make of ffmpeg failed"
146         cd libpostproc
147         make || die "make of libpostproc failed"
148
149         # Configure and build VLC
150         cd ${S}
151         myconf=""
152
153         use X || myconf="${myconf} --disable-x11"
154
155         use xv || myconf="${myconf} --disable-xvideo"
156
157         use ggi && myconf="${myconf} --enable-ggi"
158
159         use 3dfx && myconf="${myconf} --enable-glide"
160
161         use matrox && myconf="${myconf} --enable-mga"
162
163         use svga && myconf="${myconf} --enable-svgalib"
164
165         use sdl || myconf="${myconf} --disable-sdl"
166
167         use fbcon || myconf="${myconf} --disable-fb"
168
169         use aalib && myconf="${myconf} --enable-aa"
170
171         use dvd \
172                 && myconf="${myconf} --enable-dvdread" \
173                 || myconf="${myconf} \
174                         --disable-dvd \
175                         --disable-dvdread \
176                         --disable-dvdplay \
177                         --disable-vcd"
178
179         use alsa && myconf="${myconf} --enable-alsa"
180
181         use oss || myconf="${myconf} --disable-oss"
182
183         use esd && myconf="${myconf} --enable-esd"
184
185         use arts && myconf="${myconf} --enable-arts"
186
187         use nls || myconf="${myconf} --disable-nls"
188
189         # the current gtk2 and gnome2 are prelimenary frameworks
190         use gtk \
191                 && myconf="${myconf} --disable-gtk2" \
192                 || myconf="${myconf} --disable-gtk --disable-gtk2"
193
194         use gnome && myconf="${myconf} --enable-gnome --disable-gnome2"
195
196         use kde && myconf="${myconf} --enable-kde"
197
198         use qt && myconf="${myconf} --enable-qt"
199
200         use ncurses && myconf="${myconf} --enable-ncurses"
201
202         use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
203
204         use lirc && myconf="${myconf} --enable-lirc"
205
206         use slp || myconf="${myconf} --disable-slp"
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         # v4l is a local USE var, see /usr/portage/profiles/use.local.desc for more details
212         use v4l && myconf="${myconf} --enable-v4l"
213
214         # wxwindows is a local USE var. already enabled by default, but depends on wxGTK
215         # but if we use wxwindows and imlib, then we can also use skins
216         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
217
218         # vlc uses its own ultraoptimizaed CXXFLAGS
219         # and forcing custom ones generally fails building
220         export CXXFLAGS=""
221         export CFLAGS=""
222         export WANT_AUTOCONF_2_5=1
223         export WANT_AUTOMAKE_1_6=1
224
225         myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
226                 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
227                 --enable-dvbpsi \
228                 --enable-release \
229                 --enable-mad \
230                 --enable-faad \
231                 --enable-a52"
232
233         ewarn ${myconf}
234         econf ${myconf} || die "configure of VLC failed"
235
236         # parallel make doesn't work with our complicated makefile
237         # this is also the reason as why you shouldn't run autoconf
238         # or automake yourself. (or bootstrap for that matter)
239         make || die "make of VLC failed"
240 }
241
242 src_install() {
243         
244         einstall || die "make install failed"
245
246         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
247         MAINTAINERS NEWS README* MODULES THANKS
248
249 }