SUMMARY="A port of XRick, a Rick Dangerous clone, to the libretro architecture"
DESCRIPTION="xrick is an exact clone of Rick Dangerous, produced by carefully \
cracking and reverse-engineering the orignal IBM PC (x86 CPU) and Atari ST \
(68k CPU) versions of the game, and then porting to C. Thanks to its \
structure, and the use of the SDL library, it has been reported to run on \
Linux, Windows, BeOs, Amiga, QNX, etc. and all sorts of gaming consoles, \
phones and devices."
HOMEPAGE="http://www.xrick.net"
COPYRIGHT="2000-2021 Bigorno.net, the libretro team"
LICENSE="xrick"
REVISION="1"
srcGitRev="f91e4c8a45d5eacf0a733af219fed33d6e7277ee"
SOURCE_URI="https://github.com/libretro/xrick-libretro/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="53ef5b36e73b3bc1593bfab70abd130e4677181241c6662441275a7583619c69"
SOURCE_FILENAME="libretro-xrick-${portVersion/_/-}-$srcGitRev.tar.gz"
SOURCE_DIR="xrick-libretro-$srcGitRev"
ADDITIONAL_FILES="xrick_libretro.info.in"

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

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

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