# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=stellarium
pkgver=24.2
pkgrel=0
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>3
	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 --output-on-failure \
		-E 'test(INDIConnection|TelescopeControl_INDI|TelescopeClientINDI)'
}

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

sha512sums="
621d16a70036e2ddea3900c0fcd0d4caadb8f821afda8a5d9818c82d2a846107840e1497a4d79a954ec2a76e434bc99b021e6f15c2af6de2cc4044fb70096929  stellarium-24.2.tar.xz
"
