# 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=ki18n
pkgver=6.5.0
pkgrel=1
pkgdesc="Advanced internationalization framework"
arch="all"
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later AND (LGPL-2.1-only OR LGPL-3.0-or-later)"
depends="iso-codes-lang"
depends_dev="
	iso-codes-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	doxygen
	graphviz
	qt6-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/ki18n.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/ki18n-$pkgver.tar.xz"

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() {
	# kcatalogtest and ktimezonetest are broken
	xvfb-run ctest --test-dir build --output-on-failure -E "(kcatalog|ktimezone)test"
}

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

sha512sums="
e413882c77c1306deb9f2dc8608eb7dfbfc376a0b50ede372fa209c2afd537ef6d802af435592e7c5d031ebac0971982b8bac7764fd5543021269fff6b633291  ki18n-6.5.0.tar.xz
"
