# 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-frameworks
pkgname=syntax-highlighting
pkgver=6.5.0
pkgrel=0
pkgdesc="Syntax highlighting engine for structured text and code"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="MIT"
depends_dev="
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	xerces-c-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	perl
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/syntax-highlighting.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/syntax-highlighting-$pkgver.tar.xz"

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

check() {
	ctest --test-dir build --output-on-failure -E "(test|html)highlighter_test"
}

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

sha512sums="
8c45b41d4a1e0320bd6b0f186dbe1647213fa1aa0950a69c37c71839b5b9c3c2ee5f160f74eb12fe52e97996274901d8de6c1e51df1017de39a70f5f17db856f  syntax-highlighting-6.5.0.tar.xz
"
