53 lines
1.4 KiB
Bash
53 lines
1.4 KiB
Bash
# Template file for 'v2ray'
|
|
pkgname=v2ray
|
|
version=5.3.0
|
|
revision=1
|
|
build_style=go
|
|
go_import_path="github.com/v2fly/v2ray-core/v5"
|
|
go_ldflags="-X github.com/v2fly/v2ray-core/v5.codename=$pkgname
|
|
-X github.com/v2fly/v2ray-core/v5.version=$version
|
|
-X github.com/v2fly/v2ray-core/v5.build=$SOURCE_DATE_EPOCH -buildid="
|
|
short_desc="Platform for building proxies to bypass network restrictions"
|
|
maintainer="ipkalm <ipkalm@outlook.com>"
|
|
license="MIT"
|
|
homepage="https://github.com/v2fly/v2ray-core"
|
|
distfiles="https://github.com/v2fly/v2ray-core/archive/v${version}/${pkgname}-${version}.tar.gz"
|
|
checksum=8e97e2647cb1dee8aa7e71df276c56d74258b2d97bb490a362afa84bdf1b9e25
|
|
conf_files="/etc/v2ray/config.json"
|
|
|
|
system_accounts="_v2ray"
|
|
|
|
export GOFLAGS="-x -p=$XBPS_MAKEJOBS -buildmode=pie -trimpath"
|
|
export CGO_ENABLED=0
|
|
|
|
do_build() {
|
|
go build -ldflags "${go_ldflags}" -o "${GOPATH}/bin/v2ray" ./main
|
|
}
|
|
|
|
do_check() {
|
|
local pkgs=$(go list ./... | grep -v \
|
|
-e 'app/dns$' \
|
|
-e 'app/stats$' \
|
|
-e 'app/router$' \
|
|
-e 'app/router/command$' \
|
|
-e 'common/task$' \
|
|
-e 'common/signal$' \
|
|
-e 'testing/scenarios$' \
|
|
-e 'proxy/vmess$' \
|
|
-e 'transport/pipe$' \
|
|
-e 'transport/internet/websocket$' \
|
|
-e 'transport/internet/quic$' \
|
|
-e 'v4/infra/conf/rule$' \
|
|
-e 'v4/infra/conf/geodata/memconservative$' \
|
|
-e 'v4/transport/internet/kcp$' \
|
|
)
|
|
go test $pkgs
|
|
}
|
|
|
|
post_install() {
|
|
vlicense LICENSE
|
|
vmkdir etc/v2ray
|
|
vcopy release/config/*.json etc/v2ray/
|
|
vsv v2ray
|
|
}
|