SUMMARY="A Game Boy Advance Emulator"
DESCRIPTION="
VisualBoyAdvance is a Game Boy Advance emulator which runs your prefered ROMS.
"
HOMEPAGE="http://vba.ngemu.com" 
SRC_URI="git://git.debian.org/git/pkg-games/visualboyadvance"
REVISION="1"
LICENSE="GNU GPL v2"
COPYRIGHT="2002-2004 Forgotten"

ARCHITECTURES="x86 ?x86_64"
if [ $effectiveArchitecture != x86_gcc2 ]; then
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86 ?x86_64"

PROVIDES="
	visualboyadvance$secondaryArchSuffix = $portVersion
	app:visualboyadvance$secondaryArchSuffix = $portVersion
"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libsdl$secondaryArchSuffix
	lib:libsdl_mixer$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	lib:libpng$secondaryArchSuffix
"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsdl$secondaryArchSuffix
	devel:libsdl_mixer$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	devel:libpng$secondaryArchSuffix
"
BUILD_PREREQUIRES="
	cmd:nasm$secondaryArchSuffix
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:autoconf
	cmd:aclocal
	cmd:pkg_config
"

SOURCE_DIR="VisualBoyAdvance-1.8"

PATCHES="
	Util.patch
	Makefile.am.patch
	configure.in.patch
"

BUILD()
{
	libtoolize --force --copy --install
	autoreconf -i
	runConfigure ./configure --enable-c-core --disable-profilling --without-mmx
	make
}

INSTALL()
{
	cd src
	GAMEDIR=$appsDir/Visualboyadvance
	mkdir -p ${GAMEDIR}
	cp VisualBoyAdvance.cfg ${GAMEDIR}
	cp sdl/VisualBoyAdvance ${GAMEDIR}
	
	addAppDeskbarSymlink ${GAMEDIR}/VisualBoyAdvance
}
