SUMMARY="REminiscence, a port of the Flashback game engine to the Libretro API"
DESCRIPTION="REminiscence is a port of the Flashback game engine to Libretro.\
It allows you to play the glorious Adeline Software classic on modern systems."
HOMEPAGE="http://cyxdown.free.fr/reminiscence/"
COPYRIGHT="2005-2020 Gregory Montoir, the libretro team"
LICENSE="GNU GPL v3"
REVISION="1"
srcGitRev="dbf2f5964c21f36e045ccd2cb50ac2513fdca75d"
SOURCE_URI="https://github.com/libretro/REminiscence/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="88e039c45679b804bf70be5405a13c647ce8a0ba351e5490286401027b028c28"
SOURCE_FILENAME="libretro-reminiscence-${portVersion/_/-}-$srcGitRev.tar.gz"
SOURCE_DIR="REminiscence-$srcGitRev"
ADDITIONAL_FILES="reminiscence_libretro.info.in"

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

PROVIDES="
	reminiscence_libretro$secondaryArchSuffix = $portVersion
	addon:reminiscence_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/reminiscence_libretro.info.in \
		> reminiscence_libretro.info
	make $jobArgs clean && make $jobArgs
}

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