SUMMARY="Common code and data for many KDE games"
DESCRIPTION="It is a collection of functions used by some games or which \
are useful for other games."
HOMEPAGE="https://invent.kde.org/games/libkdegames"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://download.kde.org/stable/release-service/$portVersion/src/libkdegames-$portVersion.tar.xz"
CHECKSUM_SHA256="077203df97c7b41b1f87d790a8107066d59b1fa65ae176320230b1120a246b49"

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

PROVIDES="
	libkdegames$secondaryArchSuffix = $portVersion
	lib:libKF5KDEGames$secondaryArchSuffix = 7.3.0 compat >= 7
	lib:libKF5KDEGamesPrivate$secondaryArchSuffix = 7.3.0 compat >= 7
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5Archive$secondaryArchSuffix
	lib:libKF5Attica$secondaryArchSuffix
	lib:libKF5Auth$secondaryArchSuffix
	lib:libKF5Codecs$secondaryArchSuffix
	lib:libKF5Completion$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5ConfigWidgets$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5Crash$secondaryArchSuffix
	lib:libKF5DBusAddons$secondaryArchSuffix
	lib:libKF5Declarative$secondaryArchSuffix
	lib:libKF5DNSSD$secondaryArchSuffix
	lib:libKF5GlobalAccel$secondaryArchSuffix
	lib:libKF5GuiAddons$secondaryArchSuffix
	lib:libKF5I18n$secondaryArchSuffix
	lib:libKF5IconThemes$secondaryArchSuffix
	lib:libKF5NewStuff$secondaryArchSuffix
	lib:libKF5Package$secondaryArchSuffix
	lib:libKF5Service$secondaryArchSuffix
	lib:libKF5Solid$secondaryArchSuffix
	lib:libKF5SonnetUi$secondaryArchSuffix
	lib:libKF5TextWidgets$secondaryArchSuffix
	lib:libKF5WidgetsAddons$secondaryArchSuffix
	lib:libKF5WindowSystem$secondaryArchSuffix
	lib:libKF5XmlGui$secondaryArchSuffix
	lib:libopenal$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
	lib:libsndfile$secondaryArchSuffix
	"

PROVIDES_devel="
	libkdegames${secondaryArchSuffix}_devel = $portVersion
	devel:libKF5KDEGames$secondaryArchSuffix = 7.3.0 compat >= 7
	devel:libKF5KDEGamesPrivate$secondaryArchSuffix = 7.3.0 compat >= 7
	"
REQUIRES_devel="
	libkdegames$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= 5.86
	devel:libKF5Archive$secondaryArchSuffix
	devel:libKF5Attica$secondaryArchSuffix
	devel:libKF5Auth$secondaryArchSuffix
	devel:libKF5Bookmarks$secondaryArchSuffix
	devel:libKF5Codecs$secondaryArchSuffix
	devel:libKF5Completion$secondaryArchSuffix
	devel:libKF5ConfigCore$secondaryArchSuffix
	devel:libKF5ConfigWidgets$secondaryArchSuffix
	devel:libKF5CoreAddons$secondaryArchSuffix
	devel:libKF5Crash$secondaryArchSuffix
	devel:libKF5DBusAddons$secondaryArchSuffix
	devel:libKF5Declarative$secondaryArchSuffix
	devel:libKF5DNSSD$secondaryArchSuffix
	devel:libKF5GlobalAccel$secondaryArchSuffix
	devel:libKF5GuiAddons$secondaryArchSuffix
	devel:libKF5I18n$secondaryArchSuffix
	devel:libKF5IconThemes$secondaryArchSuffix
	devel:libKF5ItemViews$secondaryArchSuffix
	devel:libKF5JobWidgets$secondaryArchSuffix
	devel:libKF5NewStuff$secondaryArchSuffix
	devel:libKF5Package$secondaryArchSuffix
	devel:libKF5Service$secondaryArchSuffix
	devel:libKF5Solid$secondaryArchSuffix
	devel:libKF5SonnetUi$secondaryArchSuffix
	devel:libKF5TextWidgets$secondaryArchSuffix
	devel:libKF5WidgetsAddons$secondaryArchSuffix
	devel:libKF5WindowSystem$secondaryArchSuffix
	devel:libKF5XmlGui$secondaryArchSuffix
	devel:libopenal$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix
	devel:libQt5Gui$secondaryArchSuffix
	devel:libQt5Xml$secondaryArchSuffix
	devel:libsndfile$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	cmd:python2
	cmd:qdbuscpp2xml$secondaryArchSuffix >= 5
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DKDE_INSTALL_QMLDIR=$dataDir/Qt5/qml \
		-DECM_MKSPECS_INSTALL_DIR=$dataDir/Qt5/mkspecs \
		-DECM_DIR=/system/data/cmake/Modules/ECM/cmake
	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5KDEGames \
		libKF5KDEGamesPrivate

	packageEntries devel \
		$libDir/cmake \
		$developDir
}

TEST()
{
	cd build
	make test
}
