# Contributor: Ogromny <ogromnycoding@gmail.com>
# Maintainer: Ogromny <ogromnycoding@gmail.com>
pkgname=niri
pkgver=0.1.10.1
pkgrel=2
pkgdesc="A scrollable-tiling Wayland compositor"
url="https://github.com/YaLTeR/niri"
arch="x86_64 ppc64le aarch64"
license="GPL-3.0-only"
makedepends="
	cargo
	cargo-auditable
	clang-libclang
	clang-libs
	eudev-dev
	glib-dev
	libdisplay-info-dev
	libinput-dev
	libseat-dev
	libxkbcommon-dev
	mesa-dev
	pango-dev
	pipewire-dev
	rust
	"
subpackages="
	$pkgname-portalsconf
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/YaLTeR/niri/archive/refs/tags/v$pkgver.tar.gz"

build() {
	cargo auditable build \
		--release \
		--no-default-features \
		--features dbus,xdp-gnome-screencast
}

check() {
	cargo test \
		--release \
		--no-default-features \
		--features dbus,xdp-gnome-screencast
}

package() {
	install -Dm755 target/release/niri -t "$pkgdir"/usr/bin/
	install -Dm644 resources/niri.desktop -t "$pkgdir"/usr/share/wayland-sessions/
	install -Dm644 resources/niri-portals.conf -t "$pkgdir"/usr/share/xdg-desktop-portal/
}

portalsconf() {
	pkgdesc="xdg-desktop-portal configuration of compatible portals for Niri"
	install_if="$pkgname=$pkgver-r$pkgrel"
	depends="xdg-desktop-portal xdg-desktop-portal-gnome"
	amove usr/share/xdg-desktop-portal/niri-portals.conf
}


sha512sums="
ba816350bad30debcb961d6c516c96a0a732621e78e08f7f04bbf3bee46cb463318a59acf532660288022a247cfcd636d59159b66fd01c1c702d58f8ddf44e6a  niri-0.1.10.1.tar.gz
"
