vlc.ebuild 7.87 KB
Newer Older
1 2 3 4
###############################################################################
# vlc.ebuild: A Gentoo ebuild for vlc
###############################################################################
# Copyright (C) 2003 VideoLAN
5
# $Id: vlc.ebuild,v 1.19 2003/08/24 08:12:01 hartman Exp $
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#
# Authors: Derk-Jan Hartman <thedj at users.sf.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
###############################################################################
23 24 25 26 27
# Instructions: http://wiki.videolan.org/index.php/Linux%20Gentoo
# Some of the ideas in this ebuild are derived from the official Gentoo ebuild
# Thanks to the Gentoo Team for supporting us.
###############################################################################

28 29 30 31 32 33 34 35
# Missing support for...
#	tarkin - package not in portage yet - experimental
#	theora - package not in portage yet - experimental
#	tremor - package not in portage yet - experimental

IUSE="arts ncurses dvd gtk nls 3dfx svga fbcon esd X alsa ggi
      oggvorbis gnome xv oss sdl aalib slp truetype v4l xvid lirc 
	  wxwindows imlib matroska dvb mozilla debug faad xosd altivec"
36 37 38

# Change these to correspond with the
# unpacked dirnames of the CVS snapshots.
39
PFFMPEG=ffmpeg-20030813
40
PLIBMPEG2=mpeg2dec-20030612
41 42 43 44 45

S=${WORKDIR}/${P}
SFFMPEG=${WORKDIR}/${PFFMPEG}
SLIBMPEG2=${WORKDIR}/${PLIBMPEG2}

46
DESCRIPTION="VLC media player - Video player and streamer"
47 48
SRC_URI="http://www.videolan.org/pub/${PN}/${PV}/${P}.tar.bz2
		 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 54

SLOT="0"
LICENSE="GPL-2"
55
KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~amd64"
56 57

DEPEND="X? ( virtual/x11 )
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
58 59 60 61
	aalib? ( >=media-libs/aalib-1.4_rc4-r2 )
	alsa? ( >=media-libs/alsa-lib-0.9_rc2 )
	dvb? ( media-libs/libdvb
		media-tv/linuxtv-dvb )
62
	dvd? ( >=media-libs/libdvdread-0.9.3
63
		>=media-libs/libdvdcss-1.2.8
64 65
		>=media-libs/libdvdplay-1.0.1 )
	esd? ( >=media-sound/esound-0.2.22 )
66
	faad? ( >=media-libs/faad2-1.1 )
67
	ggi? ( >=media-libs/libggi-2.0_beta3 )
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
68
	gnome? ( >=gnome-base/gnome-libs-1.4.1.2-r1 )
69
	gtk? ( =x11-libs/gtk+-1.2* )
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
70 71 72 73
	imlib? ( >=media-libs/imlib2-1.0.6 )
	lirc? ( app-misc/lirc )
	mad? ( media-libs/libmad
		media-libs/libid3tag )
74
	matroska? ( >=media-libs/libmatroska-0.4.4 )
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
75
	mozilla? ( >=net-www/mozilla-1.4 )
76
	ncurses? ( sys-libs/ncurses )
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
77 78 79 80
	nls? ( sys-devel/gettext )
	oggvorbis? ( >=media-libs/libvorbis-1.0
		>=media-libs/libogg-1.0 )
	sdl? ( >=media-libs/libsdl-1.2.5 )
81 82
	slp? ( >=net-libs/openslp-1.0.10 )
	truetype? ( >=media-libs/freetype-2.1.4 )
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
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 )
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
87
	>=media-sound/lame-3.93.1
88
	>=media-libs/libdvbpsi-0.1.3
89 90
	>=media-libs/a52dec-0.7.4
	>=media-libs/flac-1.1.0"
91

92
inherit gcc
93 94 95 96 97

src_unpack() {
	
	unpack ${A}
	cd ${S}
98

99 100
	# Change the location of the glide headers
	cd ${S}
101 102 103 104 105
	sed -i -e "s:/usr/include/glide:/usr/include/glide3:" configure
	sed -i -e "s:glide2x:glide3:" configure
	cd ${S}/modules/video_output
	epatch ${FILESDIR}/glide.patch
	cd ${S}
106 107 108
	
	# patch libmpeg2
	cd ${SLIBMPEG2}
109
	sed -i -e 's:OPT_CFLAGS=\"$CFLAGS -mcpu=.*\":OPT_CFLAGS=\"$CFLAGS\":g' configure
110 111 112 113 114 115 116 117 118 119 120 121 122

}

