SUMMARY="A port of MrBoom, a Bomberman clone, to the libretro architecture"
DESCRIPTION="MrBoom is a colorful clone of the all-time classic Bomberman from \
Hudson Soft. It features 8 players, netplay, AI bots (new C++ feature), \
pushing bombs, remote controls and kangaroo riding, among others. Originally \
developed for MS-DOS, this is the port to the Libretro architecture."
HOMEPAGE="http://mrboom.mumblecore.org/"
COPYRIGHT="2001-2020 Remdy Software, the libretro team"
LICENSE="MIT"
REVISION="1"
srcGitRev="9b51b0faa49ab4f5008a3fff4d67681a920c344f"
SOURCE_URI="https://github.com/libretro/mrboom-libretro/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="34a64298a84812bfb5f0f450a3862b6f9e89174b4654239b9d4173ac5c646f59"
SOURCE_FILENAME="libretro-mrboom-${portVersion/_/-}-$srcGitRev.tar.gz"
SOURCE_DIR="mrboom-libretro-$srcGitRev"
srcGitRev_2="4a615c44655acc4d358bfa44da5f476745b4f425"
SOURCE_URI_2="https://github.com/libretro/libretro-common/archive/$srcGitRev_2.tar.gz"
CHECKSUM_SHA256_2="5e138380fcb713c4aacfc6e413deb5c1c261f61f246181a03fcd89bb0a9d87e8"
SOURCE_FILENAME_2="libretro-common-$srcGitRev_2.tar.gz"
ADDITIONAL_FILES="mrboom_libretro.info.in"

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

PROVIDES="
	mrboom_libretro$secondaryArchSuffix = $portVersion
	addon:mrboom_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/mrboom_libretro.info.in \
		> mrboom_libretro.info
	rm -rf ./libretro-common
	cp -r $sourceDir2/libretro-common-$srcGitRev_2 ./libretro-common
	make $jobArgs clean && make $jobArgs
}

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