Files
termux-packages/packages/sing-box/build.sh
termux-pacman-bot f3ca31a7da bump(main/sing-box): 1.12.17
This commit has been automatically submitted by Github Actions.
2026-01-17 00:50:39 +00:00

48 lines
1.5 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://sing-box.sagernet.org
TERMUX_PKG_DESCRIPTION="The universal proxy platform"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="kay9925@outlook.com"
TERMUX_PKG_VERSION="1.12.17"
TERMUX_PKG_SRCURL="https://github.com/SagerNet/sing-box/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=37188348531f669ead897afc8a2e96806f2f94150e48a78d2b24edacfd4f93f0
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
termux_step_make() {
termux_setup_golang
local tags="with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api"
local ldflags="\
-w -s \
-X 'github.com/sagernet/sing-box/constant.Version=${TERMUX_PKG_VERSION}' \
"
export CGO_ENABLED=1
go build \
-trimpath \
-tags "${tags}" \
-ldflags="${ldflags}" \
-o "${TERMUX_PKG_NAME}" \
./cmd/sing-box
}
termux_step_make_install() {
install -Dm700 ./${TERMUX_PKG_NAME} ${TERMUX_PREFIX}/bin
install -Dm644 /dev/null "${TERMUX_PREFIX}/share/bash-completion/completions/sing-box.bash"
install -Dm644 /dev/null "${TERMUX_PREFIX}/share/fish/vendor_completions.d/sing-box.fish"
install -Dm644 /dev/null "${TERMUX_PREFIX}/share/zsh/site-functions/_sing-box"
}
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!${TERMUX_PREFIX}/bin/sh
sing-box completion bash > ${TERMUX_PREFIX}/share/bash-completion/completions/sing-box.bash
sing-box completion fish > ${TERMUX_PREFIX}/share/fish/vendor_completions.d/sing-box.fish
sing-box completion zsh > ${TERMUX_PREFIX}/share/zsh/site-functions/_sing-box
EOF
}