SUMMARY="Library for playback of Blu-ray movies"
DESCRIPTION="
This library is simply a tool for playback of Blu-ray movies.
"
HOMEPAGE="http://www.videolan.org/developers/libbluray.html"
COPYRIGHT="
	2010 VideoLAN (to be completed).
"
LICENSE="GNU LGPL v2.1"
SOURCE_URI="http://ftp.videolan.org/pub/videolan/libbluray/$portVersion/libbluray-$portVersion.tar.bz2"
CHECKSUM_SHA256="cdbec680c5bbc2251de6ccd109cf5f798ea51db6fcb938df39283be1799efb8f"
REVISION="1"
ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
    # x86_gcc2 is fine as primary target architecture as long as we're building
    # for a different secondary architecture.
    ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libbluray$secondaryArchSuffix = $portVersion compat >= 0.7
	lib:libbluray$secondaryArchSuffix = 1.8.1 compat >= 1
	cmd:bd_info$secondaryArchSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libfontconfig$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	# required by freetype
	lib:libbz2$secondaryArchSuffix
	lib:libpng$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libfontconfig$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	# required by freetype
	devel:libbz2$secondaryArchSuffix
	devel:libpng$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure --disable-bdjava
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/libbluray.la

	prepareInstalledDevelLibs libbluray
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	libbluray${secondaryArchSuffix}_devel = $portVersion compat >= 0.7
	devel:libbluray$secondaryArchSuffix = 1.8.1 compat >= 1
	"
REQUIRES_devel="
	libbluray$secondaryArchSuffix == $portVersion base
	"
