# Template file for 'kdepim-addons'
pkgname=kdepim-addons
version=26.04.1
revision=1
build_style=cmake
configure_args="-DBUILD_TESTING=OFF -DKF6_HOST_TOOLING=/usr/lib/cmake
 -DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins
 -DKDE_INSTALL_QMLDIR=lib/qt6/qml
 -DECM_MKSPECS_INSTALL_DIR=/usr/lib/qt6/mkspecs/modules"
hostmakedepends="extra-cmake-modules python3 gettext pkg-config
 kf6-kdoctools kf6-kcoreaddons kf6-kconfig kf6-kpackage kf6-kcmutils
 qt6-base qt6-tools"
makedepends="akonadi-import-wizard-devel discount-devel incidenceeditor-devel
 kontactinterface-devel kitinerary-devel ktnef-devel libksieve-devel mailcommon-devel
 mailimporter-devel messagelib-devel poppler-qt6-devel qt6-base-devel kpkpass-devel
 kf6-kcmutils-devel kf6-kdoctools-devel kf6-kcoreaddons-devel kf6-kconfig-devel
 kf6-kpackage-devel kaddressbook-devel"
checkdepends=dbus
short_desc="Addons for KDE PIM applications"
maintainer="Louis Dupré Bertoni <contact@louis.xyz>"
license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later, AGPL-3.0-or-later, BSD-3-Clause, BSD-2-Clause"
homepage="https://invent.kde.org/pim/kdepim-addons"
changelog="https://kde.org/announcements/changelogs/gear/${version}/#kdepim-addons"
distfiles="${KDE_SITE}/release-service/${version}/src/${pkgname}-${version}.tar.xz"
checksum=1cebe640b990e9d25509f4cb94ec8e4d5fdba9aa919fc53ae872c18b0c888da9

if [ "$XBPS_WORDSIZE$XBPS_WORDSIZE" != "64$XBPS_TARGET_WORDSIZE" ]; then
	broken="Qt6 WebEngine"
fi

_exclude() {
	# failing tests are disabled
	cat <<-EOF | paste -sd'|'
	sqlite
	addressbookwidget
	csvwidget
	fancyheaderstyleplugin
	folderconfiguresettingswidget
	grammalecteconfigwidget
	grammalecteresultwidget
	grantleeheaderstyleplugin
	languagetoolconfigwidget
	mailmergedialogt
	mailmergedialog
	mailmergejob
	mailmergewidget
	markdownpreview
	mergecontacts
	messageviewer-dkimauthenticationverifiedserverdialog
	messageviewerplugins-
	kdepim-addons-todoedit
	kdepim-addons-eventedit
	fancyheaderstyleplugin
	messageviewerplugins-render
	grantleeheaderstyleplugin
	akonadi-sqlite-render-akonadi
	messageviewer-dkimauthenticationverifiedserverdialog
	akonadi-sqlite-mailsenderjob
	akonadi-sqlite-gravatarupdatewidget
	EOF
}

do_check() {
	cd build
	dbus-run-session ctest -E "$(_exclude)"
}

post_install() {
	for license in LICENSES/*; do
		vlicense $license
	done
}
