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

# 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.8.0
pkgrel=0
pkgdesc="Resource and network access abstraction"
arch="all"
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 --output-on-failure
}

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

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

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

sha512sums="
dfd5ca3d709cb9e7b073c34a7f49e38c095b0e9a5503268cdde721f0a30ed021dc3834f24fbea2f47c1f19090c964ae58adbe984b56950c0da048707db1f440f  kio-6.8.0.tar.xz
"
