# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=piow
pkgver=0.5.0
pkgrel=0
pkgdesc="Put Icons On your sway Workspaces"
url="https://github.com/KuabeM/piow"
arch="all"
license="MIT OR Apache-2.0"
depends="sway-virtual"
makedepends="cargo cargo-auditable"
source="https://github.com/KuabeM/piow/archive/v$pkgver/piow-$pkgver.tar.gz
	cargo-update.patch"
options="!check"  # no tests provided

export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

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

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/piow -t "$pkgdir"/usr/bin/
	install -D -m644 default.toml "$pkgdir"/etc/xdg/piow/config.toml
}

sha512sums="
d4fae4de838352517bcbe8ea69ac1c1a8f0abd09f8c8c579520c8a89f7a9fa7fa5f972f51601b6018d0d63e72fb4098a353662bd6c43fdaddbf3f93dc5ec19c0  piow-0.5.0.tar.gz
e5d44f471bcfa4358bafa14ee4d46c6eb22043a1881aba04aba1f12297ab66721c4ab204173babfa4a5e32a308eb9231a957948f9fa1bc8504ebb046ca1483a4  cargo-update.patch
"
