# Maintainer: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=qt6
pkgname=qt6-qttranslations
pkgver=6.7.2
pkgrel=0
pkgdesc="A cross-platform application and UI framework (Translations)"
url="https://qt.io/"
arch="noarch"
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only AND Qt-GPL-exception-1.0"
makedepends="
	cmake
	perl
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	"
builddir="$srcdir/qttranslations-everywhere-src-${pkgver/_/-}"
options="!check" # No tests

case $pkgver in
	*_alpha*|*_beta*|*_rc*) _rel=development_releases;;
	*) _rel=official_releases;;
esac

source="https://download.qt.io/$_rel/qt/${pkgver%.*}/${pkgver/_/-}/submodules/qttranslations-everywhere-src-${pkgver/_/-}.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr
	# -j1 to prevent race conditions and missing translation files
	cmake --build build -j1
}

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

sha512sums="
a1937f117af71a6896ebaf89f05bcb9c61c34711105609ac80a0f85d96cd427786e902ae4e2dccc38060c4fd9161f42a0cfdd7e39e618e3996fbe1c7f05c84d9  qttranslations-everywhere-src-6.7.2.tar.xz
"
