# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=stellarium
pkgver=25.1
pkgrel=1
pkgdesc="A stellarium with great graphics and a nice database of sky-objects"
url="https://stellarium.org/"
# gigantic package
arch="aarch64 x86_64"
license="GPL-2.0-or-later"
makedepends="
	boost-dev
	cmake
	freetype-dev
	gpsd-dev
	libpng-dev
	mesa-dev
	openssl-dev
	qt5-qtcharts-dev
	qt5-qtlocation-dev
	qt5-qtmultimedia-dev
	qt5-qtscript-dev
	qt5-qtserialport-dev
	qt5-qttools-dev
	samurai
	"
subpackages="$pkgname-doc"
source="https://github.com/Stellarium/stellarium/releases/download/v$pkgver/stellarium-$pkgver.tar.xz"

build() {
	# SHOWMYSKY support needs qt5-qtopengl
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DENABLE_TESTING=1 \
		-DENABLE_SHOWMYSKY=OFF
	cmake --build build
}

check() {
	# Exclude a broken locale test
	ctest --test-dir build \
		-E 'test(INDIConnection|TelescopeControl_INDI|TelescopeClientINDI)'
}

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

sha512sums="
c413e31994e98e69b85885ee2114847e9d5d541e0c5fcc213f4a0af1c520eadddbdc1873815f1a827cad6c15f644f2422f477d0fc96ec68e2afe58d83a75bbee  stellarium-25.1.tar.xz
"
