2019-08-23 21:28:35 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://starship.rs
|
|
|
|
TERMUX_PKG_DESCRIPTION="A minimal, blazing fast, and extremely customizable prompt for any shell"
|
|
|
|
TERMUX_PKG_LICENSE="ISC"
|
2020-12-20 14:16:34 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2022-04-16 06:41:54 +02:00
|
|
|
TERMUX_PKG_VERSION=1.6.2
|
2019-08-23 21:28:35 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/starship/starship/archive/v$TERMUX_PKG_VERSION.tar.gz
|
2022-04-16 06:41:54 +02:00
|
|
|
TERMUX_PKG_SHA256=4151b3133f3fb0e649847f7714ac77282a4e2dd47fda7f5a08a4f7e87f44b277
|
2021-10-04 12:43:31 +02:00
|
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
2022-03-26 13:40:32 +01:00
|
|
|
TERMUX_PKG_DEPENDS="openssl, zlib"
|
2019-09-08 02:46:41 +02:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
2022-04-16 06:41:54 +02:00
|
|
|
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--all-features"
|
2019-09-15 22:19:06 +02:00
|
|
|
|
|
|
|
termux_step_pre_configure() {
|
2022-02-21 09:52:22 +01:00
|
|
|
termux_setup_rust
|
2022-03-26 13:40:32 +01:00
|
|
|
: "${CARGO_HOME:=$HOME/.cargo}"
|
|
|
|
export CARGO_HOME
|
|
|
|
|
|
|
|
cargo fetch --target $CARGO_TARGET_NAME
|
|
|
|
|
|
|
|
local d
|
|
|
|
for d in $CARGO_HOME/registry/src/github.com-*/libgit2-sys-*/libgit2; do
|
|
|
|
patch --silent -p1 -d ${d} \
|
2022-04-16 06:41:54 +02:00
|
|
|
<$TERMUX_SCRIPTDIR/packages/libgit2/src-rand.c.patch || :
|
2022-03-26 13:40:32 +01:00
|
|
|
cp $TERMUX_SCRIPTDIR/packages/libgit2/getloadavg.c ${d}/src/ || :
|
|
|
|
done
|
|
|
|
|
2019-12-12 00:06:14 +01:00
|
|
|
CFLAGS+=" $CPPFLAGS"
|
2019-12-31 02:08:22 +01:00
|
|
|
if [ $TERMUX_ARCH = arm ]; then
|
|
|
|
CFLAGS+=" -fno-integrated-as"
|
|
|
|
fi
|
2022-02-21 09:52:22 +01:00
|
|
|
|
|
|
|
mv $TERMUX_PREFIX/lib/libz.so.1{,.tmp}
|
|
|
|
mv $TERMUX_PREFIX/lib/libz.so{,.tmp}
|
2022-02-23 10:04:51 +01:00
|
|
|
|
|
|
|
local _CARGO_TARGET_LIBDIR=target/$CARGO_TARGET_NAME/release/deps
|
|
|
|
mkdir -p $_CARGO_TARGET_LIBDIR
|
|
|
|
ln -sfT $(readlink -f $TERMUX_PREFIX/lib/libz.so.1.tmp) \
|
|
|
|
$_CARGO_TARGET_LIBDIR/libz.so.1
|
|
|
|
ln -sfT $(readlink -f $TERMUX_PREFIX/lib/libz.so.tmp) \
|
|
|
|
$_CARGO_TARGET_LIBDIR/libz.so
|
2022-02-21 09:52:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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() {
|
2022-04-16 06:41:54 +02:00
|
|
|
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
|
2022-02-21 09:52:22 +01:00
|
|
|
|
2022-04-16 06:41:54 +02:00
|
|
|
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
|
2022-02-21 09:52:22 +01:00
|
|
|
EOF
|
|
|
|
|
2022-04-16 06:41:54 +02:00
|
|
|
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
|
2022-02-21 09:52:22 +01:00
|
|
|
EOF
|
2019-09-15 22:19:06 +02:00
|
|
|
}
|