SUMMARY="A hamburger-smashing video game"
DESCRIPTION="A game in which you are a chef, and must walk over hamburger \
ingredients (buns, meat, and lettuce) to make them fall from floor to floor, \
until they end up on the plates at the bottom of the screen."
HOMEPAGE="https://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html"
COPYRIGHT="2013-2021 Pierre Sarrazin
	Luce St-Amand (most images)"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="http://perso.b2b2c.ca/~sarrazip/dev/burgerspace-$portVersion.tar.gz"
CHECKSUM_SHA256="d4ec00e9df6fdac463a1627d34445746f5158ffbf35104944a81b4fa6b8d64f5"
ADDITIONAL_FILES="burgerspace.rdef"

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

PROVIDES="
	burgerspace$secondaryArchSuffix = $portVersion
	app:BurgerSpace
	cmd:burgerspace_server
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libflatzebra_0.1$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libSDL_image_1.2$secondaryArchSuffix
	lib:libSDL_mixer_1.2$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libflatzebra_0.1$secondaryArchSuffix
	devel:libSDL$secondaryArchSuffix
	devel:libSDL_image$secondaryArchSuffix
	devel:libSDL_mixer$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -vfi
	runConfigure --omit-dirs binDir \
		./configure --bindir=$prefix/bin \
		LDFLAGS='-lnetwork'
	make $jobArgs
}

INSTALL()
{
	mkdir -p $appsDir
	make install
	mv $prefix/bin/burgerspace $appsDir/BurgerSpace
	addResourcesToBinaries $portDir/additional-files/burgerspace.rdef \
		$appsDir/BurgerSpace
	addAppDeskbarSymlink $appsDir/BurgerSpace

	# remove obsolete files
	rm -rf $dataDir/{applications,pixmaps}
}
