SUMMARY="Open source clone of Master of Orion"
DESCRIPTION="1oom is a game engine recreation of the original \"Master \
of Orion\" (1993), a 4X strategy space game originally made by Simtex \
and released by Microprose.

Please note you will need the original game LBX data files from version 1.3. \
This means that you will need a purchased copy of Master of Orion \
in order to use 1oom. \

To play: copy the LBX files into /boot/home/config/non-packaged/data/1oom

Configuration may be changed by editing the 1oom_config_game_classic_sdl1.txt \
file, located in /boot/home/config/settings/1oom"
HOMEPAGE="https://kilgoretroutmaskreplicant.gitlab.io/plain-html/"
COPYRIGHT="2018-2021 1oom developers"
LICENSE="GNU GPL v2"
REVISION="1"
srcGitRev="81ce4060661fa724fa97e12d97e39c8c39b9deb6"
SOURCE_URI="https://gitlab.com/Tapani_/1oom/-/archive/$srcGitRev/1oom-$srcGitRev.tar.gz"
CHECKSUM_SHA256="b3ebd9af101807adbe89080bbd646348933381cfead8c5234bc27766bb4d38d3"
SOURCE_FILENAME="1oom-$portVersion.tar.gz"
SOURCE_DIR="1oom-$srcGitRev"
PATCHES="1oom-$portVersion.patchset"
ADDITIONAL_FILES="1oom.rdef"

ARCHITECTURES="all !x86_gcc2 ?x86"
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="x86"
fi

PROVIDES="
	1oom$secondaryArchSuffix = $portVersion
	app:1oom
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libglu$secondaryArchSuffix
	lib:libsamplerate$secondaryArchSuffix
	lib:libSDL$secondaryArchSuffix
	lib:libSDL_mixer$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libGL$secondaryArchSuffix
	devel:libglu$secondaryArchSuffix
	devel:libsamplerate$secondaryArchSuffix
	devel:libSDL$secondaryArchSuffix
	devel:libSDL_mixer$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure -disable-uicmdline -disable-tools -disable-hwx11 --bindir=$appsDir
	make $jobArgs
}

INSTALL()
{
	make install
	mv $appsDir/1oom_classic_sdl1 $appsDir/1oom

	addResourcesToBinaries $portDir/additional-files/1oom.rdef $appsDir/1oom
	addAppDeskbarSymlink $appsDir/1oom "1oom"
}
