SUMMARY="A property editing framework with editor widget"
DESCRIPTION="KProperty is a property editing framework with editor widget similar to what is known from Qt Designer.\
It is useful in applications such as IDEs where large amounts of properties are available for the user to edit."
HOMEPAGE="https://github.com/KDE/kconfigwidgets/"
COPYRIGHT="2010-2018 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kproperty/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="c0b96abe569a955da22826b2cf3771fdadc4ebd5e65a4cca55c36148f002d4ed"

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

PROVIDES="
	kproperty$secondaryArchSuffix = $portVersion
	lib:libKPropertyCore3$secondaryArchSuffix = $portVersion compat >= 3
	lib:libKPropertyWidgets3$secondaryArchSuffix = $portVersion compat >= 3
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5ConfigGui$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5GuiAddons$secondaryArchSuffix
	lib:libKF5WidgetsAddons$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	"

PROVIDES_devel="
	kproperty${secondaryArchSuffix}_devel = $portVersion
	devel:libKPropertyCore3$secondaryArchSuffix = $portVersion compat >= 3
	devel:libKPropertyWidgets3$secondaryArchSuffix = $portVersion compat >= 3
	"
REQUIRES_devel="
	kproperty$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules >= 5.39
	devel:libKF5ConfigCore$secondaryArchSuffix
	devel:libKF5ConfigGui$secondaryArchSuffix
	devel:libKF5CoreAddons$secondaryArchSuffix
	devel:libKF5GuiAddons$secondaryArchSuffix
	devel:libKF5WidgetsAddons$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	"

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 \
		libKPropertyCore3 \
		libKPropertyWidgets3
	fixPkgconfig

	packageEntries devel $developDir
}

TEST()
{
	cd build
	make test
}
