SUMMARY="A fork of 4DO, a 3DO emulator to the libretro architecture"
DESCRIPTION="Opera is a fork of 4DO, originally a port of 4DO, itself a fork \
of FreeDO, to libretro. The fork/rename occurred due to the original 4DO \
project being dormant and to differenciate the project due to new development \
and focus."
HOMEPAGE="https://github.com/libretro/opera-libretro"
COPYRIGHT="2011-2020 the 4DO/FreeDO team, the libretro team"
LICENSE="FreeDO
	GNU LGPL v3"
REVISION="1"
srcGitRev="aa868e656b518567a95b11b2f14c5db8001b11a0"
SOURCE_URI="https://github.com/libretro/opera-libretro/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="373e59a9a59feb26e04b90eaa7ffadcc0d3c4c043a8e501817d1bfb921e8433d"
SOURCE_FILENAME="libretro-opera-$portVersion-$srcGitRev.tar.gz"
SOURCE_DIR="opera-libretro-$srcGitRev"
ADDITIONAL_FILES="opera_libretro.info.in"

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

PROVIDES="
	opera_libretro$secondaryArchSuffix = $portVersion
	addon:opera_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/opera_libretro.info.in \
		> opera_libretro.info
	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 \
		opera_libretro.info \
		opera_libretro.so
}
