SUMMARY="An Atomix clone with a slight change in concept"
DESCRIPTION="LMarbles is an Atomix clone with a slight change in concept. \
Instead of assembling molecules you create figures out of marbles. \
Nevertheless, the basic game play is the same: If a marble starts to move \
it will not stop until it hits a wall or another marble. To make it more \
interesting there are obstacles like one-way streets, crumbling walls and \
portals. As Marbles is meant as a puzzle game you play against a move limit \
and not a time limit. This way you have as much time as you need to think."
HOMEPAGE="http://lgames.sourceforge.net/"
SOURCE_URI="http://sourceforge.net/projects/lgames/files/lmarbles/lmarbles-1.0.8.tar.gz"
CHECKSUM_SHA256="0e5a16a0116d325589b28f3555ced6a0b486f0fd7632cd3d98bee5cddf213e83"
REVISION="2"
LICENSE="GNU GPL v2"
COPYRIGHT="2000 Michael Speck"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
PATCHES="lmarbles-1.0.8.patchset"

PROVIDES="
	lmarbles = $portVersion
	app:LMarbles = $portVersion
	"
REQUIRES="
	haiku
	lib:libsdl
	lib:libsdl_mixer 
	"
BUILD_REQUIRES="
	haiku_devel
	devel:libsdl
	devel:libsdl_mixer
	"
BUILD_PREREQUIRES="
	cmd:make
	cmd:gcc
	cmd:ld
	cmd:libtoolize
	cmd:xres
	"

BUILD()
{
	libtoolize --force --copy --install
	runConfigure ./configure
	make $jobArgs
	
	addResourcesToBinaries $portDir/additional-files/lmarbles.rdef src/lmarbles
}

INSTALL()
{
	make install
	mkdir -p $appsDir
	mv $binDir/lmarbles $appsDir/LMarbles

	rm $localStateDir/lmarbles.prfs
	rm -rf $dataDir/applications
	rm -rf $dataDir/icons

	addAppDeskbarSymlink $appsDir/LMarbles LMarbles
	mimeset -f $appsDir/LMarbles
}
