# 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.3.5
pkgrel=0
pkgdesc="Components necessary to integrate browsers into the Plasma Desktop"
# armhf blocked by qt6-qtdeclarative -> kirigami -> purpose
arch="all !armhf"
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
	*.*.9*) _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
	0001-pbi-Use-the-XSI-version-of-strerror_r-when-the-GNU-version-isnt-available.patch
	"

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
}

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

sha512sums="
6953a9c45efb2812c5e526fc9695031a709367b74619726a321b5d6e311b47126a66487497bc1fc1f60f32c848b112dcc372e4517ff5e736032577b4441b0ac8  plasma-browser-integration-6.3.5.tar.xz
919fcf4a5882b9b2990eb95cdd78f512a940cc795c3dc249495a55bb60c057fb374ab25cd91df9d9e0aacc3694a22cc134b1371c6d2d1ac6ef988cfe2fe42ce7  0001-pbi-Use-the-XSI-version-of-strerror_r-when-the-GNU-version-isnt-available.patch
"
