# Template file for 'starship'
pkgname=starship
version=1.15.0
revision=1
build_style=cargo
build_helper=qemu
hostmakedepends="cmake pkg-config"
depends="git"
checkdepends="git fish-shell"
short_desc="Minimal, fast and customizable cross-shell prompt"
maintainer="cinerea0 <cinerea0@protonmail.com>"
license="ISC"
homepage="https://starship.rs"
changelog="https://raw.githubusercontent.com/starship/starship/master/CHANGELOG.md"
distfiles="https://github.com/starship/starship/archive/refs/tags/v${version}.tar.gz"
checksum=e525476cf93d3a06332abf9e02415d4789fac6f28e4b7d98db7d83da08231828

do_check() {
	mkdir -p fake-home
	HOME="${wrksrc}/fake-home" cargo test --release --target ${RUST_TARGET}
}

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

	vlicense LICENSE
}
