# Template file for 'wleave'
pkgname=wleave
version=0.7.1
revision=1
build_style=cargo
hostmakedepends="pkg-config scdoc"
makedepends="gtk4-devel gtk4-layer-shell-devel librsvg-devel libadwaita-devel"
short_desc="Wayland-native logout script written in GTK4"
maintainer="Ludovico Piero <lewdovico@gnuweeb.org>"
license="MIT"
homepage="https://github.com/AMNatty/wleave"
changelog="https://github.com/AMNatty/wleave/releases"
distfiles="https://github.com/AMNatty/wleave/archive/refs/tags/${version}.tar.gz"
checksum=e994dddc239ff6b09fd5d66daa52220d00a7e589f615e803d06239cd67035971
conf_files="/etc/wleave/style.css /etc/wleave/layout.json"

post_build() {
	scdoc < man/wleave.1.scd > wleave.1
	scdoc < man/wleave.5.scd > wleave.5
	scdoc < man/wleave.json.5.scd > wleave.json.5
}

post_install() {
	vlicense LICENSE

	vinstall style.css 644 etc/wleave
	vinstall layout.json 644 etc/wleave

	vman wleave.1
	vman wleave.5
	vman wleave.json.5

	vmkdir usr/share/wleave
	vcopy icons usr/share/wleave/icons

	vcompletion completions/wleave.bash bash
	vcompletion completions/_wleave zsh
	vcompletion completions/wleave.fish fish
}
