# Contributor: Sodface <sod@sodface.com>
# Maintainer: Sodface <sod@sodface.com>
pkgname=satty
pkgver=0.14.0
pkgrel=0
pkgdesc="Screenshot annotation tool"
url="https://github.com/gabm/Satty"
arch="all"
license="MPL-2.0"
makedepends="
	cargo
	cargo-auditable
	gtk4.0-dev
	libadwaita-dev
	"
subpackages="
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
options="!check" # no test suite
source="$pkgname-$pkgver.tar.gz::https://github.com/gabm/Satty/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/Satty-$pkgver"

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

build() {
	cargo auditable build --frozen --release
}

package() {
	install -Dm755 target/release/satty -t "$pkgdir"/usr/bin

	install -Dm644 satty.desktop \
		-t "$pkgdir"/usr/share/applications/
	install -Dm644 assets/satty.svg \
		-t "$pkgdir"/usr/share/icons/hicolor/scalable/apps

	install -Dm644 completions/satty.bash \
		"$pkgdir"/usr/share/bash-completion/completions/satty
	install -Dm644 completions/satty.fish \
		-t "$pkgdir"/usr/share/fish/vendor_completions.d
	install -Dm644 completions/_satty \
		-t "$pkgdir"/usr/share/zsh/site-functions
}

sha512sums="
b823afdf1c24c3bae0a5ea67f253c860a8b510a82f9ecfb55eac9026616d1eac786aa69b05198b95010744f416b12da0fb602cc11aa00edb13fb63f07bec7abe  satty-0.14.0.tar.gz
"
