SUMMARY="A free, open-source version of classic Jazz Jackrabbit games"
DESCRIPTION="A free, open-source version of classic Jazz Jackrabbit games.\
Requires the original game data to work.\
Please put the data into the folder:\
~/config/non-packaged/Data/openjazz"
HOMEPAGE="https://github.com/AlisterT/openjazz"
COPYRIGHT="Alister Thomson"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://github.com/AlisterT/openjazz/releases/download/$portVersion/openjazz-$portVersion.tar.xz"
CHECKSUM_SHA256="91341adcc4908db12aad6b82d2fb0125429a26585f65d7eb32d403656313eaab"
SOURCE_DIR="openjazz-$portVersion"
ADDITIONAL_FILES="openjazz.rdef"

ARCHITECTURES="all ?x86"

PROVIDES="
	openjazz = $portVersion
	app:OpenJazz = $portVersion
	"
REQUIRES="
	haiku
	lib:libSDL_1.2
#	lib:libxmp
	lib:libmodplug
	lib:libz
    "

BUILD_REQUIRES="
    haiku_devel
	devel:libSDL
#	devel:libxmp
	devel:libmodplug
	devel:libz
    "
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:awk
	cmd:gcc
	cmd:make
	cmd:pkg_config
	"

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

INSTALL()
{
	make install

	# remove unneeded data for Haiku
	rm -rf "$dataDir"/icons
	rm -rf "$dataDir"/applications

	addResourcesToBinaries \
		$portDir/additional-files/openjazz.rdef $appsDir/OpenJazz
	addAppDeskbarSymlink $appsDir/OpenJazz
}
