SUMMARY="Library for SSA/ASS subtitles rendering"
DESCRIPTION="
Libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation \
Alpha/Substation Alpha) subtitle format.
"
HOMEPAGE="http://github.com/libass/libass"
COPYRIGHT="
	2006 Evgeniy Stepanov
	2011 Grigori Goronzy
	2011-2014 Yu Zhuohuang
	2013 Rodger Combs
	"
LICENSE="ISC"
SOURCE_URI="https://github.com/libass/libass/releases/download/$portVersion/libass-$portVersion.tar.xz"
CHECKSUM_SHA256="673c1b15bde182168b17e17ee1c8d9e01173f20af352134216135b5bf15bf1e3"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libass$secondaryArchSuffix = $portVersion compat >= 0.11
	lib:libass$secondaryArchSuffix = 5.1.1 compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libenca$secondaryArchSuffix
	lib:libfontconfig$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libfribidi$secondaryArchSuffix
	lib:libharfbuzz$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	# required by fontconfig
	lib:libxml2$secondaryArchSuffix
	# required by freetype
	lib:libbz2$secondaryArchSuffix
	lib:libpng16$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	# required by harfbuzz
	lib:libglib_2.0$secondaryArchSuffix
	lib:libgraphite2$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libenca$secondaryArchSuffix
	devel:libfontconfig$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libfribidi$secondaryArchSuffix
	devel:libharfbuzz$secondaryArchSuffix
	devel:libiconv$secondaryArchSuffix
	# required by fontconfig
	devel:libxml2$secondaryArchSuffix
	# required by freetype
	devel:libbz2$secondaryArchSuffix
	devel:libpng16$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	# required by harfbuzz
	devel:libglib_2.0$secondaryArchSuffix
	devel:libgraphite2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	#cmd:yasm #yasm outputs invalid files here 
	cmd:pkg_config$secondaryArchSuffix
	"

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

INSTALL()
{
	make install

	prepareInstalledDevelLibs libass
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
	libass${secondaryArchSuffix}_devel = $portVersion compat >= 0.11
	devel:libass$secondaryArchSuffix = 5.1.1 compat >= 5
	"
REQUIRES_devel="
	libass$secondaryArchSuffix == $portVersion base
	"
