From 2d72f8781442687a8d9298199f0b044acd154e3c 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 | 6 ++++++ srcpkgs/v2raya/template | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 42 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..6528a00ccfc8 --- /dev/null +++ b/srcpkgs/v2raya/files/v2raya/run @@ -0,0 +1,6 @@ +#!/bin/sh + +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..85859a4995f5 --- /dev/null +++ b/srcpkgs/v2raya/template @@ -0,0 +1,36 @@ +# Template file for 'v2raya' +pkgname=v2raya +version=1.5.9.1698.1 +revision=1 +wrksrc="v2rayA-${version}" +build_wrksrc="service" +build_style="go" +go_import_path="github.com/v2rayA/v2rayA" +go_ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${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-only" +homepage="https://github.com/v2rayA/v2rayA" +distfiles="https://github.com/v2rayA/v2rayA/archive/v${version}.tar.gz" +checksum="247a357230c616bf48309c61d119686e4ad56939c05afef584c45051e9dc6220" + +pre_build() { + cd ${wrksrc}/gui + yarn --check-files + OUTPUT_DIR="${wrksrc}/service/server/router/web" yarn build +} + +post_install() { + # default go build style generates `v2rayA` file, + # change it to `v2raya` to keep lowercase consistent + vbin ${DESTDIR}/usr/bin/v2rayA v2raya + rm ${DESTDIR}/usr/bin/v2rayA + cd ${wrksrc} + vinstall install/universal/v2raya.desktop 0644 usr/share/applications + vsv v2raya + vinstall gui/public/img/icons/android-chrome-512x512.png \ + 0644 usr/share/icons/hicolor/512x512/apps/ v2raya.png + vlicense LICENSE +}