SUMMARY="Powerful completion framework"
DESCRIPTION="When typing filenames, email addresses and other text where the \
user often wants to select from existing data (including what they previously \
typed) rather than enter anything wholly original, users often find it \
helpful if they only need to type the first few characters, and then have the \
application offer them a set of choices or attempt to finish off what they \
were typing. Email clients, shells and \"open file\" dialogs often provide \
this functionality.

This framework helps implement this in Qt-based applications. You can use one \
of the completion-ready widgets provided by this framework, or integrate it \
into your application's other widgets directly."
HOMEPAGE="https://github.com/KDE/kconfig/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kcompletion/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="e7eae7f7a840b5c9c42be80a63dcfd333053b7aa6d81e7b7d8b2d8bff707fce3"

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

PROVIDES="
	kcompletion$secondaryArchSuffix = $portVersion
	lib:libKF5Completion$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5ConfigGui$secondaryArchSuffix
	lib:libKF5WidgetsAddons$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libKF5ConfigGui$secondaryArchSuffix == $portVersion
	devel:libKF5WidgetsAddons$secondaryArchSuffix == $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	devel:libQt5Gui$secondaryArchSuffix >= 5.7
	devel:libQt5Xml$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 \
		libKF5Completion

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

TEST()
{
	cd build
	make test
}
