SUMMARY="Powerful libraries for creating business diagrams"
DESCRIPTION="The libraries available in this KDE module are:
	KChart. A library for creating business charts.
	KGantt. A library for creating Gantt diagrams"
HOMEPAGE="https://github.com/KDE/kdiagram/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://download.kde.org/stable/kdiagram/$portVersion/kdiagram-$portVersion.tar.xz"
CHECKSUM_SHA256="579dad3bd1ea44b5a20c0f133ebf47622e38960f9c7c8b3a316be30a369f431f"

ARCHITECTURES="all ?x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	kdiagram$secondaryArchSuffix = $portVersion
	lib:libKChart$secondaryArchSuffix = $portVersion
	lib:libKGantt$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5PrintSupport$secondaryArchSuffix
	lib:libQt5Widgets$secondaryArchSuffix
	"

PROVIDES_devel="
	kdiagram${secondaryArchSuffix}_devel = $portVersion
	devel:libKChart$secondaryArchSuffix = $portVersion
	devel:libKGantt$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	kdiagram$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= 5.65
	devel:libQt5Core$secondaryArchSuffix >= 5.14
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix
	cmd:make
	cmd:python
	"

BUILD()
{
	mkdir -p build
	cd build

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

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKChart \
		libKGantt

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

TEST()
{
	cd build
	make test
}
