# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=plasma-browser-integration
pkgver=6.2.4
pkgrel=0
pkgdesc="Components necessary to integrate browsers into the Plasma Desktop"
# armhf blocked by qt6-qtdeclarative -> kirigami -> purpose
# s390x blocked by plasma-workspace
arch="all !armhf !s390x"
url="https://community.kde.org/Plasma/Browser_Integration"
license="GPL-3.0-or-later"
makedepends="
	extra-cmake-modules
	kconfig-dev
	kdbusaddons-dev
	kfilemetadata-dev
	ki18n-dev
	kio-dev
	knotifications-dev
	krunner-dev
	kstatusnotifieritem-dev
	plasma-activities-dev
	plasma-workspace-dev>=$pkgver
	purpose-dev
	qt6-qtbase-dev
	samurai
	"

case "$pkgver" in
*.90*) _rel=unstable ;;
*) _rel=stable ;;
esac
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/plasma/plasma-browser-integration.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-browser-integration-$pkgver.tar.xz"

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

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bf1f49d9d210ccaac1fe7d35b960973184997007cf737d7ae0c6d99b57386024f51ccc21703d3bf2c150a6c363f290b68e379866e7753e2f13d6f8f228dd76ce  plasma-browser-integration-6.2.4.tar.xz
"
