# Template file for 'rustup'
pkgname=rustup
version=1.28.1
revision=1
# rustup doesn't recognize this target
archs="~armv*-musl"
build_style=cargo
build_helper=qemu
configure_args="--bin rustup-init --no-default-features
 --features curl-backend,reqwest-native-tls,no-self-update"
hostmakedepends="pkg-config"
makedepends="openssl-devel zlib-devel libcurl-devel liblzma-devel libzstd-devel"
short_desc="Rust toolchain installer"
maintainer="tranzystorekk <tranzystorek.io@protonmail.com>"
license="Apache-2.0 OR MIT"
homepage="https://www.rustup.rs"
changelog="https://raw.githubusercontent.com/rust-lang/rustup/master/CHANGELOG.md"
distfiles="https://github.com/rust-lang/rustup/archive/refs/tags/${version}.tar.gz"
checksum=2def2f9a0a4a21c80f862c0797c2d76e765e0e7237e1e41f28324722ab912bac

do_install() {
	vbin target/${RUST_TARGET}/release/rustup-init
	vdoc README.md
	vlicense LICENSE-APACHE
	vlicense LICENSE-MIT

	ln -s ${DESTDIR}/usr/bin/rustup-init rustup
	for _shell in bash fish zsh; do
		vtargetrun ./rustup completions ${_shell} > rustup.${_shell}
		vcompletion rustup.${_shell} ${_shell}
	done
}
