SUMMARY="Arcade style game in the style of Boulder Dash."
HOMEPAGE="http://www.artsoft.org/rocksndiamonds/"
LICENSE="GNU GPL v2"
COPYRIGHT="2001-2013 Artsoft Entertainment"
SRC_URI="http://www.artsoft.org/RELEASES/unix/rocksndiamonds/rocksndiamonds-3.3.1.2.tar.gz"
CHECKSUM_SHA256="c117c20026299c6c935bd531ef9b0dc767731f600881d12ceb80c831483755f3"
REVISION="1"
ARCHITECTURES="x86"
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"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	rocksndiamonds = $portVersion
	app:rocksndiamonds = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libsdl$secondaryArchSuffix
	lib:libsdl_image$secondaryArchSuffix
	lib:libsdl_mixer$secondaryArchSuffix
	lib:libsdl_net$secondaryArchSuffix
#	lib:libz$secondaryArchSuffix
	lib:libsmpeg$secondaryArchSuffix
	"
BUILD_REQUIRES="
	devel:libsdl$secondaryArchSuffix
	devel:libsdl_image$secondaryArchSuffix
	devel:libsdl_mixer$secondaryArchSuffix
	devel:libsdl_net$secondaryArchSuffix
#	devel:libz$secondaryArchSuffix
	devel:libsmpeg$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

PATCHES="rocksndiamonds-$portVersion.patchset"
BUILD()
{
	# Parallel build doesn't work.
	PLATFORM=haiku make sdl
}

INSTALL()
{
	destdir=$appsDir/"Rocks'n'Diamonds"
	mkdir -p $destdir
	cp -r rocksndiamonds sounds graphics levels music $destdir 
	addAppDeskbarSymlink $destdir/rocksndiamonds "Rocks'n'Diamonds"
}

# ----- DESCRIPTION -----------------------------------------------------------

DESCRIPTION="
- network multiplayer games (upto 4 players)
- local multiplayer games (upto 4 players)
- soft scrolling with 50 frames per second 
- freely customizable keyboard and joystick support 
- stereo sound effects and music 
- music modules and fullscreen in SDL version 
- contains levels to play Boulder Dash, Emerald Mine and Sokoban 
- lots of additional levels available (over 10.000) 
"
