rustup: add completions for all archs.
Use qemu build_helper and vcompletion. Completion generation is broken for armv6l-musl due to rustup not knowing about the architecture.
This commit is contained in:
parent
813d893710
commit
3e59135112
1 changed files with 18 additions and 11 deletions
|
@ -1,8 +1,9 @@
|
|||
# Template file for 'rustup'
|
||||
pkgname=rustup
|
||||
version=1.22.1
|
||||
revision=1
|
||||
revision=2
|
||||
build_style=cargo
|
||||
build_helper=qemu
|
||||
configure_args="--features no-self-update --bin rustup-init"
|
||||
hostmakedepends="pkg-config"
|
||||
makedepends="libressl-devel zlib-devel libcurl-devel"
|
||||
|
@ -13,19 +14,25 @@ homepage="https://www.rustup.rs"
|
|||
distfiles="https://github.com/rust-lang/${pkgname}/archive/${version}.tar.gz"
|
||||
checksum=ad46cc624f318a9493aa62fc9612a450564fe20ba93c689e0ad856bff3c64c5b
|
||||
|
||||
post_build() {
|
||||
# rustup errors out because it doesn't know about armv6l-musl
|
||||
if [ "$XBPS_TARGET_MACHINE" != armv6l-musl ]; then
|
||||
RUSTUP="target/${RUST_TARGET}/release/rustup-init"
|
||||
ln -sf "$RUSTUP" rustup
|
||||
# generate shell completions
|
||||
vtargetrun ./rustup completions zsh >rustup.zsh
|
||||
vtargetrun ./rustup completions bash >rustup.bash
|
||||
vtargetrun ./rustup completions fish >rustup.fish
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
vbin target/${RUST_TARGET}/release/rustup-init
|
||||
|
||||
if ! [ "$CROSS_BUILD" ]; then
|
||||
# generate shell completions
|
||||
ln -s target/${RUST_TARGET}/release/rustup-init rustup
|
||||
./rustup completions zsh > rustup.zsh
|
||||
./rustup completions bash > rustup.bash
|
||||
./rustup completions fish > rustup.fish
|
||||
|
||||
vinstall rustup.zsh 0644 usr/share/zsh/site-functions/ _rustup
|
||||
vinstall rustup.bash 0644 usr/share/bash-completion/completions/ rustup
|
||||
vinstall rustup.fish 0644 usr/share/fish/vendor_completions.d/
|
||||
if [ "$XBPS_TARGET_MACHINE" != armv6l-musl ]; then
|
||||
vcompletion rustup.bash bash
|
||||
vcompletion rustup.fish fish
|
||||
vcompletion rustup.zsh zsh
|
||||
fi
|
||||
|
||||
vdoc README.md
|
||||
|
|
Loading…
Reference in a new issue