]> git.sesse.net Git - vlc/blob - vlc.ebuild
* NEWS: added an entry for the experimental matroska demux.
[vlc] / vlc.ebuild
1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.8 2003/06/22 15:03:33 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-20030622
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/${PN}/${PV}/${P}.tar.bz2
38                  http://www.videolan.org/pub/${PN}/${PV}/contrib/mpeg2dec-20030612.tar.bz2
39                  http://www.videolan.org/pub/${PN}/${PV}/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
104                 cd ${S}/modules/gui/kde
105                 cp interface.h interface.h.orig
106                 sed "s:\(#include <kmainwindow.h>\):\1\n#include <kstatusbar.h>:" \
107                         interface.h.orig > interface.h
108
109                 cp preferences.cpp preferences.cpp.orig
110                 sed 's:\("vlc preferences", true, false, \)\("Save\):\1(KGuiItem)\2:' \
111                         preferences.cpp.orig > preferences.cpp
112         fi
113         )
114         
115         # patch libmpeg2
116         cd ${SLIBMPEG2}
117         cp configure configure.orig
118         sed -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' \
119                 configure.orig > configure
120
121 }
122
123 src_compile(){
124         # configure and building of libmpeg2
125         cd ${SLIBMPEG2}
126         econf --disable-sdl --without-x \
127                 || die "./configure of libmpeg2 failed"
128         
129         emake || make || die "make of libmpeg2 failed"
130
131         # configure and building of ffmpeg
132         cd ${SFFMPEG}
133         myconf=""
134         use mmx || myconf="--disable-mmx"
135
136         ./configure ${myconf} \
137                 --disable-mp3lame \
138                 --disable-vorbis || die "./configure of ffmpeg failed"
139         
140         cd libavcodec
141         make || die "make of ffmpeg failed"
142         cd libpostproc
143         make || die "make of libpostproc failed"
144
145         # Configure and build VLC
146         cd ${S}
147         myconf=""
148
149         use X || myconf="${myconf} --disable-x11"
150
151         use xv || myconf="${myconf} --disable-xvideo"
152
153         use ggi && myconf="${myconf} --enable-ggi"
154
155         use 3dfx && myconf="${myconf} --enable-glide"
156
157         use matrox && myconf="${myconf} --enable-mga"
158
159         use svga && myconf="${myconf} --enable-svgalib"
160
161         use sdl || myconf="${myconf} --disable-sdl"
162
163         use fbcon || myconf="${myconf} --disable-fb"
164
165         use aalib && myconf="${myconf} --enable-aa"
166
167         use dvd \
168                 && myconf="${myconf} --enable-dvdread" \
169                 || myconf="${myconf} \
170                         --disable-dvd \
171                         --disable-dvdread \
172                         --disable-dvdplay \
173                         --disable-vcd"
174
175         use alsa && myconf="${myconf} --enable-alsa"
176
177         use oss || myconf="${myconf} --disable-oss"
178
179         use esd && myconf="${myconf} --enable-esd"
180
181         use arts && myconf="${myconf} --enable-arts"
182
183         use nls || myconf="${myconf} --disable-nls"
184
185         # the current gtk2 and gnome2 are prelimenary frameworks
186         use gtk \
187                 && myconf="${myconf} --disable-gtk2" \
188                 || myconf="${myconf} --disable-gtk --disable-gtk2"
189
190         use gnome && myconf="${myconf} --enable-gnome --disable-gnome2"
191
192         use kde && myconf="${myconf} --enable-kde"
193
194         use qt && myconf="${myconf} --enable-qt"
195
196         use ncurses && myconf="${myconf} --enable-ncurses"
197
198         use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
199
200         use lirc && myconf="${myconf} --enable-lirc"
201
202         use slp || myconf="${myconf} --disable-slp"
203
204         # xvid is a local USE var, see /usr/portage/profiles/use.local.desc for more details
205         use xvid && myconf="${myconf} --enable-xvid"
206
207         # v4l is a local USE var, see /usr/portage/profiles/use.local.desc for more details
208         use v4l && myconf="${myconf} --enable-v4l"
209
210         # wxwindows is a local USE var. already enabled by default, but depends on wxGTK
211         # but if we use wxwindows and imlib, then we can also use skins
212         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
213
214         # vlc uses its own ultraoptimizaed CXXFLAGS
215         # and forcing custom ones generally fails building
216         export CXXFLAGS=""
217         export CFLAGS=""
218         export WANT_AUTOCONF_2_5=1
219         export WANT_AUTOMAKE_1_6=1
220
221         myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
222                 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
223                 --enable-dvbpsi \
224                 --enable-release \
225                 --enable-mad \
226                 --enable-faad \
227                 --enable-a52"
228
229         ewarn ${myconf}
230         econf ${myconf} || die "configure of VLC failed"
231
232         # parallel make doesn't work with our complicated makefile
233         # this is also the reason as why you shouldn't run autoconf
234         # or automake yourself. (or bootstrap for that matter)
235         make || die "make of VLC failed"
236 }
237
238 src_install() {
239         
240         einstall || die "make install failed"
241
242         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
243         MAINTAINERS NEWS README* MODULES THANKS
244
245 }