SUMMARY="A single-player 2D action role playing game"
DESCRIPTION="Flare is a single-player 2D action RPG with fast-paced action \
and a dark fantasy style."
HOMEPAGE="http://flarerpg.org"
SOURCE_URI="http://downloads.sourceforge.net/project/flare-game/Linux/flare.0.19.tar.gz"
CHECKSUM_SHA256="c96995fff6b71d44ddeae611b1ae4cd35162655f73088000786d03478f0a924e"
SOURCE_DIR="flare.0.19"
REVISION="3"
LICENSE="GNU GPL v3"
COPYRIGHT="2010-2013 Clint Bellanger"

ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	flare$secondaryArchSuffix = $portVersion
	app:Flare$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	flare_data == $portVersion
	lib:libsdl$secondaryArchSuffix
	lib:libsdl_mixer$secondaryArchSuffix
	lib:libsdl_image$secondaryArchSuffix
	lib:libsdl_ttf$secondaryArchSuffix
	"

SUMMARY_data="Flare data files"
ARCHITECTURES_data="any"

PROVIDES_data="
	flare_data = $portVersion
	"
REQUIRES_data="
	haiku
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsdl$secondaryArchSuffix
	devel:sdl_mixer$secondaryArchSuffix
	devel:sdl_image$secondaryArchSuffix
	devel:sdl_ttf$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:make
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	"

PATCHES="flare-0.19.patch"

USER_SETTINGS_FILES="
	settings/flare
	"

BUILD()
{
	cmake .
	make $jobArgs
	addResourcesToBinaries distribution/flare.rdef flare

}

INSTALL()
{
	mkdir -p $appsDir $dataDir/flare

	cp flare $appsDir
	cp -r mods $dataDir/flare/
	packageEntries data $dataDir
	addAppDeskbarSymlink $appsDir/flare "Flare"
}
