# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=konqueror
pkgver=24.08.0
pkgrel=0
pkgdesc="KDE File Manager & Web Browser"
# armhf blocked by extra-cmake-modules
# s390x, ppc64le, riscv64, armv7 and loongarch64 blocked by qt6-qtwebengine
arch="all !armhf !s390x !ppc64le !riscv64 !armv7 !loongarch64"
url="https://konqueror.org/"
license="GPL-2.0-or-later AND GFDL-1.2-only AND LicenseRef-KDE-Accepted-LGPL"
makedepends="
	extra-cmake-modules
	plasma-activities-dev
	karchive-dev
	kcmutils-dev
	kcrash-dev
	kdbusaddons-dev
	kdesu-dev
	kdoctools-dev
	kiconthemes-dev
	kparts-dev
	kwindowsystem-dev
	qt6-qtbase-dev
	qt6-qtwebengine-dev
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/network/konqueror.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/konqueror-$pkgver.tar.xz"
options="!check" # Tests hang

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

check() {
	dbus-run-session -- xvfb-run ctest --test-dir build --output-on-failure -E "(sidebar-modulemanager|konqpopupmenu|webengine_partapi_)test"
}

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

sha512sums="
bb354a156766fc30cac43881613545e286e6e9d7de533f2d76a4c6d9cfe4a4f0b35b32fde39e9c9d8637097cf03a0484e719b94eecb78487d9bcc2feaefabe6f  konqueror-24.08.0.tar.xz
"
