From f78c5a938fc4884043a458b0ee90bcccb70f8791 Mon Sep 17 00:00:00 2001 From: ipkalm Date: Sat, 19 Mar 2022 18:33:15 +0700 Subject: [PATCH] New package: v2ray-4.44.0 --- srcpkgs/v2ray/files/v2ray/run | 3 ++ srcpkgs/v2ray/template | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 srcpkgs/v2ray/files/v2ray/run create mode 100644 srcpkgs/v2ray/template diff --git a/srcpkgs/v2ray/files/v2ray/run b/srcpkgs/v2ray/files/v2ray/run new file mode 100644 index 000000000000..3b1ac46ab240 --- /dev/null +++ b/srcpkgs/v2ray/files/v2ray/run @@ -0,0 +1,3 @@ +#!/bin/sh + +exec chpst -u _v2ray v2ray -config=/etc/v2ray/config.json 2>&1 diff --git a/srcpkgs/v2ray/template b/srcpkgs/v2ray/template new file mode 100644 index 000000000000..cf6cd28a534a --- /dev/null +++ b/srcpkgs/v2ray/template @@ -0,0 +1,52 @@ +# Template file for 'v2ray' +pkgname=v2ray +version=4.44.0 +revision=1 +wrksrc=${pkgname}-core-${version} +build_style=go +go_import_path="github.com/v2fly/v2ray-core/v4" +go_ldflags="-X github.com/v2fly/v2ray-core/v4.codename=$pkgname -X github.com/v2fly/v2ray-core/v4.version=$version -X github.com/v2fly/v2ray-core/v4.build=$SOURCE_DATE_EPOCH -s -w -buildid=" +short_desc="Platform for building proxies to bypass network restrictions" +maintainer="ipkalm " +license="MIT" +homepage="https://github.com/v2fly/v2ray-core" +distfiles="https://github.com/v2fly/v2ray-core/archive/v${version}/${pkgname}-${version}.tar.gz" +checksum=d9973bafd3020f60a51fa3495b24ab417b08b3c8f9539a3748d00da6c68d0103 +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 + go build -ldflags "${go_ldflags}" -o "${GOPATH}/bin/v2ctl" -tags "confonly" ./infra/control/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 +}