# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=baloo-widgets
pkgver=25.04.2
pkgrel=0
pkgdesc="Widgets for Baloo"
# armhf blocked by qt6-qtdeclarative -> baloo
arch="all !armhf"
url="https://community.kde.org/Baloo"
license="LGPL-2.0-only AND LGPL-2.1-or-later"
depends_dev="
	baloo-dev
	kconfig-dev
	kfilemetadata-dev
	ki18n-dev
	kio-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/libraries/baloo-widgets.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/baloo-widgets-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run -a ctest --test-dir build -E "filemetadataitemcounttest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
2b9e167e522fcd77f1baceb83a1b5e4d92562a117f25dbfc91ae6288cfc3c41f36c884d60a6d2c436f043bd08de2099a80f7862160bfbc63ae73384a0dca8352  baloo-widgets-25.04.2.tar.xz
"
