SUMMARY="KDE Desktop notifications"
DESCRIPTION="KNotification is used to notify the user of an event. \
It covers feedback and persistent events."
HOMEPAGE="https://github.com/KDE/knotifications/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/knotifications/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="b049a92cc3e5d6a9a287c66f1d79c39f9d8f093521361bb7ccb1968fe71b41d6"

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

PROVIDES="
	knotifications$secondaryArchSuffix = $portVersion
	lib:libKF5Notifications$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5Codecs$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5WindowSystem$secondaryArchSuffix
	lib:libphonon4qt5$secondaryArchSuffix
	lib:libphonon4qt5experimental$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5DBus$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5TextToSpeech$secondaryArchSuffix
	lib:libQt5Widgets$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libKF5Codecs$secondaryArchSuffix == $portVersion
	devel:libKF5ConfigCore$secondaryArchSuffix == $portVersion
	devel:libKF5CoreAddons$secondaryArchSuffix == $portVersion
	devel:libKF5WindowSystem$secondaryArchSuffix == $portVersion
	devel:libphonon4qt5$secondaryArchSuffix
	devel:libphonon4qt5experimental$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	devel:libQt5DBus$secondaryArchSuffix >= 5.7
	devel:libQt5Gui$secondaryArchSuffix >= 5.7
	devel:libQt5TextToSpeech$secondaryArchSuffix >= 5.7
	devel:libQt5Widgets$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix >= 5
	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 \
		libKF5Notifications

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

TEST()
{
	cd build
	make test
}
