# Template file for 'typstyle'
pkgname=typstyle
version=0.14.0
revision=1
build_style=cargo
build_helper=qemu
configure_args="--no-default-features --features=completion"
make_install_args="--path crates/typstyle"
make_check_args="-- --skip all_0_check" # broken upstream
checkdepends="git"
short_desc="Beautiful and reliable typst code formatter"
maintainer="Bnyro <bnyro@tutanota.com>"
license="Apache-2.0"
homepage="https://github.com/Enter-tainer/typstyle/"
changelog="https://raw.githubusercontent.com/Enter-tainer/typstyle/master/CHANGELOG.md"
distfiles="https://github.com/Enter-tainer/typstyle/archive/refs/tags/v${version}.tar.gz"
checksum=2315f866a9bed03d3251e53dd4c46d99a74b9c6138ac1df141c5b9c4a0f4a350

if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
	make_check=no # reflexo crate for tests not running on i686
fi

post_install() {
	local typstyle="${DESTDIR}/usr/bin/typstyle"
	for shell in bash zsh fish; do
		vtargetrun "${typstyle}" completions ${shell} > completion.${shell}
		vcompletion completion.${shell} ${shell}
	done
}
