# Template file for 'awww'
pkgname=awww
version=0.12.1
revision=1
build_style=cargo
hostmakedepends="scdoc pkg-config"
makedepends="liblz4-devel wayland-devel wayland-protocols"
short_desc="Answer to your Wayland Wallpaper Woes"
maintainer="Daniel Martinez <danielmartinez@cock.li>"
license="GPL-3.0-only"
homepage="https://codeberg.org/LGFae/awww"
changelog="https://codeberg.org/LGFae/awww/src/branch/main/CHANGELOG.md"
distfiles="https://codeberg.org/LGFae/awww/archive/v${version}.tar.gz"
checksum=97b3f1c6d65d9d30e51b17092a45244f8c8549607c9207f3c98d82b28ba18fca
replaces="swww>=0"

post_build() {
	./doc/gen.sh
}

# overriding do_install(), since by default it will pointlessly rebuild the package again
do_install() {

	vbin target/${RUST_TARGET}/release/awww
	ln -s "awww" "${DESTDIR}/usr/bin/swww"
	vbin target/${RUST_TARGET}/release/awww-daemon
	ln -s "awww-daemon" "${DESTDIR}/usr/bin/swww-daemon"

	for doc in doc/generated/*; do
		vman $doc
	done

	vcompletion completions/awww.bash bash
	vcompletion completions/awww.fish fish
	vcompletion completions/_awww zsh
}

swww_package() {
	short_desc="Solution to your Wayland Wallpaper Woes (transitional dummy package)"
	depends="awww"
	metapackage=yes
}
