SUMMARY="A jump 'n' run game similar to Super Mario, but more evil"
DESCRIPTION="An open-source cross-platform port of the Japanese platformer using SDL.\
It is also called \"Shobon no Action,\" \"Neko Mario,\" \"Cat Mario,\" or \"Cat MeOUCHio\".

* When you are playing this game, there is a possibility that you will develop trust \
issues towards game developers.
* There is also a possibility of getting stressed out over playing this game.
If any problems are caused by this game, the developers take no resposibility.
* If you want to distribute this game to a large amount of people, please inform the \
developers so that they can seek appropriate shelter.
* After you've played this game, give it to someone else who's never played it before. \
Then laugh.
* The game's text is entirely in Japanese, but you do not need to understand the \
Japanese language in order to play.

Controls (Keyboard):
* Left, Right - Move
* Down - Enter warp pipe
* Z, Up, Semicolon - Jump
* Space - Double-speed
* Escape - Exit
* F1 - Return to title screen
* 1-9 at the title screen - Select level
* 0 at the title screen - Dungeon of curiosity (there might be... bugs :P)"
HOMEPAGE="https://github.com/angelXwind/OpenSyobonAction"
COPYRIGHT="2014-2017 angelXwind"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://github.com/angelXwind/OpenSyobonAction/archive/RC3.tar.gz"
CHECKSUM_SHA256="f1ed7cddf42a0b174ed22f601a0490c5978bba2dc8f6902035f96f8e9582968b"
SOURCE_DIR="OpenSyobonAction-RC3"
PATCHES="opensyobonaction-$portVersion.patchset"
ADDITIONAL_FILES="opensyobonaction.rdef.in"

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

PROVIDES="
	opensyobonaction$secondaryArchSuffix = $portVersion
	app:syobonaction = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libSDL_gfx$secondaryArchSuffix
	lib:libSDL_image_1.2$secondaryArchSuffix
	lib:libSDL_mixer_1.2$secondaryArchSuffix
	lib:libSDL_ttf_2.0$secondaryArchSuffix
	"

BUILD_REQUIRES="
	devel:libSDL$secondaryArchSuffix
	devel:libSDL_gfx$secondaryArchSuffix
	devel:libSDL_image$secondaryArchSuffix
	devel:libSDL_mixer$secondaryArchSuffix
	devel:libSDL_ttf$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:g++$secondaryArchSuffix
	cmd:make
	"

defineDebugInfoPackage opensyobonaction$secondaryArchSuffix \
	$appsDir/OpenSyobonAction/SyobonAction

BUILD()
{
	make $jobArgs
}

INSTALL()
{
	destdir=$appsDir/OpenSyobonAction
	mkdir -p $destdir
	cp -r SyobonAction BGM res SE $destdir

	local MAJOR="0"
	local MIDDLE="0"
	local MINOR="3"
	local LONG_INFO="$SUMMARY"
	sed \
		-e "s|@MAJOR@|$MAJOR|" \
		-e "s|@MIDDLE@|$MIDDLE|" \
		-e "s|@MINOR@|$MINOR|" \
		-e "s|@LONG_INFO@|$LONG_INFO|" \
		$portDir/additional-files/opensyobonaction.rdef.in > opensyobonaction.rdef

	addResourcesToBinaries opensyobonaction.rdef \
		$destdir/SyobonAction

	addAppDeskbarSymlink $destdir/SyobonAction SyobonAction
}
