0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-11 23:00:52 +00:00
2024-12-07 04:14:16 +08:00

43 lines
1.3 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://github.com/extrawurst/gitui
TERMUX_PKG_DESCRIPTION="Blazing fast terminal-ui for git written in rust"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_LICENSE_FILE="LICENSE.md"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.26.3"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/extrawurst/gitui/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=8075e180f3b01ff0c290b690488a7628c44b4de12346e04a77d823914a48918b
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="git, libgit2, libssh2, openssl"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
export CFLAGS_${CARGO_TARGET_NAME//-/_}+=" -Dindex=strchr"
export OPENSSL_NO_VENDOR=1
export LIBGIT2_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
export PKG_CONFIG_ALLOW_CROSS=1
termux_setup_rust
: "${CARGO_HOME:=$HOME/.cargo}"
export CARGO_HOME
cargo fetch --target "${CARGO_TARGET_NAME}"
local f
for f in $CARGO_HOME/registry/src/*/libgit2-sys-*/build.rs; do
sed -i -E 's/\.range_version\(([^)]*)\.\.[^)]*\)/.atleast_version(\1)/g' "${f}"
done
}
termux_step_make() {
cargo build --release \
--jobs "$TERMUX_PKG_MAKE_PROCESSES" \
--target "$CARGO_TARGET_NAME" \
--locked
}
termux_step_make_install() {
install -Dm700 target/"${CARGO_TARGET_NAME}"/release/gitui "$TERMUX_PREFIX"/bin/
}