SUMMARY="A C port of the computer game Asylum"
DESCRIPTION="SDL Asylum is a C port of the computer game Asylum, which was \
written by Andy Southgate in 1994 for the Acorn Archimedes and is now public \
domain. It has been tested on Linux and Cygwin, but it should be possible to \
run it on other platforms which support the SDL graphics library."
HOMEPAGE="http://sdl-asylum.sourceforge.net/"
COPYRIGHT="1993 Andy Southgate"
LICENSE="GNU GPL v3"
REVISION="2"
SOURCE_URI="https://downloads.sourceforge.net/sdl-asylum/asylum-$portVersion.tar.gz"
CHECKSUM_SHA256="94c5bc7de89f185cbc0ac7a4add21e890ca9680a6d01c21841aae69c4b9e724f"
PATCHES="asylum-$portVersion.patchset"

ARCHITECTURES="all"

GLOBAL_WRITABLE_FILES="
	settings/asylum/hiscores directory keep-old
	"

PROVIDES="
	asylum = $portVersion
	app:Asylum = $portVersion
	"
REQUIRES="
	haiku
	lib:libGL
	lib:libGLU
	lib:libSDL_1.2
	lib:libSDL_mixer_1.2
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libGL
	devel:libGLU
	devel:libSDL
	devel:libSDL_mixer
	"
BUILD_PREREQUIRES="
	cmd:g++
	cmd:make
	"

BUILD()
{
	make clean
	make $jobArgs HOST=haiku \
		INSTALLBIN=$appsDir/Asylum \
		INSTALLRESOURCEPATH=$dataDir/asylum \
		INSTALLHISCORES=$settingsDir/asylum/hiscores
}

INSTALL()
{
	mkdir -p $appsDir
	make install HOST=haiku \
		INSTALLGROUP="`id -gn`" \
		INSTALLBIN=$appsDir/Asylum \
		INSTALLRESOURCEPATH=$dataDir/asylum \
		INSTALLHISCORES=$settingsDir/asylum/hiscores

	addAppDeskbarSymlink $appsDir/Asylum
}
