SUMMARY="Simple Direct Media Layer font library"
DESCRIPTION="sdl_ttf is a TrueType font rendering library that is used with \
the SDL library, and almost as portable. It depends on freetype2 to handle \
the TrueType font data. It allows programmers to use multiple TrueType fonts \
without having to code a font rendering routine themselves. With the power of \
outline fonts and antialiasing, high quality text output can be obtained \
without much effort."
HOMEPAGE="http://www.libsdl.org/projects/SDL_ttf/release-1.2.html"
COPYRIGHT="1997-2012 Sam Lantinga"
LICENSE="Zlib"
REVISION="7"
SOURCE_URI="http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.tar.gz"
CHECKSUM_SHA256="724cd895ecf4da319a3ef164892b72078bd92632a5d812111261cde248ebcdb7"
SOURCE_DIR="SDL_ttf-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	sdl_ttf$secondaryArchSuffix = $portVersion compat >= 1.2
	lib:libSDL_ttf$secondaryArchSuffix = 2.0_0.10.1 compat >= 2.0_0
	lib:libSDL_ttf_2.0$secondaryArchSuffix = 0.10.1 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libglu$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	sdl_ttf${secondaryArchSuffix}_devel = 2.0.11 compat >= 1.2
	devel:libSDL_ttf$secondaryArchSuffix = 2.0_0.10.1 compat >= 2.0_0
	devel:libSDL_ttf_2.0$secondaryArchSuffix = 0.10.1 compat >= 0
	devel:sdl_ttf$secondaryArchSuffix = 2.0.11 compat >= 1.2
	"
REQUIRES_devel="
	sdl_ttf$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libfreetype$secondaryArchSuffix
	devel:libglu$secondaryArchSuffix
	devel:libsdl$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	# Mandatory autotools files…
	touch AUTHORS NEWS ChangeLog

	libtoolize --copy --force --install
	aclocal --install -I acinclude
	automake --add-missing
	autoconf
	runConfigure ./configure --with-x=no
	make
}

INSTALL()
{
	make install

	# remove libtool library file
	rm $libDir/libSDL_ttf.la

	prepareInstalledDevelLibs libSDL_ttf \
			libSDL_ttf-2.0
	fixPkgconfig

	packageEntries devel \
			$developDir
}
