# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=dolphin
pkgver=25.04.2
pkgrel=0
# armhf blocked by qt6-qtdeclarative -> plasma-activities
arch="all !armhf"
url="https://kde.org/applications/system/dolphin"
pkgdesc="KDE File Manager"
license="GPL-2.0-only"
depends="
	udisks2
	kio-extras
	"
depends_dev="
	baloo-dev
	baloo-widgets-dev
	kbookmarks-dev
	kcmutils-dev
	kcompletion-dev
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	kfilemetadata-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	knewstuff-dev
	knotifications-dev
	kparts-dev
	ktextwidgets-dev
	kuserfeedback-dev
	kwindowsystem-dev
	musl-fts-dev
	phonon-dev
	plasma-activities-dev
	qt6-qtbase-dev
	solid-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	ruby-test-unit
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-zsh-completion"
_repo_url="https://invent.kde.org/system/dolphin.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/dolphin-$pkgver.tar.xz"

build() {
	LDFLAGS="$LDFLAGS -Wl,-z,stack-size=0x100000" \
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# kfileitemmodeltest, dolphinquerytest and dolphinmainwindowtest are broken
	xvfb-run -a ctest --test-dir build -E "(kfileitemmodel|dolphinquery|dolphinmainwindow)test"
}

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

	# We don't ship systemd
	rm -r "$pkgdir"/usr/lib/systemd
}

sha512sums="
a52244b70f760667b39f6a5875315bc4e903718a5def57cc91d736ad107badbac570be431f25bdae9577c2ac8a6b615037499928c4544275f6ce9e532c5a3c4b  dolphin-25.04.2.tar.xz
"
