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

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=asteroid
pkgname=asteroid-launcher
pkgver=2.1.0
pkgrel=0
pkgdesc="AsteroidOS launcher and Wayland compositor based on Qt5, QML and QtWayland via Lipstick"
url="https://github.com/AsteroidOS/asteroid-launcher"
# armhf blocked by nemo-qml-plugin-calendar
arch="all !armhf"
license="BSD-3-Clause AND MIT"
depends="
	asteroid-icons-ion
	asteroid-languages
	asteroid-wallpapers
	lipstick-asteroidos
	mce
	nemo-qml-plugin-calendar
	nemo-qml-plugin-configuration
	nemo-qml-plugin-systemsettings
	nemo-qml-plugin-time
	qt5-qtgraphicaleffects
	"
# Normally we shouldn't hard depend on fonts, but in this case these fonts are
# hardcoded for some supported watchfaces
depends="$depends
	font-noto-emoji
	font-opensans
	font-raleway-otf
	font-roboto
	"
makedepends="
	extra-cmake-modules
	lipstick-asteroidos-dev
	qml-asteroid-dev
	qt5-qtbase-dev
	samurai
	"
subpackages="$pkgname-dbg"
source="$pkgname-$pkgver.tar.gz::https://github.com/AsteroidOS/asteroid-launcher/archive/refs/tags/$pkgver.tar.gz"
options="!check" # no tests

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

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

	install -dm755 "$pkgdir"/usr/share/translations
	lrelease-qt5 -idbased i18n/asteroid-launcher.*.ts
	cp i18n/asteroid-launcher.*.qm "$pkgdir"/usr/share/translations/
}

sha512sums="
b21069444d2acd1def45a2fd52212eca10351aa7bba3bf7ebd061c46dfa209196b3c1c3d1ea02beb3e06a2c22da6189fbaceb8008f915a18d74d2f083340db5b  asteroid-launcher-2.1.0.tar.gz
"
