# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=starship pkgver=1.16.0 pkgrel=0 pkgdesc="Minimal, blazing-fast and infinitely customizable prompt for any shell" url="https://starship.rs" # s390x: fails to build nix crate arch="all !s390x" license="ISC" makedepends=" cargo cargo-auditable dbus-dev openssl-dev>3 zlib-ng-dev " subpackages=" $pkgname-bash-completion $pkgname-fish-completion $pkgname-zsh-completion $pkgname-zsh-plugin:_zsh_plugin:noarch " source="https://github.com/starship/starship/archive/v$pkgver/starship-$pkgver.tar.gz use-libdbus.patch starship.plugin.zsh " options="net" # fetching dependencies prepare() { cargo fetch --target="$CTARGET" --locked default_prepare # Rust target triple. local target=$(rustc -vV | sed -n 's/host: //p') # Build against system-provided libz-ng. mkdir -p .cargo cat >> .cargo/config.toml <<-EOF [target.$target] z-ng = { rustc-link-lib = ["z-ng"], rustc-cfg = ["zng"] } EOF # Update after patching Cargo.toml. cargo fetch --target="$CTARGET" } build() { cargo auditable build --frozen --release local i; for i in bash fish zsh; do ./target/release/starship completions $i > target/starship.$i done } check() { # tests fail with this unset GIT_CEILING_DIRECTORIES # Some tests sporadically fail, try to repeat 3 times before failing. local i; for i in $(seq 0 3); do [ $i -eq 0 ] || msg "Retrying ($i/3)..." cargo test --frozen && return 0 sleep 1 done return 1 } package() { install -D -m755 target/release/starship -t "$pkgdir"/usr/bin/ install -D -m644 target/starship.bash "$pkgdir"/usr/share/bash-completion/completions/starship install -D -m644 target/starship.fish "$pkgdir"/usr/share/fish/vendor_completions.d/starship.fish install -D -m644 target/starship.zsh "$pkgdir"/usr/share/zsh/site-functions/_starship } _zsh_plugin() { pkgdesc="$pkgdesc (Zsh plugin)" depends="$pkgname=$pkgver-r$pkgrel" install -D -m644 "$srcdir"/starship.plugin.zsh \ -t "$subpkgdir"/usr/share/zsh/plugins/starship/ } sha512sums=" 867d6691788ab91d39c4e5610051936d90bdc815a76520114d88d81bfaa7ad854b904f164d21e1ab9654e6ab2da0e689e9ef65f23ad6734215e4242db3ed6f94 starship-1.16.0.tar.gz b09ab2da6926e5ab64231afd391a98c86cc80e022e14d0edfba75e7f73479731e29d4bf945747228ce506d4550c5adebf7ba8f8b8688eb5d04b5b6fd0f172a8b use-libdbus.patch 384a3b84b103005d347ef76c9a61f8c5e21cc97f17f195cff157f71f42dbd76fd6f54f93715cbebbee2eab70a275e39917334721fa21d130bd715a7b6334418b starship.plugin.zsh "