SUMMARY="Emulation of the game Chip's Challenge"
DESCRIPTION="Tile World is an emulation of the game Chip's Challenge. \
Chip's Challenge was originally written for the Atari Lynx by Chuck \
Sommerville, and was later ported to MS Windows by Microsoft (among other \
ports). Chip's Challenge is a game made up of both intellectually engaging \
puzzles and situations demanding fast reflexes. As you might have guessed, \
it is a tile-based game. The object of each level is simply to get out — \
i.e., to find and achieve the exit tile. This simple task, however, can \
sometimes be extremely challenging."
HOMEPAGE="http://www.muppetlabs.com/~breadbox/software/tworld/"
COPYRIGHT="2001-2015 Brian Raiter"
LICENSE="GNU GPL v3"
REVISION="2"
SOURCE_URI="http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-$portVersion-CCLPs.tar.gz"
CHECKSUM_SHA256="bb867a05e18613260ffad597d8afef8210687495746857a7ad00ef0f2126e12a"
PATCHES="tworld-1.3.2.patchset"
ADDITIONAL_FILES="tworld.rdef"

ARCHITECTURES="all"

PROVIDES="
	tworld = $portVersion
	app:tworld = $portVersion
	"
REQUIRES="
	haiku
	lib:libSDL_1.2
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libSDL
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc
	cmd:make
	"

BUILD()
{
	runConfigure --omit-dirs binDir ./configure --bindir=$appsDir
	make
}

INSTALL()
{
	make install
	mkdir -p $manDir/man6
	cp -f docs/tworld.6 $manDir/man6
	mv $appsDir/tworld $appsDir/TileWorld

	addResourcesToBinaries $portDir/additional-files/tworld.rdef $appsDir/TileWorld

	addAppDeskbarSymlink $appsDir/TileWorld
}
