SUMMARY="A port of DOSBox to libretro with a goal of simplicty and ease of use"
DESCRIPTION="This core includes a streamlined workflow for launching games \
directly from ZIP archives (including disk images therein) with automated \
mapping of controls to gamepads and a native onscreen keyboard. This is a \
good core for most users who just want to play games and are not looking for \
a traditional DOS experience."
HOMEPAGE="https://github.com/schellingb/dosbox-pure"
COPYRIGHT="2020-2021 Dosbox team, Bernhard Schelling, the libretro team"
LICENSE="GNU GPL v2"
REVISION="1"
srcGitRev="f6b8c46650ff60c3316b0a94868ad47d925f8d29"
SOURCE_URI="https://github.com/schellingb/dosbox-pure/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="72f18cea3de7c594bcdac4cd35a8ed7cd37048553a47be0427798f8d260e7235"
SOURCE_FILENAME="dosbox-pure-${portVersion/_/-}-$srcGitRev.tar.gz"
SOURCE_DIR="dosbox-pure-$srcGitRev"
ADDITIONAL_FILES="dosbox_pure_libretro.info.in"

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

PROVIDES="
	dosbox_pure_libretro$secondaryArchSuffix = $portVersion
	addon:dosbox_pure_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/dosbox_pure_libretro.info.in \
		> dosbox_pure_libretro.info
	make GIT_VERSION=${srcGitRev:0:7} $jobArgs
}

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