SUMMARY="A 2D and 3D chess game"
DESCRIPTION="Puri is a 2D and 3D chess game. You can play against a computer, or play \
online against other people."
HOMEPAGE="https://github.com/HaikuArchives/Puri/"
COPYRIGHT="2010-2012 Haiku Inc."
LICENSE="MIT"
REVISION="2"
srcGitRev="7f94abc9e8022b3e25eb4563b7fe45a4db360dfb"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="81956261b2e64ce26b481963b94d80c8512a73730d372669ee5a511309958121"
SOURCE_FILENAME="puri-$srcGitRev.tar.gz"
SOURCE_DIR="Puri-$srcGitRev"
PATCHES="puri-$portVersion.patchset"

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

PROVIDES="
	Puri$secondaryArchSuffix = $portVersion
	app:Puri$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	cmd:stockfish
	lib:lib3ds$secondaryArchSuffix
	lib:libgl$secondaryArchSuffix
	lib:libglu$secondaryArchSuffix
	lib:libpng16$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:lib3ds$secondaryArchSuffix
	devel:libgl$secondaryArchSuffix
	devel:libglu$secondaryArchSuffix
	devel:libpng16$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	gcc$secondaryArchSuffix
	cmd:ar$secondaryArchSuffix
	cmd:as$secondaryArchSuffix
	cmd:jam
	cmd:ld$secondaryArchSuffix
	cmd:ranlib$secondaryArchSuffix
	"

BUILD()
{
	jam $jobArgs
}

INSTALL()
{
	cd src
	mkdir -p $appsDir/Puri

	cp Puri $appsDir/Puri
	addAppDeskbarSymlink $appsDir/Puri/Puri

	cp -R data $appsDir/Puri/data
}
