# Template file for 'rustup'
pkgname=rustup
version=1.29.0
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 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=de73d1a62f4d5409a2f6bdb1c523d8dc08aa6d9d63588db62493c19ca8f8bf55

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
}
