SUMMARY="Central daemon of KDE work spaces"
DESCRIPTION="KDED stands for KDE Daemon which isn't very descriptive. KDED \
runs in the background and performs a number of small tasks. Some of these \
tasks are built in, others are started on demand.

Built in tasks

* Checking for newly installed software and updating ksycoca when new \
software is detected. Updating of ksycoca is done by the program \
kbuildsycoca which gets started by kded. When kded is first started it \
always runs kbuildsycoca to ensure that ksycoca is up to date.

* Checking for newly installed update files. Applications can install *.upd \
update files. These *.upd files are used to update configuration files of \
users, primarily when new versions of applications are installed with \
(slightly) different configuration file formats. Updating of configuration \
files is done by kconf_update. kded starts kconf_update when it detects a \
new update file. When kded is first started it always runs kconf_update to \
ensure that it has not missed any update files. kconf_update keeps track of \
which update files have been processed already in the config-file \
kconf_updaterc. It only performs a certain update once."
HOMEPAGE="https://github.com/KDE/kded/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kded/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="d30131e9fc88c776bef96c271cdc7612c3f5f61978ef7bb519e850fc7ad6a4ab"

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

PROVIDES="
	kded$secondaryArchSuffix = $portVersion
	cmd:kded5$secondaryArchSuffix = $portVersion
	lib:libkdeinit5_kded5$secondaryArchSuffix = $portVersion
	lib:libKF5Ded$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5Crash$secondaryArchSuffix
	lib:libKF5DBusAddons$secondaryArchSuffix
	lib:libKF5Service$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5DBus$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Widgets$secondaryArchSuffix
	"

PROVIDES_devel="
	kded${secondaryArchSuffix}_devel = $portVersion
	devel:libkdeinit5_kded5$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	kded$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libkdeinit5_klauncher$secondaryArchSuffix == $portVersion
	devel:libKF5ConfigCore$secondaryArchSuffix == $portVersion
	devel:libKF5CoreAddons$secondaryArchSuffix == $portVersion
	devel:libKF5Crash$secondaryArchSuffix == $portVersion
	devel:libKF5DBusAddons$secondaryArchSuffix == $portVersion
	devel:libKF5Service$secondaryArchSuffix == $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$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

	packageEntries devel \
		$libDir/cmake
}

TEST()
{
	cd build
	make test
}
