SUMMARY="Utilities for graphical user interfaces"
DESCRIPTION="The KDE GUI addons provide utilities for graphical user \
interfaces in the areas of colors, fonts, text, images, keyboard input."
HOMEPAGE="https://github.com/KDE/kguiaddons/"
COPYRIGHT="2010-2022 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kguiaddons/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="6ce9157ab32067711966842fbce0f9ab72d57765cf145c763b4dbfb89259f813"
PATCHES="kguiaddons-$portVersion.patchset"

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

PROVIDES="
	kguiaddons$secondaryArchSuffix = $portVersion
	cmd:kde_geo_uri_handler$secondaryArchSuffix = $portVersion
	lib:libKF5GuiAddons$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	"

PROVIDES_devel="
	kguiaddons${secondaryArchSuffix}_devel = $portVersion
	devel:libKF5GuiAddons$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES_devel="
	kguiaddons$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	devel:libQt5Gui$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	mkdir -p build
	cd build

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

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5GuiAddons

	packageEntries devel \
		$libDir/cmake \
		$dataDir/Qt5/mkspecs \
		$developDir
}

TEST()
{
	cd build
	make test
}
