SUMMARY="Tilt the floor to roll a ball through an course before time runs out."
DESCRIPTION="
Neverball is part puzzle game, part action game, and entirely a test of skill. \
Tilt the floor to roll a ball through an obstacle course before time runs out.
"
HOMEPAGE="http://neverball.org"
COPYRIGHT="2002-2010 The Neverball Team"
LICENSE="GNU GPL v2"
SRC_URI="http://neverball.org/neverball-1.5.4.tar.gz"
CHECKSUM_SHA256="ea31ca9f6eec70c8e66eaa20d7ce9e48295fdb077313b97637c503b16b7b0da6"
REVISION="1"
ARCHITECTURES="x86 ?x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
	ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"
PATCHES="neverball-1.5.4.patch"

PROVIDES="
	neverball$secondaryArchSuffix = $portVersion
	app:neverball$secondaryArchSuffix = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libphysfs$secondaryArchSuffix
	lib:libsdl$secondaryArchSuffix
	lib:libsdl_mixer$secondaryArchSuffix
	lib:libsdl_ttf$secondaryArchSuffix
	lib:libvorbis$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	
	lib:libpng$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libogg$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libphysfs$secondaryArchSuffix
	devel:libsdl$secondaryArchSuffix
	devel:libsdl_mixer$secondaryArchSuffix
	devel:libsdl_ttf$secondaryArchSuffix
	devel:libvorbis$secondaryArchSuffix
	
	devel:libpng$secondaryArchSuffix
	devel:libjpeg$secondaryArchSuffix
	devel:libogg$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	gettext$secondaryArchSuffix # it's needed
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:libpng_config$secondaryArchSuffix
	"

BUILD()
{
	make
}

INSTALL()
{
	mkdir -p $appsDir/neverball
	cp -rf neverball neverputt mapc README COPYING CHANGES data $appsDir/neverball
	addAppDeskbarSymlink $appsDir/neverball/neverball
}
