SUMMARY="An addictive action-puzzle game"
DESCRIPTION="So, uh, there's a bunch of penguins on an iceberg in \
Antarctica. You have been selected to catch them so they can be shipped \
to Finland, where they are essential to a secret plot for world domination."
HOMEPAGE="https://mattdm.org/icebreaker/"
COPYRIGHT="2000-2021 Matthew Miller"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://mattdm.org/icebreaker/2.2.x/icebreaker-$portVersion.tar.xz"
CHECKSUM_SHA256="29d02d59681faa1e83949b7bae4553720db0247c51ac040bb9f3b516350e9810"
PATCHES="icebreaker-$portVersion.patchset"
ADDITIONAL_FILES="icebreaker.rdef"

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

GLOBAL_WRITABLE_FILES="settings/icebreaker.scores keep-old"

PROVIDES="
	icebreaker$secondaryArchSuffix = $portVersion
	app:IceBreaker$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libSDL_mixer_1.2$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libSDL_1.2$secondaryArchSuffix
	devel:libSDL_mixer_1.2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	make prefix=$prefix bindir=$appsDir \
		datadir=$dataDir \
		highscoredir=$settingsDir \
		mandir=$manDir
}

INSTALL()
{
	make prefix=$prefix bindir=$appsDir \
		datadir=$dataDir \
		highscoredir=$settingsDir \
		mandir=$manDir \
		install
	mv $appsDir/icebreaker $appsDir/IceBreaker

	addResourcesToBinaries \
		$portDir/additional-files/icebreaker.rdef \
		$appsDir/IceBreaker

	addAppDeskbarSymlink $appsDir/IceBreaker
}
