SUMMARY="Open source Terraria clone"
DESCRIPTION="Terrarium is a free and open source Terraria clone game, \
possibly with some new features."
HOMEPAGE="https://github.com/hydren/terrarium"
COPYRIGHT="hydren"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/hydren/terrarium/releases/download/$portVersion/terrarium-$portVersion-source.tar.gz"
CHECKSUM_SHA256="26820ee03f61559e1b32334501db2017d193a99c05a4ad0b1bf2ad28c2b9c4c8"
SOURCE_DIR="terrarium-$portVersion"
PATCHES="terrarium-$portVersion.patchset"

ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"

PROVIDES="
	terrarium$secondaryArchSuffix = $portVersion
	app:Terrarium = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libBox2D$secondaryArchSuffix
	lib:libSDL2_2.0$secondaryArchSuffix
	lib:libsdl2_gfx_1.0$secondaryArchSuffix
	lib:libSDL2_image_2.0$secondaryArchSuffix
	lib:libSDL2_mixer_2.0$secondaryArchSuffix
	lib:libSDL2_ttf_2.0$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libBox2D$secondaryArchSuffix
	devel:libSDL2_2.0$secondaryArchSuffix
	devel:libsdl2_gfx$secondaryArchSuffix
	devel:libSDL2_image_2.0$secondaryArchSuffix
	devel:libSDL2_mixer_2.0$secondaryArchSuffix
	devel:libSDL2_ttf_2.0$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:find
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:which
	"

BUILD()
{
	cp -r build/linux-gcc-sdl2.0-release/ .
	cd linux-gcc-sdl2.0-release
	runConfigure ./configure.sh
	make clean
	make $jobArgs
}

INSTALL()
{
	mkdir -p $appsDir/Terrarium
	cp linux-gcc-sdl2.0-release/terrarium $appsDir/Terrarium/Terrarium
	cp -r resources $appsDir/Terrarium/resources/
#	The config file is needed to play the game
	cp config.properties $appsDir/Terrarium

	addAppDeskbarSymlink $appsDir/Terrarium/Terrarium
}
