aboutsummaryrefslogtreecommitdiffstats
path: root/community/starship/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/starship/APKBUILD')
-rw-r--r--community/starship/APKBUILD80
1 files changed, 65 insertions, 15 deletions
diff --git a/community/starship/APKBUILD b/community/starship/APKBUILD
index 0cf787f2720..f96683b4483 100644
--- a/community/starship/APKBUILD
+++ b/community/starship/APKBUILD
@@ -1,41 +1,91 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=starship
-pkgver=0.56.0
+pkgver=1.18.2
pkgrel=0
-pkgdesc="The minimal, blazing-fast, and infinitely customizable prompt for any shell!"
+pkgdesc="Minimal, blazing-fast and infinitely customizable prompt for any shell"
url="https://starship.rs"
-arch="x86_64 armv7 armhf aarch64 x86 ppc64le" # limited by rust/cargo
+# s390x: fails to build nix crate
+arch="all !s390x"
license="ISC"
-makedepends="cargo libgit2-dev openssl-dev zlib-dev"
-source="https://github.com/starship/starship/archive/v$pkgver/$pkgname-$pkgver.tar.gz
- minimize-size.patch
+makedepends="
+ cargo
+ cargo-auditable
+ dbus-dev
+ openssl-dev>3
+ zlib-ng-dev
"
-builddir="$srcdir/$pkgname-$pkgver"
+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
+
+# test process exits with SIGTRAP on the riscv64 CI
+[ "$CARCH" = "riscv64" ] && options="$options !check"
+
+prepare() {
+ cargo fetch --target="$CTARGET" --locked
-# http feature is used just for reporting bugs
-_cargo_opts="--locked --no-default-features"
+ 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 build --release $_cargo_opts
+ 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 $_cargo_opts && return 0
+ cargo test --frozen && return 0
sleep 1
done
return 1
}
package() {
- cargo install $_cargo_opts --path . --root="$pkgdir/usr"
- rm "$pkgdir"/usr/.crates*
+ 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="
-7f487828041417aa3c2a4b45952b3ce98fca01530258d7e4a9cd886f7eb1d1c1d316d0c84e716b46d47de576424d71e7a60c1a372c7dda7d443b68ea65f101d6 starship-0.56.0.tar.gz
-cc987156c4e512521aac3da5a5518543d561643855b72500f2cbf203f0a470cc9e4f699d5a236f2504fab5dbc0587ee860d954c2e39239db9a86008dd535ebfb minimize-size.patch
+77bdebf9fe3bad485ef99562a4c90574f0201c7c3e9ae25665fea85da3a9b038ebc68806ca639f127f2c4f2f974e699e271481e0d945ff294b212449b1ebd70f starship-1.18.2.tar.gz
+c8376bda747180fced9e76379e5290b474c252c2c5f7d1dcea889c119e35a93183e0209b993cbc55bf4088372f3c211be8618cbae775bc64b366b77e25b9e209 use-libdbus.patch
+384a3b84b103005d347ef76c9a61f8c5e21cc97f17f195cff157f71f42dbd76fd6f54f93715cbebbee2eab70a275e39917334721fa21d130bd715a7b6334418b starship.plugin.zsh
"