SUMMARY="A Nintendo Game Boy Advance emulator using the libretro API"
DESCRIPTION="Meteor is a Nintendo Game Boy Advance emulator. This is the \
libretro core version of Meteor, for use with RetroArch."
HOMEPAGE="https://github.com/blastrock/meteor"
COPYRIGHT="2010-2020 Philippe Daouadi, the libretro team"
LICENSE="GNU GPL v3"
REVISION="1"
srcGitRev="e533d300d0561564451bde55a2b73119c768453c"
SOURCE_URI="https://github.com/libretro/meteor-libretro/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="09df1661aa8d5c830e9ef3b62f01d7e2ae108bce2572e199b181e0c13d87e084"
SOURCE_FILENAME="libretro-meteor-${portVersion/_/-}-$srcGitRev.tar.gz"
SOURCE_DIR="meteor-libretro-$srcGitRev"
ADDITIONAL_FILES="meteor_libretro.info.in"

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

PROVIDES="
	meteor_libretro$secondaryArchSuffix = $portVersion
	addon:meteor_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/meteor_libretro.info.in \
		> meteor_libretro.info
	cd libretro
	make $jobArgs
}

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