SUMMARY="KDE contact person abstraction library"
DESCRIPTION="Provides access to all contacts and aggregates them by person.
KPeople offers unified access to our contacts from different sources, grouping \
them by person while still exposing all the data.
Furthermore, KPeople will also provide facilities to integrate the data provided \
in user interfaces by providing QML and Qt Widgets components."
HOMEPAGE="https://github.com/KDE/kpeople/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kpeople/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="c7f290986df2c154d14dde61e4a36c02ff729fe3347372f093adfd56311557be"

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

PROVIDES="
	kpeople$secondaryArchSuffix = $portVersion
	lib:libKF5People$secondaryArchSuffix = $portVersion compat >= 5
	lib:libKF5PeopleBackend$secondaryArchSuffix = $portVersion compat >= 5
	lib:libKF5PeopleWidgets$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5Auth$secondaryArchSuffix
	lib:libKF5Codecs$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5ConfigGui$secondaryArchSuffix
	lib:libKF5ConfigWidgets$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5I18n$secondaryArchSuffix
	lib:libKF5IconThemes$secondaryArchSuffix
	lib:libKF5ItemViews$secondaryArchSuffix
	lib:libKF5Package$secondaryArchSuffix
	lib:libKF5QuickAddons$secondaryArchSuffix
	lib:libKF5Service$secondaryArchSuffix
	lib:libKF5WidgetsAddons$secondaryArchSuffix
	lib:libKF5XmlGui$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5DBus$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	lib:libQt5Qml$secondaryArchSuffix
	lib:libQt5Quick$secondaryArchSuffix
	lib:libQt5QuickWidgets$secondaryArchSuffix
	lib:libQt5Widgets$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
	"

PROVIDES_devel="
	kpeople${secondaryArchSuffix}_devel = $portVersion
	devel:libKF5People$secondaryArchSuffix = $portVersion compat >= 5
	devel:libKF5PeopleBackend$secondaryArchSuffix = $portVersion compat >= 5
	devel:libKF5PeopleWidgets$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES_devel="
	kpeople$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libKF5Auth$secondaryArchSuffix == $portVersion
	devel:libKF5Codecs$secondaryArchSuffix == $portVersion
	devel:libKF5ConfigCore$secondaryArchSuffix == $portVersion
	devel:libKF5ConfigWidgets$secondaryArchSuffix == $portVersion
	devel:libKF5CoreAddons$secondaryArchSuffix == $portVersion
	devel:libKF5Declarative$secondaryArchSuffix == $portVersion
	devel:libKF5I18n$secondaryArchSuffix == $portVersion
	devel:libKF5Iconthemes$secondaryArchSuffix == $portVersion
	devel:libKF5ItemViews$secondaryArchSuffix == $portVersion
	devel:libKF5Package$secondaryArchSuffix == $portVersion
	devel:libKF5Service$secondaryArchSuffix == $portVersion
	devel:libKF5WidgetsAddons$secondaryArchSuffix == $portVersion
	devel:libKF5XmlGui$secondaryArchSuffix == $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.15
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	cmd:qdbuscpp2xml$secondaryArchSuffix >= 5
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DKDE_INSTALL_QMLDIR=$dataDir/Qt5/qml \
		-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

	prepareInstalledDevelLibs \
		libKF5People \
		libKF5PeopleBackend \
		libKF5PeopleWidgets

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

TEST()
{
	cd build
	make test
}
