SUMMARY="The popular cross-plattform media player"
DESCRIPTION="VLC is a free and open source cross-platform multimedia player \
and framework that plays most multimedia files as well as DVDs, Audio CDs, \
VCDs, and various streaming protocols."
HOMEPAGE="http://www.videolan.org/vlc/"
COPYRIGHT="1998-2008 VideoLan organization"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="http://download.videolan.org/pub/vlc/0.8.6i/vlc-0.8.6i.tar.gz"
CHECKSUM_SHA256="e99b3b49efd8cae8cf210ca69a5c81ceeac3b2e7d2b1e79df84c9abee4aa8426"
PATCHES="vlc-$portVersion.patchset"

ARCHITECTURES="x86_gcc2 x86"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	vlc$secondaryArchSuffix = $portVersion
	cmd:vlc
	cmd:vlc_config
	"
REQUIRES="
	haiku
	lib:libintl
	lib:libiconv
	"

PROVIDES_devel="
	vlc_devel = $portVersion
	devel:libvlc
	devel:libbeos
	devel:libi420_rgb_mmx
	devel:libi420_ymga_mmx
	devel:libi420_yuy2_mmx
	devel:libi422_yuy2_mmx
	devel:libmemcpy3dn
	devel:libmemcpymmx
	devel:libmemcpymmxext
	"
REQUIRES_devel="
	vlc == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:liba52$secondaryArchSuffix
	devel:libavcodec$secondaryArchSuffix == 53.61.100
	devel:libbz2$secondaryArchSuffix
	devel:libcddb$secondaryArchSuffix
	devel:libcdio$secondaryArchSuffix
	devel:libdca$secondaryArchSuffix
	devel:libdvbpsi$secondaryArchSuffix
	devel:libdvdcss$secondaryArchSuffix
	devel:libdvdnav$secondaryArchSuffix
	devel:libdvdread$secondaryArchSuffix
	devel:libebml$secondaryArchSuffix
	devel:libfaac$secondaryArchSuffix
	devel:libfaad$secondaryArchSuffix
	devel:libflac$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libfribidi$secondaryArchSuffix
	devel:libgcrypt$secondaryArchSuffix 
	devel:libgl$secondaryArchSuffix
	devel:libglu$secondaryArchSuffix
	devel:libgnutls$secondaryArchSuffix
	devel:libgpg_error$secondaryArchSuffix
	devel:libiconv$secondaryArchSuffix
	devel:libid3tag$secondaryArchSuffix
	devel:libintl$secondaryArchSuffix
	devel:libjpeg$secondaryArchSuffix
	devel:libmad$secondaryArchSuffix
	devel:libmatroska$secondaryArchSuffix
	devel:libmp3lame$secondaryArchSuffix
	devel:libmpcdec$secondaryArchSuffix
	devel:libmpeg2$secondaryArchSuffix
	devel:libmodplug$secondaryArchSuffix
	devel:libogg$secondaryArchSuffix
	devel:libpng$secondaryArchSuffix
	devel:libpostproc$secondaryArchSuffix
	devel:libsmbclient$secondaryArchSuffix
	devel:libspeex$secondaryArchSuffix
	devel:libtheora$secondaryArchSuffix
	devel:libvcdinfo$secondaryArchSuffix
	devel:libtwolame$secondaryArchSuffix
	devel:libvorbis$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
# We need a recipe for an old version of this that will still build with gcc2.
#	devel:libx264$secondaryArchSuffix

BUILD_PREREQUIRES="
	cmd:autoconf
	cmd:bison
	cmd:gcc$secondaryArchSuffix
	cmd:ar$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:sed
	cmd:xargs
	cmd:which
	"

BUILD()
{
	autoconf
	runConfigure ./configure CFLAGS="-Davcodec_init=avcodec_register_all" \
		--disable-wxwidgets --disable-skins2 --enable-shared \
		--enable-screen --enable-dvdread --enable-smb --enable-faad \
		--enable-twolame --with-ffmpeg-dca --with-ffmpeg-theora --enable-flac

	make # Multi-job build is not working
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libvlc vlc/libbeos vlc/libi420_rgb_mmx \
		vlc/libi420_ymga_mmx vlc/libi420_yuy2_mmx vlc/libi422_yuy2_mmx \
		vlc/libmemcpy3dn vlc/libmemcpymmx vlc/libmemcpymmxext

	addResourcesToBinaries vlc.rdef $binDir/vlc
	addAppDeskbarSymlink $binDir/vlc "VLC media player"

	packageEntries devel $developDir
}
