Files
termux-packages/packages/pyrefly/build.sh
termux-pacman-bot 8bbd2d7312 bump(main/pyrefly): 0.51.0
This commit has been automatically submitted by Github Actions.
2026-02-03 18:49:50 +00:00

36 lines
1.1 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://github.com/facebook/pyrefly.git
TERMUX_PKG_DESCRIPTION="A fast type checker and language server for Python"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@AhmadNaruto"
TERMUX_PKG_VERSION="0.51.0"
TERMUX_PKG_SRCURL="https://github.com/facebook/pyrefly/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=ea16aa539e18906d60d9e58e444869e097f49d01681513ef6278a0f1c80d908a
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
termux_step_pre_configure() {
termux_setup_rust
cargo vendor
find ./vendor \
-mindepth 1 -maxdepth 1 -type d \
! -wholename ./vendor/cc \
-exec rm -rf '{}' \;
local patch="$TERMUX_PKG_BUILDER_DIR/rust-cc-do-not-concatenate-all-the-CFLAGS.diff"
local dir="vendor/cc"
echo "Applying patch: $patch"
test -f "$patch"
patch -p1 -d "$dir" < "$patch"
sed -i '/\[patch.crates-io\]/a cc = { path = "./vendor/cc" }' Cargo.toml
}
termux_step_make() {
cargo build --jobs "$TERMUX_PKG_MAKE_PROCESSES" --target "$CARGO_TARGET_NAME" --release
}
termux_step_make_install() {
install -Dm700 -t "$TERMUX_PREFIX/bin" "target/${CARGO_TARGET_NAME}/release/pyrefly"
}