SUMMARY="A port of Cannonball, a Sega Out Run engine, to libretro"
DESCRIPTION="A port of the Cannonball enhanced OutRun engine to libretro. \
This core includes support for increased framerate (true 60 fps, some 120 fps \
content), true widescreen, new game modes and many more enhancements. To run \
the core/game, you will need to extract the contents of an OutRun Revision B \
ROM archive alongside a dummy file that ends in the *.game file extension (the \
frontend will load this 'game' file)."
HOMEPAGE="https://reassembler.blogspot.com/"
COPYRIGHT="2012-2021 Chris White, the libretro team"
LICENSE="Cannonball"
REVISION="1"
srcGitRev="81f9b56381a4bd0e4ab90f81370c057b9ef46f7f"
SOURCE_URI="https://github.com/libretro/cannonball/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="35851d362e24a5235a71afa91d06786e044d2358e7f609051ac91007332c44b5"
SOURCE_FILENAME="cannonball-${portVersion/_/-}-$srcGitRev.tar.gz"
SOURCE_DIR="cannonball-$srcGitRev"
ADDITIONAL_FILES="cannonball_libretro.info.in"

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

PROVIDES="
	cannonball_libretro$secondaryArchSuffix = $portVersion
	addon:cannonball_libretro$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	retroarch$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	sed -e "s/@DISPLAY_VERSION@/v${portVersion/_/-}/" \
		$portDir/additional-files/cannonball_libretro.info.in \
		> cannonball_libretro.info
	make $jobArgs
}

INSTALL()
{
	install -m 0755 -d "$docDir"
	install -m 0644 -t "$docDir" README.md docs/license.txt
	install -m 0755 -d "$addOnsDir"/libretro
	install -m 0644 -t "$addOnsDir"/libretro \
		cannonball_libretro.info \
		cannonball_libretro.so
}
