SUMMARY="Game programming library"
DESCRIPTION="\
The Allegro library provides C/C++ programmers low-level routines commonly
needed in game programing, such as input, graphics, midi, sound effects,
and timing. It is cross platform and works with many different compilers.
Originally developed by Shawn Hargreaves, it is now a group project with
contributions from all over the world! Some of its key features include:

 * Ease of Use - comes with comprehensive documentation and examples
 * Extensibility - if the built-in functionality isn't enough, there are many add-ons available
 * Cross Platform - without changing a single line of code, you can create versions for Windows, OS X, Linux, DOS, and others! Works with many compilers, including DJGPP and VC++
 * Open Source - anyone can contribute, including you!
 * Free - it won't cost you a dime, and there are no restrictions on its usage.
"
HOMEPAGE="http://alleg.sourceforge.net/" 
SOURCE_URI="http://sourceforge.net/projects/alleg/files/allegro/4.4.1.1/allegro-4.4.1.1.tar.gz/download"
CHECKSUM_SHA256="4e29884cba88b289da5b22da93e8760d68a197d093b23f61e994f3594760d782"
LICENSE="Allegro"
COPYRIGHT="1998-2010 Shawn Hargreaves et al."

REVISION="1"

ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86"

PROVIDES="
	allegro$secondaryArchSuffix = $portVersion
	lib:liballeg$secondaryArchSuffix = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libpng
	lib:libz
	lib:libogg
	lib:libvorbis
	"

BUILD_REQUIRES="
	devel:libpng$secondaryArchSuffix
	devel:libz
	devel:libogg
	devel:libvorbis
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:cmake
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

PATCHES="allegro-4.4.1.1.patchset"

BUILD()
{
	cmake . -DCMAKE_INSTALL_PREFIX=$prefix -DDOCDIR=$docDir -DMANDIR=$manDir
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs liballeg libjpgalleg libloadpng liblogg

	packageEntries devel $developDir $binDir
}

PROVIDES_devel="
	allegro${secondaryArchSuffix}_devel = $portVersion compat >= 4.4
	devel:liballeg$secondaryArchSuffix = $portVersion compat >= 4.4
	cmd:allegro_config = $portVersion compat >= 4.4
	cmd:colormap = $portVersion compat >= 4.4
	cmd:dat = $portVersion compat >= 4.4
	cmd:dat2c = $portVersion compat >= 4.4
	cmd:dat2s = $portVersion compat >= 4.4
	cmd:exedat = $portVersion compat >= 4.4
	cmd:grabber = $portVersion compat >= 4.4
	cmd:pack = $portVersion compat >= 4.4
	cmd:pat2dat = $portVersion compat >= 4.4
	cmd:rgbmap = $portVersion compat >= 4.4
	cmd:textconv = $portVersion compat >= 4.4
	devel:libjpgalleg = $portVersion compat >= 4.4
	devel:liblogg = $portVersion compat >= 4.4
	devel:libloadpng = $portVersion compat >= 4.4
	"

REQUIRES_devel="
	haiku$secondaryArchSuffix
	allegro$secondaryArchSuffix == $portVersion base
	"

