SUMMARY="Set of item models extending the Qt model-view framework"
DESCRIPTION="KItemModels provides the following models:

KBreadcrumbSelectionModel - Selects the parents of selected items to create \
breadcrumbs
KCheckableProxyModel - Adds a checkable capability to a source model
KConcatenateRowsProxyModel - Concatenates rows from multiple source models
KDescendantsProxyModel - Proxy Model for restructuring a Tree into a list
KExtraColumnsProxyModel - Adds columns after existing columns
KLinkItemSelectionModel - Share a selection in multiple views which do not \
have the same source model
KModelIndexProxyMapper - Mapping of indexes and selections through proxy \
models
KRearrangeColumnsProxyModel - Can reorder and hide columns from the source \
model
KRecursiveFilterProxyModel - Recursive filtering of models
KSelectionProxyModel - A Proxy Model which presents a subset of its source \
model to observers"
HOMEPAGE="https://github.com/KDE/kitemmodels/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kitemmodels/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="cba2f0b68bd06623624e736e9e55e325deeba24cd80fad478e7849af1d3f90a8"

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

PROVIDES="
	kitemmodels$secondaryArchSuffix = $portVersion
	lib:libKF5ItemModels$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	mkdir -p build
	cd build

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

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5ItemModels

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

TEST()
{
	cd build
	make test
}
