packages/starship/PKGBUILD

62 lines
1.8 KiB
Bash

# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Kevin Song <kevin.s05@gmail.com>
pkgname=starship
pkgdesc='The cross-shell prompt for astronauts'
pkgver=1.21.1
pkgrel=1
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url=https://starship.rs/
_url="https://github.com/$pkgname/$pkgname"
license=(ISC)
depends=(
gcc-libs
glibc
)
makedepends=(
cmake
git
rust
)
checkdepends=(python)
options=(!debug)
optdepends=('ttf-font-nerd: Nerd Font Symbols preset')
source=("git+$_url.git#tag=v$pkgver")
sha256sums=('f2b95209c356c039a197ef034cc4c15365e82548b620a8f124d9f3a0826fdce7')
prepare() {
cargo fetch \
--locked \
--target "$(rustc -vV | sed -n 's/host: //p')" \
--manifest-path starship/Cargo.toml
}
build() {
export CARGO_TARGET_DIR=target
CFLAGS+=" -ffat-lto-objects"
cargo build \
--release \
--frozen \
--manifest-path starship/Cargo.toml
}
check() {
cargo test \
--frozen \
--manifest-path starship/Cargo.toml
}
package() {
install -Dm 755 target/release/starship -t "${pkgdir}"/usr/bin/
install -Dm 644 starship/LICENSE -t "${pkgdir}"/usr/share/licenses/starship/
install -dm 755 "${pkgdir}"/usr/share/{bash-completion/completions,elvish/lib,fish/vendor_completions.d,zsh/site-functions}/
./target/release/starship completions bash > "${pkgdir}"/usr/share/bash-completion/completions/starship
./target/release/starship completions elvish > "${pkgdir}"/usr/share/elvish/lib/starship.elv
./target/release/starship completions fish > "${pkgdir}"/usr/share/fish/vendor_completions.d/starship.fish
./target/release/starship completions zsh > "${pkgdir}"/usr/share/zsh/site-functions/_starship
}
# vim: ts=2 sw=2 et: