0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-09-20 04:09:44 +00:00
Files
termux-packages/packages/tree-sitter/build.sh
Termux Github Actions a91975d3ef bump(main/tree-sitter): 0.25.3
This commit has been automatically submitted by Github Actions.
2025-03-05 00:35:27 +00:00

44 lines
1.9 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://github.com/tree-sitter/tree-sitter
TERMUX_PKG_DESCRIPTION="An incremental parsing system for programming tools"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Joshua Kahn @TomJo2000"
TERMUX_PKG_VERSION="0.25.3"
TERMUX_PKG_SRCURL=https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=862fac52653bc7bc9d2cd0630483e6bdf3d02bcd23da956ca32663c4798a93e3
TERMUX_PKG_BREAKS="libtreesitter"
TERMUX_PKG_REPLACES="libtreesitter"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_post_get_source() {
# Do not forget to bump revision of reverse dependencies and rebuild them
# after SOVERSION is changed.
local _SOVERSION=0.25
# This blocks auto-updates to an incompatible SO version.
if [[ "$TERMUX_PKG_VERSION" != "${_SOVERSION}".* ]]; then
termux_error_exit "SOVERSION guard check failed."
fi
}
termux_step_pre_configure() {
termux_setup_rust
# clash with rust host build
# causes 32bit builds to fail if set
unset CFLAGS
}
termux_step_post_make_install() {
cargo build --jobs "$TERMUX_PKG_MAKE_PROCESSES" --target "$CARGO_TARGET_NAME" --release
install -Dm700 -t "$TERMUX_PREFIX"/bin target/"${CARGO_TARGET_NAME}"/release/tree-sitter
mkdir -p "${TERMUX_PREFIX}/share/zsh/site-functions"
mkdir -p "${TERMUX_PREFIX}/share/bash-completion/completions"
mkdir -p "${TERMUX_PREFIX}/share/fish/vendor_completions.d"
mkdir -p "${TERMUX_PREFIX}/share/elvish/lib"
cargo run -- complete --shell zsh > "${TERMUX_PREFIX}/share/zsh/site-functions/_${TERMUX_PKG_NAME}"
cargo run -- complete --shell bash > "${TERMUX_PREFIX}/share/bash-completion/completions/${TERMUX_PKG_NAME}"
cargo run -- complete --shell fish > "${TERMUX_PREFIX}/share/fish/vendor_completions.d/${TERMUX_PKG_NAME}.fish"
cargo run -- complete --shell elvish > "${TERMUX_PREFIX}/share/elvish/lib/${TERMUX_PKG_NAME}.elv"
}