]> git.sesse.net Git - vlc/blob - vlc.ebuild
Small update to ARM cross-compile howto
[vlc] / vlc.ebuild
1 ###############################################################################
2 # vlc.ebuild: A Gentoo ebuild for vlc
3 ###############################################################################
4 # Copyright (C) 2003-2004 VideoLAN
5 # $Id$
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 gcc eutils
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 IUSE="arts ncurses dvd gtk nls 3dfx svga fbcon esd X alsa ggi speex
35       oggvorbis gnome xv oss sdl aalib slp bidi truetype v4l lirc 
36           wxwindows imlib matroska dvb pvr satellite mozilla debug faad
37           xosd altivec png dts"
38
39 S=${WORKDIR}/${P}
40
41 DESCRIPTION="VLC media player - Video player and streamer"
42 SRC_URI="http://download.videolan.org/pub/${PN}/${PV}/${P}.tar.bz2"
43
44 HOMEPAGE="http://www.videolan.org/vlc"
45
46 SLOT="0"
47 LICENSE="GPL-2"
48 KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~amd64 ~ia64 ~ppc64"
49
50 RDEPEND="X? ( virtual/x11 )
51         aalib? ( >=media-libs/aalib-1.4_rc4-r2 
52                         >=media-libs/libcaca-0.9 )
53         alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
54         dvb? ( media-libs/libdvb
55                 media-tv/linuxtv-dvb )
56         dvd? ( >=media-libs/libdvdread-0.9.4
57                 >=media-libs/libdvdcss-1.2.8
58                 >=media-libs/libdvdnav-0.1.9
59                 >=media-libs/libdvdplay-1.0.1 )
60         esd? ( >=media-sound/esound-0.2.22 )
61         faad? ( >=media-libs/faad2-2.0_rc3 )
62         ggi? ( >=media-libs/libggi-2.0_beta3 )
63         gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
64         gtk? ( =x11-libs/gtk+-1.2* )
65         imlib? ( >=media-libs/imlib2-1.0.6 )
66         lirc? ( app-misc/lirc )
67         mad? ( media-libs/libmad
68                 media-libs/libid3tag )
69         matroska? ( >=media-libs/libmatroska-0.6.3 )
70         mozilla? ( >=net-www/mozilla-1.4 )
71         ncurses? ( sys-libs/ncurses )
72         nls? ( >=sys-devel/gettext-0.12.1 )
73         oggvorbis? ( >=media-libs/libvorbis-1.0
74                 >=media-libs/libogg-1.0 )
75         sdl? ( >=media-libs/libsdl-1.2.5 )
76         slp? ( >=net-libs/openslp-1.0.10 )
77         bidi? ( >=dev-libs/fribidi-0.10.4 )
78         truetype? ( >=media-libs/freetype-2.1.4 )
79         wxwindows? ( >=x11-libs/wxGTK-2.4.1 )
80         xosd? ( >=x11-libs/xosd-2.0 )
81         3dfx? ( media-libs/glide-v3 )
82         png? ( >=media-libs/libpng-1.2.5 )
83         speex? ( >=media-libs/speex-1.0.3 )
84         dts? ( >=media-libs/libdts-0.0.2 )
85         >=media-sound/lame-3.93.1
86         >=media-libs/libdvbpsi-0.1.3
87         >=media-libs/a52dec-0.7.4
88         >=media-libs/libmpeg2-0.4.0
89         >=media-video/ffmpeg-0.4.8.20040222
90         >=media-plugins/live-2004.03.05
91         >=media-libs/flac-1.1.0"
92
93 DEPEND="$RDEPEND >=sys-devel/autoconf-2.5.8"
94
95 src_unpack() {
96         
97         unpack ${A}
98
99         # Change the location of the glide headers
100         cd ${S}
101         sed -i \
102                 -e "s:/usr/include/glide:/usr/include/glide3:" \
103                 -e "s:glide2x:glide3:" \
104                 configure
105
106         cd ${S}/modules/video_output
107         epatch ${FILESDIR}/glide.patch
108         cd ${S}
109
110 }
111
112 src_compile(){
113         # Configure and build VLC
114         cd ${S}
115         local myconf
116         myconf="--disable-mga --enable-flac --with-gnu-ld \
117                         --enable-a52 --enable-dvbpsi --enable-libmpeg2 \
118                         --disable-qt --disable-kde --disable-libcdio --disable-libcddb \
119                         --disable-vcdx --enable-ffmpeg --with-ffmpeg-mp3lame \
120                         --enable-livedotcom --with-livedotcom-tree=/usr/lib/live \
121                         --disable-skins2" #keep the new skins disabled for now
122
123     #--enable-pth                               GNU Pth support (default disabled)
124         #--enable-st                            State Threads (default disabled)
125         #--enable-gprof                         gprof profiling (default disabled)
126         #--enable-cprof                         cprof profiling (default disabled)
127         #--enable-mostly-builtin        most modules will be built-in (default enabled)
128         #--disable-optimizations        disable compiler optimizations (default disabled)
129         #--enable-testsuite                     build test modules (default disabled)
130         #--disable-plugins                      make all plugins built-in (default plugins enabled)
131
132         use debug && myconf="${myconf} --enable-debug" \
133                 || myconf="${myconf} --enable-release"
134         
135         (use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
136
137         use mozilla \
138                 && myconf="${myconf} --enable-mozilla \
139                 MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
140                 XPIDL=/usr/bin/xpidl"
141
142         # vlc uses its own ultraoptimizaed CXXFLAGS
143         # and forcing custom ones generally fails building
144         export CXXFLAGS=""
145         export CFLAGS=""
146         export WANT_AUTOCONF_2_5=1
147         export WANT_AUTOMAKE_1_6=1
148
149         # Avoid timestamp skews with autotools
150         touch configure.ac
151         touch aclocal.m4
152         touch configure
153         touch config.h.in
154         touch `find . -name Makefile.in`
155
156         econf \
157                 $(use_enable nls) \
158                 $(use_enable slp) \
159                 $(use_enable xosd) \
160                 $(use_enable ncurses) \
161                 $(use_enable alsa) \
162                 $(use_enable esd) \
163                 $(use_enable oss) \
164                 $(use_enable ggi) \
165                 $(use_enable sdl) \
166                 $(use_enable mad) \
167                 $(use_enable faad) \
168                 $(use_enable v4l) \
169                 $(use_enable dvd) \
170                 $(use_enable dvd vcd) \
171                 $(use_enable dvdread) \
172                 $(use_enable dvd dvdplay) \
173                 $(use_enable dvd dvdnav) \
174                 $(use_enable dvb) \
175                 $(use_enable pvr) \
176                 $(use_enable satellite) \
177                 $(use_enable joystick) $(use_enable lirc) \
178                 $(use_enable arts) \
179                 $(use_enable gtk) $(use_enable gnome) \
180                 $(use_enable oggvorbis ogg) $(use_enable oggvorbis vorbis) \
181                 $(use_enable speex) \
182                 $(use_enable matroska mkv) \
183                 $(use_enable truetype freetype) \
184                 $(use_enable bidi fribidi) \
185                 $(use_enable svga svgalib) \
186                 $(use_enable fbcon fb) \
187                 $(use_enable aalib aa) $(use_enable aalib caca) \
188                 $(use_enable xv xvideo) \
189                 $(use_enable X x11) \
190                 $(use_enable 3dfx glide) \
191                 $(use_enable altivec) \
192                 $(use_enable dts) \
193                 ${myconf} || die "configure of VLC failed"
194
195         if [[ $(gcc-major-version) == 2 ]]; then
196                 sed -i -e s:"-fomit-frame-pointer":: vlc-config || die "-fomit-frame-pointer patching failed"
197         fi
198
199         # parallel make doesn't work with our complicated makefile
200         # this is also the reason as why you shouldn't run autoconf
201         # or automake yourself. (or bootstrap for that matter)
202         MAKEOPTS="${MAKEOPTS} -j1"
203         emake || die "make of VLC failed"
204 }
205
206 src_install() {
207         
208         einstall || die "make install failed"
209
210         dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
211         MAINTAINERS NEWS README* THANKS doc/ChangeLog-*
212
213 }