SUMMARY="Integrating KDE frameworks widgets with Qt Designer"
DESCRIPTION="This framework provides plugins for Qt Designer that allow it to \
display the widgets provided by various KDE frameworks, as well as a utility \
(kgendesignerplugin) that can be used to generate other such plugins from \
ini-style description files."
HOMEPAGE="https://github.com/KDE/kdesignerplugin/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kdesignerplugin/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="14447805b26b7bd53ec6c8699b791ea6b0caf4f3846d9c85d7582530cb8566fd"

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

PROVIDES="
	kdesignerplugin$secondaryArchSuffix = $portVersion
	cmd:kgendesignerplugin$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5Auth$secondaryArchSuffix
	lib:libKF5Completion$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5ConfigWidgets$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5IconThemes$secondaryArchSuffix
	lib:libkf5itemviews$secondaryArchSuffix
	lib:libkf5kiocore$secondaryArchSuffix
	lib:libKF5Service$secondaryArchSuffix
	lib:libkf5sonnetcore$secondaryArchSuffix
	lib:libkf5sonnetui$secondaryArchSuffix
	lib:libKF5textwidgets$secondaryArchSuffix
	lib:libkf5widgetsaddons$secondaryArchSuffix
	lib:libkf5xmlgui$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	"

PROVIDES_devel="
	kdesignerplugin${secondaryArchSuffix}_devel = $portVersion
	devel:libkf5designerplugin$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	kdesignerplugin$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libKF5Auth$secondaryArchSuffix == $portVersion
	devel:libkf5completion$secondaryArchSuffix == $portVersion
	devel:libKF5ConfigCore$secondaryArchSuffix == $portVersion
	devel:libKF5ConfigWidgets$secondaryArchSuffix == $portVersion
	devel:libKF5CoreAddons$secondaryArchSuffix == $portVersion
	devel:libKF5DocTools$secondaryArchSuffix == $portVersion
	devel:libKF5IconThemes$secondaryArchSuffix == $portVersion
	devel:libkf5ItemViews$secondaryArchSuffix == $portVersion
	devel:libkf5kiocore$secondaryArchSuffix == $portVersion
	devel:libKF5Plotting$secondaryArchSuffix == $portVersion
	devel:libKF5Service$secondaryArchSuffix == $portVersion
	devel:libkf5sonnetcore$secondaryArchSuffix == $portVersion
	devel:libkf5textwidgets$secondaryArchSuffix == $portVersion
	devel:libkf5widgetsaddons$secondaryArchSuffix == $portVersion
	devel:libkf5xmlgui$secondaryArchSuffix == $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	# disable docs generation until libxml package is fixed
	sed -i s/add/#add/g docs/CMakeLists.txt
	sed -i s/kdoctools/#kdoctool/g CMakeLists.txt

	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DKDE_INSTALL_PLUGINDIR=$addOnsDir/Qt5 \
		-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
}
