# Template file for 'jujutsu'
pkgname=jujutsu
version=0.42.0
revision=1
build_style=cargo
build_helper=qemu
hostmakedepends="pkg-config"
depends="openssh"
checkdepends="openssh git"
short_desc="Git-compatible VCS that is both simple and powerful"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="Apache-2.0"
homepage="https://github.com/martinvonz/jj"
changelog="https://github.com/martinvonz/jj/blob/main/CHANGELOG.md"
distfiles="https://github.com/martinvonz/jj/archive/refs/tags/v${version}.tar.gz"
checksum=ee495c2853bb2bca7403215e8102cbb9a136a73e18a9dfc07067789d38e14efc
conflicts="jj>=0"

do_install() {
	for f in target/*/release/jj; do
		vbin $f
	done

	vtargetrun ${DESTDIR}/usr/bin/jj util install-man-pages ${DESTDIR}/usr/share/man

	for _shell in bash fish zsh; do
		COMPLETE=${_shell} vtargetrun ${DESTDIR}/usr/bin/jj > jj.${_shell}
		sed -i -e "s:$DESTDIR::g" jj.${_shell}
		vcompletion jj.${_shell} ${_shell} jj
	done
}
