termux-packages/packages/clash/build.sh
Suhan G Paradkar 3dc78812f1
Updates to a few packages (#6850)
* Update apt

* Update bat

* Update caddy

* Update clash

* Update croc

* Update dar

* Update exiftool

* Update ffsend

* Update delve

* Update imagemagick

* Update libxml2

* Update micro

* Update mime-support

* Update notmuch
2021-05-25 07:39:23 +05:30

29 lines
862 B
Bash

TERMUX_PKG_HOMEPAGE=https://github.com/Dreamacro/clash
TERMUX_PKG_DESCRIPTION="A rule-based tunnel in Go."
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="Philipp Schmitt <philipp@schmitt.co>"
TERMUX_PKG_VERSION=1.6.0
TERMUX_PKG_SRCURL="https://github.com/Dreamacro/clash/archive/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=670963bee40fd3edca832a3ead22a92d3fb427ceed05be6c5a111d46a1555330
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_make() {
termux_setup_golang
mkdir ./gopath
export GOPATH="$PWD/gopath"
GOBUILD=CGO_ENABLED=0 \
go build \
-trimpath \
-ldflags "-X 'github.com/Dreamacro/clash/constant.Version=${TERMUX_PKG_VERSION}'
-X 'github.com/Dreamacro/clash/constant.BuildTime=$(date -u)'
-w -s -buildid='" \
-o "clash.bin" \
main.go
}
termux_step_make_install() {
mv ./clash.bin "${TERMUX_PREFIX}/bin/clash"
}