SUMMARY="Unofficial MAME version with advanced video support"
DESCRIPTION=" \
AdvanceMAME is unofficial MAME version with advanced video support \
for better use with TVs, Arcade monitors, PC monitors and LCD screens."
HOMEPAGE="http://advancemame.sourceforge.net"
COPYRIGHT="1996-2006, Nicola Salmoria and the MAME Team"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/amadvance/advancemame/releases/download/v$portVersion/advancemame-$portVersion.tar.gz"
CHECKSUM_SHA256="3e4628e1577e70a1dbe104f17b1b746745b8eda80837f53fbf7b091c88be8c2b"
PATCHES="advancemame-$portVersion.patchset"
if [ "$effectiveTargetArchitecture" = x86 ]; then
	PATCHES="$PATCHES
	advancemame_x86-$portVersion.patchset"
fi

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

PROVIDES="
	advancemame$secondaryArchSuffix = $portVersion
	cmd:advj$secondaryArchSuffix
	cmd:advk$secondaryArchSuffix
	cmd:advm$secondaryArchSuffix
	cmd:advmame$secondaryArchSuffix
	cmd:advmenu$secondaryArchSuffix
	cmd:advmess$secondaryArchSuffix
	cmd:advs$secondaryArchSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libexpat$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libncurses$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libexpat$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libncurses$secondaryArchSuffix
	devel:libSDL$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
}
