# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kio
pkgver=6.13.0
pkgrel=0
pkgdesc="Resource and network access abstraction"
# armhf blocked by qt6-qtdeclarative -> ki18n, qt6-qtmultimedia -> knotifications
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only AND LGPL-2.1-or-later AND (LGPL-2.1-only OR LGPL-3.0-only)"
depends="kded"
depends_dev="
	acl-dev
	karchive-dev
	kbookmarks-dev
	kcompletion-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kded-dev
	ki18n-dev
	kiconthemes-dev
	kitemviews-dev
	kjobwidgets-dev
	knotifications-dev
	kservice-dev
	kwallet-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	solid-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	kdoctools-dev
	libxml2-dev
	libxslt-dev
	qt6-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-dbg $pkgname-lang $pkgname-kwallet"

_repo_url="https://invent.kde.org/frameworks/kio.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kio-$pkgver.tar.xz"
# Checks fails due to requiring physical devices not normally available and test 14 hangs
options="!check"

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

check() {
	xvfb-run ctest --test-dir build
}

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

kwallet() {
	pkgdesc="$pkgname KWallet integration"

	amove usr/lib/qt6/plugins/kf6/kiod/kpasswdserver.so
}

sha512sums="
8bc995dc5ff09a07aaf4feb43030a960491ead184f001880b4a49f7255fe1ad803b9788d3240a8b9d60e8f4a16612862b063a54de85673bdcd85210f83736db2  kio-6.13.0.tar.xz
"
