From faf0bf207b45656a4c92fd2ae8d85fc0b9bc491e Mon Sep 17 00:00:00 2001 From: ketlrznt Date: Mon, 8 Aug 2022 10:19:39 +0800 Subject: [PATCH] add package: v2raya --- srcpkgs/v2raya/files/v2raya/run | 11 +++++++++ srcpkgs/v2raya/template | 43 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 srcpkgs/v2raya/files/v2raya/run create mode 100644 srcpkgs/v2raya/template diff --git a/srcpkgs/v2raya/files/v2raya/run b/srcpkgs/v2raya/files/v2raya/run new file mode 100644 index 000000000000..7f53fbe90cdb --- /dev/null +++ b/srcpkgs/v2raya/files/v2raya/run @@ -0,0 +1,11 @@ +#! /bin/bash + +# v2raya config +export V2RAYA_CONFIG=/etc/v2raya +# v2raya log +export V2RAYA_LOG_FILE=/var/log/v2raya/v2raya.log +# v2ray router data +export XDG_DATA_HOME="/usr/share" + +exec /usr/bin/v2raya + diff --git a/srcpkgs/v2raya/template b/srcpkgs/v2raya/template new file mode 100644 index 000000000000..171caba94fa6 --- /dev/null +++ b/srcpkgs/v2raya/template @@ -0,0 +1,43 @@ +# Template file for 'v2raya' +pkgname=v2raya +version=1.5.9.1698.1 +revision=1 +wrksrc="v2rayA-${version}" +build_style="go" +go_import_path="github.com/v2rayA/v2rayA" +go_ldflags='-X github.com/v2rayA/v2rayA/conf.Version=unstable-'"$version"' -s -w' +hostmakedepends="go nodejs yarn" +depends="v2ray>=4.37.0-1" +short_desc="Web GUI client of Project V which supports various protocals" +maintainer="ketlrznt " +license="AGPL-3.0" +homepage="https://github.com/v2rayA/v2rayA" +distfiles="https://github.com/v2rayA/v2rayA/archive/v${version}.tar.gz" +checksum="247a357230c616bf48309c61d119686e4ad56939c05afef584c45051e9dc6220" + +export GO11MODULE=on + +do_build() { + cd gui + yarn --check-files + OUTPUT_DIR="${wrksrc}/service/server/router/web" yarn build + cd ../service + go build -ldflags="$go_ldflags" -o "${GOPATH}/bin/v2raya" +} + +do_install() { + # binary + vbin ${GOPATH}/bin/v2raya + # desktop entry + vinstall install/universal/v2raya.desktop 0644 usr/share/applications + # configurationo dir + vmkdir etc/$pkgname 0750 + # service + vsv v2raya + # icon + vinstall gui/public/img/icons/android-chrome-512x512.png \ + 0644 usr/share/icons/hicolor/512x512/apps/ v2raya.png + # license + vlicense LICENSE +} +