# Template file for 'kubernetes-helm'
pkgname=kubernetes-helm
version=3.15.4
revision=1
build_style=go
build_helper=qemu
go_import_path="helm.sh/helm/v3"
go_package="./cmd/helm"
go_mod_mode=off
go_ldflags="-X helm.sh/helm/v3/internal/version.version=v${version}"
short_desc="Kubernetes Package Manager"
maintainer="Kyle Nusbaum <knusbaum+void@sdf.org>"
license="Apache-2.0"
homepage="https://helm.sh/"
changelog="https://github.com/helm/helm/releases"
distfiles="https://github.com/helm/helm/archive/refs/tags/v${version}.tar.gz"
checksum=71eb0f4b2bf6e7de6a78191ba053b04842c294c830e57648ab2352bcfe1b4566
conflicts="helm"
nopie=yes

LDFLAGS="-fuse-ld=bfd"

post_install() {
	if [ "$XBPS_TARGET_MACHINE" != aarch64-musl ]; then
		# qemu-aarch64-static segfaults
		# https://build.voidlinux.org/builders/aarch64-musl_builder/builds/49864/steps/shell_3/logs/stdio
		for shell in bash zsh; do
			vtargetrun "${DESTDIR}/usr/bin/helm" completion "${shell}" > "helm.${shell}"
			vcompletion "helm.${shell}" "${shell}"
		done
	fi
}
