]> git.sesse.net Git - vlc/blob - vlc.ebuild
* caca 0.6 doesn't work with 0.7.0 remember? :)
[vlc] / vlc.ebuild
1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003 VideoLAN
5 # $Id: vlc.ebuild,v 1.22 2004/01/08 21:55:06 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 # 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 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         # Mozilla plugin related fix
111         epatch ${FILESDIR}/${PV}-mozilla-fix.patch
112
113         # Change the location of the glide headers
114         cd ${S}
115         sed -i \
116                 -e "s:/usr/include/glide:/usr/include/glide3:" \
117                 -e "s:glide2x:glide3:" \
118                 configure
119
120         cd ${S}/modules/video_output
121         epatch ${FILESDIR}/glide.patch
122         cd ${S}
123
124         # Avoid timestamp skews with autotools
125         touch configure.ac
126         touch aclocal.m4
127         touch configure
128         touch config.h.in
129         touch `find . -name Makefile.in`
130 }
131
132 src_compile(){
133         # configure and building of livedotcom
134         cd ${SLIVE}
135         ./genMakefiles linux || die "Creating liveMedia Makefiles failed."
136         make || die "liveMedia code failed to compile."
137         
138         # configure and building of ffmpeg
139         cd ${SFFM}
140         ./configure \
141                 --enable-mp3lame \
142                 --enable-pp \
143                 --disable-vorbis 
144                 `use_enable mmx` || die "ffmpeg failed to configure"
145         
146         cd libavcodec
147         make || die "ffmpeg->libavcodec failed to compile"
148         cd libpostproc
149         make || die "ffmpeg->libpostproc failed to compile"
150
151         # Configure and build VLC
152         cd ${S}
153         local myconf
154         myconf="--disable-mga --enable-flac --with-gnu-ld \
155                         --enable-a52 --enable-dvbpsi --enable-libmpeg2 \
156                         --disable-qt --disable-kde"
157
158     #--enable-pth                               GNU Pth support (default disabled)
159         #--enable-st                            State Threads (default disabled)
160         #--enable-gprof                         gprof profiling (default disabled)
161         #--enable-cprof                         cprof profiling (default disabled)
162         #--enable-mostly-builtin        most modules will be built-in (default enabled)
163         #--disable-optimizations        disable compiler optimizations (default disabled)
164         #--enable-testsuite                     build test modules (default disabled)
165         #--disable-plugins                      make all plugins built-in (default plugins enabled)
166
167         use debug && myconf="${myconf} --enable-debug" \
168                 || myconf="${myconf} --enable-release"
169         
170         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
171
172         use mozilla \
173                 && myconf="${myconf} --enable-mozilla \
174                 MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
175                 XPIDL=/usr/bin/xpidl"
176
177         # vlc uses its own ultraoptimizaed CXXFLAGS
178         # and forcing custom ones generally fails building
179         export CXXFLAGS=""
180         export CFLAGS=""
181         export WANT_AUTOCONF_2_5=1
182         export WANT_AUTOMAKE_1_6=1
183
184         myconf="${myconf} --enable-ffmpeg \
185                 --with-ffmpeg-tree=${SFFM} \
186                 --with-ffmpeg-mp3lame \
187                 --enable-livedotcom \
188                 --with-livedotcom-tree=${SLIVE}"
189
190         econf \
191                 `use_enable nls` \
192                 `use_enable slp` \
193                 `use_enable xosd` \
194                 `use_enable ncurses` \
195                 `use_enable alsa` \
196                 `use_enable esd` \
197                 `use_enable oss` \
198                 `use_enable ggi` \
199                 `use_enable sdl` \
200                 `use_enable mad` \
201                 `use_enable faad` \
202                 `use_enable v4l` \
203                 `use_enable dvd` \
204                 `use_enable dvd vcd` `use_enable dvdread` `use_enable dvd dvdplay` \
205                 `use_enable dvb satellite` `use_enable dvb pvr`
206                 `use_enable joystick` `use_enable lirc` \
207                 `use_enable arts` \
208                 `use_enable gtk` `use_enable gnome` \
209                 `use_enable oggvorbis ogg` `use_enable oggvorbis vorbis` \
210                 `use_enable speex` \
211                 `use_enable matroska mkv` \
212                 `use_enable truetype freetype` \
213                 `use_enable bidi fribidi` \
214                 `use_enable svga svgalib` \
215                 `use_enable fbcon fb` \
216                 `use_enable aalib aa` `use_enable aalib caca` \
217                 `use_enable xv xvideo` \
218                 `use_enable X x11 ` \
219                 `use_enable 3dfx glide` \
220                 `use_enable altivec` \
221                 ${myconf} || die "configure of VLC failed"
222
223         if [ `gcc-major-version` -eq 2 ]; then
224                 sed -i s:"-fomit-frame-pointer":: vlc-config
225         fi
226
227         # parallel make doesn't work with our complicated makefile
228         # this is also the reason as why you shouldn't run autoconf
229         # or automake yourself. (or bootstrap for that matter)
230         MAKEOPTS="${MAKEOPTS} -j1"
231         emake || die "make of VLC failed"
232 }
233
234 src_install() {
235         
236         einstall || die "make install failed"
237
238         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
239         MAINTAINERS NEWS README* THANKS doc/ChangeLog-*
240
241 }