From 3dd882d65ca1717de743f14b966e7f3d0427f984 Mon Sep 17 00:00:00 2001 From: Yaksh Bariya Date: Mon, 21 Feb 2022 14:22:22 +0530 Subject: [PATCH] starship: update to 1.3.0 --- packages/starship/Cargo.toml.patch | 14 +++++++++ packages/starship/build.sh | 46 ++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 packages/starship/Cargo.toml.patch diff --git a/packages/starship/Cargo.toml.patch b/packages/starship/Cargo.toml.patch new file mode 100644 index 000000000..4c9163e4f --- /dev/null +++ b/packages/starship/Cargo.toml.patch @@ -0,0 +1,14 @@ +See https://github.com/starship/starship/issues/3488 +--- ./Cargo.toml.orig 2022-02-21 15:42:58.538685423 +0530 ++++ ./Cargo.toml 2022-02-21 15:43:19.478685415 +0530 +@@ -22,10 +22,6 @@ + is-it-maintained-open-issues = { repository = "starship/starship" } + maintenance = { status = "actively-developed" } + +-[features] +-default = ["battery"] +-battery = ["starship-battery"] +- + [dependencies] + ansi_term = "0.12.1" + byte-unit = "4.0.13" diff --git a/packages/starship/build.sh b/packages/starship/build.sh index e2ed6846c..b68add1d2 100644 --- a/packages/starship/build.sh +++ b/packages/starship/build.sh @@ -2,18 +2,58 @@ TERMUX_PKG_HOMEPAGE=https://starship.rs TERMUX_PKG_DESCRIPTION="A minimal, blazing fast, and extremely customizable prompt for any shell" TERMUX_PKG_LICENSE="ISC" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=0.58.0 +TERMUX_PKG_VERSION=1.3.0 TERMUX_PKG_SRCURL=https://github.com/starship/starship/archive/v$TERMUX_PKG_VERSION.tar.gz -TERMUX_PKG_SHA256=8bd4cfad4bcf9694633f228de0c7dc6cfab6bb6955e2a7299ed28dd8c4d6f5e4 +TERMUX_PKG_SHA256=3f29cb6e5cb7c673cbc1f8e91ceb4a0d1317d235b147db15e461ffec22be13a5 TERMUX_PKG_AUTO_UPDATE=true TERMUX_PKG_DEPENDS="zlib, openssl" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--no-default-features --features http" -TERMUX_PKG_BLACKLISTED_ARCHES="x86_64" termux_step_pre_configure() { + termux_setup_rust CFLAGS+=" $CPPFLAGS" if [ $TERMUX_ARCH = arm ]; then CFLAGS+=" -fno-integrated-as" fi + + mv $TERMUX_PREFIX/lib/libz.so.1{,.tmp} + mv $TERMUX_PREFIX/lib/libz.so{,.tmp} +} + +termux_step_make() { + cargo build --jobs $TERMUX_MAKE_PROCESSES --target ${CARGO_TARGET_NAME} --release +} + +termux_step_make_install() { + install -Dm755 -t $TERMUX_PREFIX/bin target/${CARGO_TARGET_NAME}/release/starship +} +termux_step_post_make_install() { + mv $TERMUX_PREFIX/lib/libz.so.1{.tmp,} + mv $TERMUX_PREFIX/lib/libz.so{.tmp,} +} + +termux_step_post_massage() { + rm -f lib/libz.so.1 + rm -f lib/libz.so +} + +termux_step_create_debscripts() { + cat <<- EOF > ./postinst + #!$TERMUX_PREFIX/bin/sh + mkdir -p $TERMUX_PREFIX/share/bash-completions/completions + mkdir -p $TERMUX_PREFIX/share/fish/vendor_completions.d + mkdir -p $TERMUX_PREFIX/share/zsh/site-functions + + starship completions bash > $TERMUX_PREFIX/share/bash-completions/completions/starship + starship completions fish > $TERMUX_PREFIX/share/fish/vendor_completions.d/starship.fish + starship completions zsh > $TERMUX_PREFIX/share/zsh/site-functions/_starship + EOF + + cat <<- EOF > ./prerm + #!$TERMUX_PREFIX/bin/sh + rm -f $TERMUX_PREFIX/share/bash-completions/completions/starship + rm -f $TERMUX_PREFIX/share/fish/vendor_completions.d/starship.fish + rm -f $TERMUX_PREFIX/share/zsh/site-functions/_starship + EOF }