]> git.sesse.net Git - vlc/blob - vlc.ebuild
Updated brazilian portuguese translation
[vlc] / vlc.ebuild
1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.19 2003/08/24 08:12:01 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 # Missing support for...
29 #       tarkin - package not in portage yet - experimental
30 #       theora - package not in portage yet - experimental
31 #       tremor - package not in portage yet - experimental
32
33 IUSE="arts ncurses dvd gtk nls 3dfx svga fbcon esd X alsa ggi
34       oggvorbis gnome xv oss sdl aalib slp truetype v4l xvid lirc 
35           wxwindows imlib matroska dvb mozilla debug faad xosd altivec"
36
37 # Change these to correspond with the
38 # unpacked dirnames of the CVS snapshots.
39 PFFMPEG=ffmpeg-20030813
40 PLIBMPEG2=mpeg2dec-20030612
41
42 S=${WORKDIR}/${P}
43 SFFMPEG=${WORKDIR}/${PFFMPEG}
44 SLIBMPEG2=${WORKDIR}/${PLIBMPEG2}
45
46 DESCRIPTION="VLC media player - Video player and streamer"
47 SRC_URI="http://www.videolan.org/pub/${PN}/${PV}/${P}.tar.bz2
48                  http://www.videolan.org/pub/${PN}/${PV}/contrib/mpeg2dec-20030612.tar.bz2
49                  http://www.videolan.org/pub/${PN}/${PV}/contrib/ffmpeg-20030813.tar.bz2"
50
51 HOMEPAGE="http://www.videolan.org/vlc"
52
53 SLOT="0"
54 LICENSE="GPL-2"
55 KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~amd64"
56
57 DEPEND="X? ( virtual/x11 )
58         aalib? ( >=media-libs/aalib-1.4_rc4-r2 )
59         alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
60         dvb? ( media-libs/libdvb
61                 media-tv/linuxtv-dvb )
62         dvd? ( >=media-libs/libdvdread-0.9.3
63                 >=media-libs/libdvdcss-1.2.8
64                 >=media-libs/libdvdplay-1.0.1 )
65         esd? ( >=media-sound/esound-0.2.22 )
66         faad? ( >=media-libs/faad2-1.1 )
67         ggi? ( >=media-libs/libggi-2.0_beta3 )
68         gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
69         gtk? ( =x11-libs/gtk+-1.2* )
70         imlib? ( >=media-libs/imlib2-1.0.6 )
71         lirc? ( app-misc/lirc )
72         mad? ( media-libs/libmad
73                 media-libs/libid3tag )
74         matroska? ( >=media-libs/libmatroska-0.4.4 )
75         mozilla? ( >=net-www/mozilla-1.4 )
76         ncurses? ( sys-libs/ncurses )
77         nls? ( sys-devel/gettext )
78         oggvorbis? ( >=media-libs/libvorbis-1.0
79                 >=media-libs/libogg-1.0 )
80         sdl? ( >=media-libs/libsdl-1.2.5 )
81         slp? ( >=net-libs/openslp-1.0.10 )
82         truetype? ( >=media-libs/freetype-2.1.4 )
83         wxwindows? ( >=x11-libs/wxGTK-2.4.1 )
84         xosd? ( >=x11-libs/xosd-2.0 )
85         xvid? ( >=media-libs/xvid-0.9.1 )
86         3dfx? ( media-libs/glide-v3 )
87         >=media-sound/lame-3.93.1
88         >=media-libs/libdvbpsi-0.1.3
89         >=media-libs/a52dec-0.7.4
90         >=media-libs/flac-1.1.0"
91
92 inherit gcc
93
94 src_unpack() {
95         
96         unpack ${A}
97         cd ${S}
98
99         # Change the location of the glide headers
100         cd ${S}
101         sed -i -e "s:/usr/include/glide:/usr/include/glide3:" configure
102         sed -i -e "s:glide2x:glide3:" configure
103         cd ${S}/modules/video_output
104         epatch ${FILESDIR}/glide.patch
105         cd ${S}
106         
107         # patch libmpeg2
108         cd ${SLIBMPEG2}
109         sed -i -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' configure
110
111 }
112
113 src_compile(){
114         # configure and building of libmpeg2
115         cd ${SLIBMPEG2}
116         econf --disable-sdl --without-x \
117                 || die "./configure of libmpeg2 failed"
118         
119         emake || make || die "make of libmpeg2 failed"
120
121         # configure and building of ffmpeg
122         cd ${SFFMPEG}
123         local myconf
124         use mmx || myconf="--disable-mmx"
125
126         ./configure ${myconf} \
127                 --enable-mp3lame \
128                 --disable-vorbis || die "./configure of ffmpeg failed"
129         
130         cd libpostproc
131         make || die "make of libpostproc failed"
132         cd libavcodec
133         make || die "make of libavcodec failed"
134
135         # Configure and build VLC
136         cd ${S}
137         
138         # Avoid timestamp skews with autotools
139         touch configure.ac
140         touch aclocal.m4
141         touch configure
142         touch config.h.in
143         touch `find . -name Makefile.in`
144         
145         local myconf
146         myconf="--disable-mga --enable-flac --with-gnu-ld"
147
148     #--enable-pth                               GNU Pth support (default disabled)
149         #--enable-st                            State Threads (default disabled)
150         #--enable-gprof                         gprof profiling (default disabled)
151         #--enable-cprof                         cprof profiling (default disabled)
152         #--enable-mostly-builtin        most modules will be built-in (default enabled)
153         #--disable-optimizations        disable compiler optimizations (default disabled)
154         #--enable-testsuite                     build test modules (default disabled)
155         #--disable-plugins                      make all plugins built-in (default disabled)
156
157         use nls || myconf="${myconf} --disable-nls"
158         
159         use debug && myconf="${myconf} --enable-debug" \
160                 || myconf="${myconf} --enable-release"
161         
162         use dvd \
163                 && myconf="${myconf} --enable-dvdread" \
164                 || myconf="${myconf} \
165                         --disable-dvd \
166                         --disable-dvdread \
167                         --disable-dvdplay \
168                         --disable-vcd"
169
170         use v4l && myconf="${myconf} --enable-v4l"
171
172         use dvb && myconf="${myconf} --enable-satellite --enable-pvr --enable-dvb"
173
174         use oggvorbis || myconf="${myconf} --disable-vorbis --disable-ogg"
175
176         use matroska || myconf="${myconf} --disable-mkv"
177
178         use mad || myconf="${myconf} --disable-mad"
179
180         use faad && myconf="${myconf} --enable-faad"
181
182         use xvid && myconf="${myconf} --enable-xvid"
183
184         use X || myconf="${myconf} --disable-x11"
185
186         use xv || myconf="${myconf} --disable-xvideo"
187
188         use sdl || myconf="${myconf} --disable-sdl"
189
190         use truetype || myconf="${myconf} --disable-freetype"
191
192         use fbcon || myconf="${myconf} --disable-fb"
193
194         use svga && myconf="${myconf} --enable-svgalib"
195
196         use ggi && myconf="${myconf} --enable-ggi"
197
198         use 3dfx && myconf="${myconf} --enable-glide"
199
200         use aalib && myconf="${myconf} --enable-aa"
201
202         use oss || myconf="${myconf} --disable-oss"
203
204         use esd && myconf="${myconf} --enable-esd"
205
206         use arts && myconf="${myconf} --enable-arts"
207
208         use alsa && myconf="${myconf} --enable-alsa"
209
210         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
211
212         use gtk || myconf="${myconf} --disable-gtk"
213
214         use gnome && myconf="${myconf} --enable-gnome"
215
216         use ncurses && myconf="${myconf} --enable-ncurses"
217
218         use xosd && myconf="${myconf} --enable-xosd"
219
220         use slp || myconf="${myconf} --disable-slp"
221
222         use lirc && myconf="${myconf} --enable-lirc"
223
224         use joystick && myconf="${myconf} --enable-joystick"
225
226         use mozilla && \
227                 myconf="${myconf} --enable-mozilla \
228             MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
229             XPIDL=/usr/bin/xpidl"
230
231         use altivec || myconf="${myconf} --disable-altivec"
232
233         # vlc uses its own ultraoptimizaed CXXFLAGS
234         # and forcing custom ones generally fails building
235         export CXXFLAGS=""
236         export CFLAGS=""
237         export WANT_AUTOCONF_2_5=1
238         export WANT_AUTOMAKE_1_6=1
239
240         myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
241                 --with-ffmpeg-mp3lame \
242                 --enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
243                 --enable-flac \
244                 --disable-kde \
245                 --disable-qt"
246
247         econf ${myconf} || die "configure of VLC failed"
248
249         if [ `gcc-major-version` -eq 2 ]; then
250                 sed -i s:"-fomit-frame-pointer":: vlc-config
251         fi
252
253         # parallel make doesn't work with our complicated makefile
254         # this is also the reason as why you shouldn't run autoconf
255         # or automake yourself. (or bootstrap for that matter)
256         MAKEOPTS="${MAKEOPTS} -j1"
257         emake || die "make of VLC failed"
258 }
259
260 src_install() {
261         
262         einstall || die "make install failed"
263
264         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
265         MAINTAINERS NEWS README* THANKS doc/ChangeLog-*
266
267 }