]> git.sesse.net Git - vlc/blob - vlc.ebuild
* rawvideo.c, ffmpeg/chroma.c: added YVU9.
[vlc] / vlc.ebuild
1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003-2004 VideoLAN
5 # $Id: vlc.ebuild,v 1.25 2004/01/09 22:11:04 hartman Exp $
6 #
7 # Authors: Derk-Jan Hartman <hartman at videolan dot org>
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 # Some of the ideas in this ebuild are derived from the official Gentoo ebuild
24 # Thanks to the Gentoo Team for supporting us.
25 ###############################################################################
26
27 inherit libtool
28
29 # Missing support for...
30 #       tarkin - package not in portage yet - experimental
31 #       theora - package not in portage yet - experimental
32 #       tremor - package not in portage yet - experimental
33
34 inherit gcc
35
36 IUSE="arts ncurses dvd gtk nls 3dfx svga fbcon esd X alsa ggi speex
37       oggvorbis gnome xv oss sdl aalib slp bidi truetype v4l lirc 
38           wxwindows imlib matroska dvb mozilla debug faad xosd altivec png"
39
40 # Change these to correspond with the
41 # unpacked dirnames of the CVS snapshots.
42 PFFM=ffmpeg-20040103
43 PLIVE=live
44
45 S=${WORKDIR}/${P}
46 SFFM=${WORKDIR}/${PFFM}
47 SLIVE=${WORKDIR}/${PLIVE}
48
49 DESCRIPTION="VLC media player - Video player and streamer"
50 SRC_URI="http://download.videolan.org/pub/${PN}/${PV}/${P}.tar.bz2
51                  http://download.videolan.org/pub/${PN}/${PV}/contrib/ffmpeg-20040103.tar.bz2
52                  http://download.videolan.org/pub/${PN}/${PV}/contrib/live.2003.11.06.tar.gz"
53
54 HOMEPAGE="http://www.videolan.org/vlc"
55
56 SLOT="0"
57 LICENSE="GPL-2"
58 KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~amd64 ~ia64 ~ppc64"
59
60 DEPEND="X? ( virtual/x11 )
61         aalib? ( >=media-libs/aalib-1.4_rc4-r2 
62                         >=media-libs/libcaca-0.2 )
63         alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
64         dvb? ( media-libs/libdvb
65                 media-tv/linuxtv-dvb )
66         dvd? ( >=media-libs/libdvdread-0.9.4
67                 >=media-libs/libdvdcss-1.2.8
68                 >=media-libs/libdvdplay-1.0.1 )
69         esd? ( >=media-sound/esound-0.2.22 )
70         faad? ( >=media-libs/faad2-2.0-rc3 )
71         ggi? ( >=media-libs/libggi-2.0_beta3 )
72         gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
73         gtk? ( =x11-libs/gtk+-1.2* )
74         imlib? ( >=media-libs/imlib2-1.0.6 )
75         lirc? ( app-misc/lirc )
76         mad? ( media-libs/libmad
77                 media-libs/libid3tag )
78         matroska? ( >=media-libs/libmatroska-0.6.2 )
79         mozilla? ( >=net-www/mozilla-1.4 )
80         ncurses? ( sys-libs/ncurses )
81         nls? ( >=sys-devel/gettext-0.12.1 )
82         oggvorbis? ( >=media-libs/libvorbis-1.0
83                 >=media-libs/libogg-1.0 )
84         sdl? ( >=media-libs/libsdl-1.2.5 )
85         slp? ( >=net-libs/openslp-1.0.10 )
86         bidi? ( >=dev-libs/fribidi-0.10.4 )
87         truetype? ( >=media-libs/freetype-2.1.4 )
88         wxwindows? ( >=x11-libs/wxGTK-2.4.1 )
89         xosd? ( >=x11-libs/xosd-2.0 )
90         3dfx? ( media-libs/glide-v3 )
91         png? ( >=media-libs/libpng-1.2.5 )
92         speex? ( >=media-libs/speex-1.0.3 )
93         >=media-sound/lame-3.93.1
94         >=media-libs/libdvbpsi-0.1.3
95         >=media-libs/a52dec-0.7.4
96         >=media-libs/libmpeg2-0.4.0
97         >=media-libs/flac-1.1.0"
98
99 # mplayer is a required depandancy until the libpostproc code becomes
100 # a seperate package or until ffmpeg gets support for installing 
101 # the library
102
103 # liveMedia (live.com) is not a true library but needs to be 'imported'
104 # into your own sourcetree. This is against VLC coding policy.
105
106 src_unpack() {
107         
108         unpack ${A}
109
110         # Change the location of the glide headers
111         cd ${S}
112         sed -i \
113                 -e "s:/usr/include/glide:/usr/include/glide3:" \
114                 -e "s:glide2x:glide3:" \
115                 configure
116
117         cd ${S}/modules/video_output
118         epatch ${FILESDIR}/glide.patch
119         cd ${S}
120
121         # Avoid timestamp skews with autotools
122         touch configure.ac
123         touch aclocal.m4
124         touch configure
125         touch config.h.in
126         touch `find . -name Makefile.in`
127 }
128
129 src_compile(){
130         # configure and building of livedotcom
131         cd ${SLIVE}
132         ./genMakefiles linux || die "Creating liveMedia Makefiles failed."
133         make || die "liveMedia code failed to compile."
134         
135         # configure and building of ffmpeg
136         cd ${SFFM}
137         ./configure \
138                 --enable-mp3lame \
139                 --enable-pp \
140                 --disable-vorbis || die "ffmpeg failed to configure"
141         
142         cd libavcodec
143         make || die "ffmpeg->libavcodec failed to compile"
144         cd libpostproc
145         make || die "ffmpeg->libpostproc failed to compile"
146
147         # Configure and build VLC
148         cd ${S}
149         local myconf
150         myconf="--disable-mga --enable-flac --with-gnu-ld \
151                         --enable-a52 --enable-dvbpsi --enable-libmpeg2 \
152                         --disable-qt --disable-kde"
153
154     #--enable-pth                               GNU Pth support (default disabled)
155         #--enable-st                            State Threads (default disabled)
156         #--enable-gprof                         gprof profiling (default disabled)
157         #--enable-cprof                         cprof profiling (default disabled)
158         #--enable-mostly-builtin        most modules will be built-in (default enabled)
159         #--disable-optimizations        disable compiler optimizations (default disabled)
160         #--enable-testsuite                     build test modules (default disabled)
161         #--disable-plugins                      make all plugins built-in (default plugins enabled)
162
163         use debug && myconf="${myconf} --enable-debug" \
164                 || myconf="${myconf} --enable-release"
165         
166         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
167
168         use mozilla \
169                 && myconf="${myconf} --enable-mozilla \
170                 MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
171                 XPIDL=/usr/bin/xpidl"
172
173         # vlc uses its own ultraoptimizaed CXXFLAGS
174         # and forcing custom ones generally fails building
175         export CXXFLAGS=""
176         export CFLAGS=""
177         export WANT_AUTOCONF_2_5=1
178         export WANT_AUTOMAKE_1_6=1
179
180         myconf="${myconf} --enable-ffmpeg \
181                 --with-ffmpeg-tree=${SFFM} \
182                 --with-ffmpeg-mp3lame \
183                 --enable-livedotcom \
184                 --with-livedotcom-tree=${SLIVE}"
185
186         econf \
187                 `use_enable nls` \
188                 `use_enable slp` \
189                 `use_enable xosd` \
190                 `use_enable ncurses` \
191                 `use_enable alsa` \
192                 `use_enable esd` \
193                 `use_enable oss` \
194                 `use_enable ggi` \
195                 `use_enable sdl` \
196                 `use_enable mad` \
197                 `use_enable faad` \
198                 `use_enable v4l` \
199                 `use_enable dvd` \
200                 `use_enable dvd vcd` `use_enable dvdread` `use_enable dvd dvdplay` \
201                 `use_enable dvb satellite` `use_enable dvb pvr` \
202                 `use_enable joystick` `use_enable lirc` \
203                 `use_enable arts` \
204                 `use_enable gtk` `use_enable gnome` \
205                 `use_enable oggvorbis ogg` `use_enable oggvorbis vorbis` \
206                 `use_enable speex` \
207                 `use_enable matroska mkv` \
208                 `use_enable truetype freetype` \
209                 `use_enable bidi fribidi` \
210                 `use_enable svga svgalib` \
211                 `use_enable fbcon fb` \
212                 `use_enable aalib aa` `use_enable aalib caca` \
213                 `use_enable xv xvideo` \
214                 `use_enable X x11 ` \
215                 `use_enable 3dfx glide` \
216                 `use_enable altivec` \
217                 ${myconf} || die "configure of VLC failed"
218
219         if [ `gcc-major-version` -eq 2 ]; then
220                 sed -i s:"-fomit-frame-pointer":: vlc-config
221         fi
222
223         # parallel make doesn't work with our complicated makefile
224         # this is also the reason as why you shouldn't run autoconf
225         # or automake yourself. (or bootstrap for that matter)
226         MAKEOPTS="${MAKEOPTS} -j1"
227         emake || die "make of VLC failed"
228 }
229
230 src_install() {
231         
232         einstall || die "make install failed"
233
234         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
235         MAINTAINERS NEWS README* THANKS doc/ChangeLog-*
236
237 }