starship: simplify completion generation.
Use qemu build_helper and vcompletion.
This commit is contained in:
parent
3e59135112
commit
45d572a03f
1 changed files with 10 additions and 17 deletions
|
@ -3,7 +3,7 @@ pkgname=starship
|
||||||
version=0.44.0
|
version=0.44.0
|
||||||
revision=1
|
revision=1
|
||||||
build_style=cargo
|
build_style=cargo
|
||||||
build_helper="rust"
|
build_helper=qemu
|
||||||
hostmakedepends="pkg-config"
|
hostmakedepends="pkg-config"
|
||||||
makedepends="libgit2-devel"
|
makedepends="libgit2-devel"
|
||||||
checkdepends="git"
|
checkdepends="git"
|
||||||
|
@ -14,9 +14,12 @@ homepage="https://starship.rs"
|
||||||
distfiles="https://github.com/starship/starship/archive/v${version}.tar.gz"
|
distfiles="https://github.com/starship/starship/archive/v${version}.tar.gz"
|
||||||
checksum=b002fa0e2b34ad59330a543461a51648751db4ae8d439d58065a3b9656772fe3
|
checksum=b002fa0e2b34ad59330a543461a51648751db4ae8d439d58065a3b9656772fe3
|
||||||
|
|
||||||
if [ "$CROSS_BUILD" ]; then
|
post_build() {
|
||||||
hostmakedepends+=" qemu-user-static"
|
STARSHIP="target/${RUST_TARGET}/release/starship"
|
||||||
fi
|
vtargetrun ${STARSHIP} completions zsh >starship.zsh
|
||||||
|
vtargetrun ${STARSHIP} completions bash >starship.bash
|
||||||
|
vtargetrun ${STARSHIP} completions fish >starship.fish
|
||||||
|
}
|
||||||
|
|
||||||
pre_check() {
|
pre_check() {
|
||||||
[ -L target/debug ] && unlink target/debug
|
[ -L target/debug ] && unlink target/debug
|
||||||
|
@ -24,19 +27,9 @@ pre_check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
STARSHIP="target/${RUST_TARGET}/release/starship"
|
vcompletion starship.bash bash
|
||||||
if [ "$CROSS_BUILD" ]; then
|
vcompletion starship.fish fish
|
||||||
export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
|
vcompletion starship.zsh zsh
|
||||||
STARSHIP="/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static ${STARSHIP}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
${STARSHIP} completions zsh >starship.zsh
|
|
||||||
${STARSHIP} completions bash >starship.bash
|
|
||||||
${STARSHIP} completions fish >starship.fish
|
|
||||||
|
|
||||||
vinstall starship.zsh 0644 usr/share/zsh/site-functions/ _starship
|
|
||||||
vinstall starship.bash 0644 usr/share/bash-completion/completions/ starship
|
|
||||||
vinstall starship.fish 0644 usr/share/fish/vendor_completions.d/
|
|
||||||
|
|
||||||
vlicense LICENSE
|
vlicense LICENSE
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue