SUMMARY="Emulator of Atari 8-bit system"
DESCRIPTION="The Atari++ Emulator is a Unix based emulator of the Atari eight \
bit computers, namely the Atari 400 and 800, the Atari 400XL, 800XL and \
130XE, and the Atari 5200 game console. The emulator is auto-configurable and \
will compile on a variety of systems (Linux, Solaris, Irix). Its emulation \
features are stunning:
 * Cycle precise emulation; this includes correct emulation of horizontal \
kernels and programs that modify chip registers within a horizontal line. \
In a less technical language, software making use of advanced displaying \
techniques will be emulated correctly.
 * Emulation of an advanced 1050 disk drive including single, double and \
enhanced density. The emulator not only understands .atr and .xfd files, \
but comes with a mini-boot loader that allows you to boot from binary load \
files (.exe and .com)."
HOMEPAGE="http://xl-project.com/"
COPYRIGHT="2004 Thomas Richter"
SOURCE_URI="http://www.xl-project.com/download/atari++_1.73.tar.gz"
CHECKSUM_SHA256="b41095eeb6362806ddcfa9c59ca319b873fb9eed3bf7a78ad2f2848300e4b3f8"
SOURCE_DIR="atari++"
PATCHES="atari++-$portVersion.patch"
REVISION="1"
LICENSE="GNU GPL v1"

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="
	atari++$secondaryArchSuffix = $portVersion
	cmd:atari++ = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libsdl_1.2$secondaryArchSuffix
	lib:libpng$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libsdl_1.2$secondaryArchSuffix >= 0.11.4
	devel:libpng$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:autoheader
	cmd:which
	cmd:sdl_config$secondaryArchSuffix
	cmd:awk
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	"

BUILD()
{
	autoreconf
	runConfigure --omit-dirs binDir ./configure --bindir=$prefix/bin
	make $jobArgs
}

INSTALL()
{
	make install
	addAppDeskbarSymlink $prefix/bin/atari++ "Atari++"
}
