# 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=cantor
pkgver=25.04.2
pkgrel=0
# armhf blocked by qt6-qtdeclarative
# ppc64le, s390x, riscv64 and loongarch64 blocked by qt5-qtwebengine
arch="all !armhf !s390x !riscv64 !ppc64le !loongarch64"
url="https://edu.kde.org/cantor/"
pkgdesc="KDE Frontend to Mathematical Software"
license="GPL-2.0-or-later"
makedepends="
	analitza-dev
	discount-dev
	extra-cmake-modules
	karchive-dev
	kcompletion5-dev
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdoctools-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	knewstuff-dev
	kparts-dev
	kpty-dev
	ktexteditor-dev
	ktextwidgets-dev
	kxmlgui-dev
	poppler-qt5-dev
	python3-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	qt6-qtwebengine-dev
	samurai
	syntax-highlighting-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/education/cantor.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/cantor-$pkgver.tar.xz"

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

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

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

sha512sums="
46e2c50d4e019b04d3498a2e9c737cb6c7d5ad4e56bf22c3043ee02b000a79c1bd6e9ffafc65ad0889b700fc7116dee58109dc863d759e45e3c35588612cae09  cantor-25.04.2.tar.xz
"