src_compile(){
	# configure and building of libmpeg2
	cd ${SLIBMPEG2}
	econf --disable-sdl --without-x \
		|| die "./configure of libmpeg2 failed"
	
	emake || make || die "make of libmpeg2 failed"

	# configure and building of ffmpeg
	cd ${SFFMPEG}
123
	local myconf
124 125 126
	use mmx || myconf="--disable-mmx"

	./configure ${myconf} \
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
127
		--enable-mp3lame \
128 129 130 131
		--disable-vorbis || die "./configure of ffmpeg failed"
	
	cd libpostproc
	make || die "make of libpostproc failed"
132 133
	cd libavcodec
	make || die "make of libavcodec failed"
134 135 136

	# Configure and build VLC
	cd ${S}
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
	
	# Avoid timestamp skews with autotools
	touch configure.ac
	touch aclocal.m4
	touch configure
	touch config.h.in
	touch `find . -name Makefile.in`
	
	local myconf
	myconf="--disable-mga --enable-flac --with-gnu-ld"

    #--enable-pth				GNU Pth support (default disabled)
	#--enable-st				State Threads (default disabled)
	#--enable-gprof				gprof profiling (default disabled)
	#--enable-cprof				cprof profiling (default disabled)
	#--enable-mostly-builtin	most modules will be built-in (default enabled)
	#--disable-optimizations	disable compiler optimizations (default disabled)
	#--enable-testsuite			build test modules (default disabled)
	#--disable-plugins			make all plugins built-in (default disabled)
156

157 158 159 160 161
	use nls || myconf="${myconf} --disable-nls"
	
	use debug && myconf="${myconf} --enable-debug" \
		|| myconf="${myconf} --enable-release"
	
162
	use dvd \
163
		&& myconf="${myconf} --enable-dvdread" \
164 165 166
		|| myconf="${myconf} \
			--disable-dvd \
			--disable-dvdread \
167
			--disable-dvdplay \
168 169
			--disable-vcd"

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 179 180
	use mad || myconf="${myconf} --disable-mad"

	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"
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
195

196
	use ggi && myconf="${myconf} --enable-ggi"
197

198
	use 3dfx && myconf="${myconf} --enable-glide"
199

200 201 202 203 204 205 206 207 208
	use aalib && myconf="${myconf} --enable-aa"

	use oss || myconf="${myconf} --disable-oss"

	use esd && myconf="${myconf} --enable-esd"

	use arts && myconf="${myconf} --enable-arts"

	use alsa && myconf="${myconf} --enable-alsa"
209

210
	(use imlib && use wxwindows) && myconf="${myconf} --enable-skins"
211

212 213 214
	use gtk || myconf="${myconf} --disable-gtk"

	use gnome && myconf="${myconf} --enable-gnome"
215

216 217 218 219 220 221 222
	use ncurses && myconf="${myconf} --enable-ncurses"

	use xosd && myconf="${myconf} --enable-xosd"

	use slp || myconf="${myconf} --disable-slp"

	use lirc && myconf="${myconf} --enable-lirc"
223

224
	use joystick && myconf="${myconf} --enable-joystick"
225

226 227
	use mozilla && \
		myconf="${myconf} --enable-mozilla \
228 229 230
	    MOZILLA_CONFIG=/usr/lib/mozilla/mozilla-config \
	    XPIDL=/usr/bin/xpidl"

231
	use altivec || myconf="${myconf} --disable-altivec"
232

233 234 235 236 237 238 239
	# vlc uses its own ultraoptimizaed CXXFLAGS
	# and forcing custom ones generally fails building
	export CXXFLAGS=""
	export CFLAGS=""
	export WANT_AUTOCONF_2_5=1
	export WANT_AUTOMAKE_1_6=1

240 241
	myconf="${myconf} --enable-ffmpeg --with-ffmpeg-tree=${SFFMPEG} \
		--with-ffmpeg-mp3lame \
242
		--enable-libmpeg2 --with-libmpeg2-tree=${SLIBMPEG2} \
243
		--enable-flac \
244 245
		--disable-kde \
		--disable-qt"
246 247

	econf ${myconf} || die "configure of VLC failed"
248

249 250 251 252
	if [ `gcc-major-version` -eq 2 ]; then
		sed -i s:"-fomit-frame-pointer":: vlc-config
	fi

253 254 255
	# parallel make doesn't work with our complicated makefile
	# this is also the reason as why you shouldn't run autoconf
	# or automake yourself. (or bootstrap for that matter)
256
	MAKEOPTS="${MAKEOPTS} -j1"
257
	emake || die "make of VLC failed"
258 259 260 261 262 263 264
}

src_install() {
	
	einstall || die "make install failed"

	dodoc ABOUT-NLS AUTHORS COPYING ChangeLog HACKING INSTALL* \
265
	MAINTAINERS NEWS README* THANKS doc/ChangeLog-*
266 267

}