SUMMARY="An SDL implementation of the popular puzzle game 'Bejeweled'"
DESCRIPTION="
Gemz is an SDL implementation of the popular puzzle game 'Bejeweled'.
The objective of this game is to swap one gem with an adjacent gem to form a \
horizontal or vertical chain of three or more gems. Bonus points are given \
when chains of more than three identical gems are formed and when two chains \
are formed in one swap. Gems disappear when chains are formed and gems fall \
from the top to fill in gaps. Sometimes chain reactions, called cascades, are \
triggered, where chains are formed by the falling gems.
"
HOMEPAGE="http://sourceforge.net/projects/gemz/"
SOURCE_URI="http://sourceforge.net/projects/gemz/files/gemz/Source/gemz-0.97.0.tgz/download"
CHECKSUM_SHA256="8a61bf40e6e12d6764a1a6d4f99aec27f1c54a31f26ce09d13a6596a33d8ee5a"
LICENSE="GNU GPL v2"
COPYRIGHT="2003-2013 Jonathan Bilodeau"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	gemz = $portVersion
	app:gemz = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libsdl$secondaryArchSuffix
	lib:libsdl_image$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsdl$secondaryArchSuffix
	devel:libsdl_image$secondaryArchSuffix
	"

BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:which
	cmd:sdl_config$secondaryArchSuffix
	"

PATCHES="
	gemz-0.97.0.patch
	"

BUILD()
{
	make
}

INSTALL()
{
	mkdir -p $appsDir/gemz
	cp -r fonts gfx tilesets $appsDir/gemz
	cp gemz $appsDir/gemz/gemz
	
	addAppDeskbarSymlink $appsDir/gemz/gemz "Gemz"
}
