SUMMARY="A free advanced MasterMind clone"
DESCRIPTION="ColorCode is a free advanced MasterMind clone with lots of \
different game variants, from the very easy up to really challenging ones. \
You can combine any color count from 2-10 with any column count from 2-5 and \
allow or not pegs of the same color. Or you may select one of the 5 \
predefined levels of difficulty. ColorCode has also a rather intelligent \
built in MasterMind solver - so you can let the computer guess for you \
(nope, he's not cheating - really)."
HOMEPAGE="http://colorcode.laebisch.com/"
SOURCE_URI="http://colorcode.laebisch.com/download/ColorCode-0.7.2.tar.gz"
CHECKSUM_SHA256="d1c5bf4d65c81de16c4159c2c69c096fc7ff47cca587d7233985e078d63c79aa"
SOURCE_DIR="ColorCode-0.7.2"
REVISION="1"
LICENSE="GNU GPL v3"
COPYRIGHT="2009-2011 Dirk Laebisch"
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"

PROVIDES="
	colorcode = $portVersion
	app:ColorCode = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libqtcore$secondaryArchSuffix < 5
	lib:libqtgui$secondaryArchSuffix < 5
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libqtcore$secondaryArchSuffix < 5
	devel:libqtgui$secondaryArchSuffix < 5
	"
BUILD_PREREQUIRES="
	cmd:qmake$secondaryArchSuffix
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:xres
	"

BUILD()
{
	qmake
	make
}

INSTALL()
{
	mkdir -p $appsDir
	cp colorcode $appsDir/ColorCode
	
	addResourcesToBinaries $portDir/additional-files/colorcode.rdef \
		$appsDir/ColorCode
	
	addAppDeskbarSymlink $appsDir/ColorCode ColorCode
}
