# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=cosmic-session
pkgver=1.0.0_alpha7
_upstreamver="${pkgver/_alpha/-alpha.}"
pkgrel=2
pkgdesc="Session manager for the COSMIC Desktop Environment"
url="https://github.com/pop-os/cosmic-session"
arch="x86_64 aarch64"
license="GPL-3.0-or-later"
depends="
	bash
	cosmic-app-library
	cosmic-applets
	cosmic-bg
	cosmic-comp
	cosmic-files
	cosmic-greeter
	cosmic-icons
	cosmic-idle
	cosmic-launcher
	cosmic-notifications
	cosmic-osd
	cosmic-panel
	cosmic-randr
	cosmic-screenshot
	cosmic-settings
	cosmic-settings-daemon
	cosmic-workspaces
	dbus
	xwayland
"
makedepends="
	cargo
	dbus-dev
	glib-dev
	just
	wayland-protocols
"
options="net !check"  # fetch dependencies, no tests
source="$pkgname-$pkgver.tar.gz::https://github.com/pop-os/cosmic-session/archive/refs/tags/epoch-$_upstreamver.tar.gz"
builddir="$srcdir/$pkgname-epoch-$_upstreamver"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	just build
}

check() {
	cargo test --release --frozen
}

package() {
	just rootdir="$pkgdir" install
}

sha512sums="
88b5025d52dc6dd965261ff9284e08f5379a6b103e4d4a6a60fa9247428a9a5d60d6c5313775cd3b2fcc914f95863c486a96e2dbe49f196f1bae6406081b15da  cosmic-session-1.0.0_alpha7.tar.gz
"
