# Template file for 'cargo-flamegraph'
pkgname=cargo-flamegraph
version=0.6.8
revision=1
build_style=cargo
build_helper=qemu
depends="perf"
short_desc="Easy flamegraphs for Rust projects and everything else"
maintainer="reedts <j.reedts@gmail.com>"
license="MIT, Apache-2.0"
homepage="https://github.com/flamegraph-rs/flamegraph"
distfiles="https://github.com/flamegraph-rs/flamegraph/archive/refs/tags/v${version}.tar.gz"
checksum=2673a04bd4de142220d42706e0c25a4dea08aee52cdffbf87cca5738cec649ff

post_install() {
	vlicense LICENSE-MIT

	local flamegraph="${DESTDIR}/usr/bin/flamegraph"
	for shell in bash fish zsh; do
		vtargetrun ${flamegraph} --completions ${shell} > flamegraph.${shell}
		vcompletion flamegraph.${shell} ${shell} flamegraph
	done
}
