summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorLin Ruoshui2019-01-27 20:03:11 +0800
committerLin Ruoshui2019-01-27 20:03:11 +0800
commit74e2bfc1140d8b41beefd6792a0361d07e76d7df (patch)
tree5f8be0b8ea2c770195dbc2154f7f3a87eaf77def /PKGBUILD
parent9607ab05fdabcb85f58732bfc69ff021f9da803b (diff)
downloadaur-74e2bfc1140d8b41beefd6792a0361d07e76d7df.tar.gz
compile from source instead of using binary code
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD30
1 files changed, 20 insertions, 10 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4a8fe1410822..78fda3ab49b3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,22 +1,32 @@
-# Contributor:
+# Maintainer: LIN Ruohshoei <lin dot ruohshoei plus archlinux at gmail dot com>
pkgname=v2ray-plugin
pkgver=1.0
pkgrel=1
-_commit_ver=8cea1a3
pkgdesc='Yet another SIP003 plugin for shadowsocks, based on v2ray'
arch=('x86_64')
url='https://github.com/shadowsocks/v2ray-plugin'
license=('MIT')
-#depends=('' '')
-#makedepends=('go')
-conflicts=('v2ray-plugin-git')
-source=("https://github.com/shadowsocks/v2ray-plugin/releases/download/v$pkgver/v2ray-plugin-linux-amd64-$_commit_ver.tar.gz"
- "https://raw.githubusercontent.com/shadowsocks/v2ray-plugin/master/LICENSE")
-sha256sums=('03085f4b20437c289e1c901fe394891ad329e3bfada5465abbda2ec58ffc70ef'
+makedepends=('go')
+conflicts=("${pkgname}-git" "${pkgname}-bin")
+source=($pkgname::"git+https://github.com/shadowsocks/$pkgname.git#tag=v$pkgver"
+ "https://raw.githubusercontent.com/shadowsocks/$pkgname/master/LICENSE")
+sha256sums=('SKIP'
'd903af2e15f43ddc5782ec20a0f1bdd090974ebea01ab02e0b015b76283ea666')
+
+build() {
+ export GOPATH="$srcdir"/gopath
+ cd $srcdir/$pkgname
+ go get -u -v github.com/shadowsocks/$pkgname
+ go build -v \
+ -gcflags "all=-trimpath=$PWD" \
+ -asmflags "all=-trimpath=$PWD" \
+ -ldflags "-extldflags $LDFLAGS" \
+ -o $pkgname .
+}
package() {
- install -Dm755 v2ray-plugin_linux_amd64 ${pkgdir}/usr/bin/v2ray-plugin
- install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/v2ray-plugin/LICENSE
+ cd $srcdir/$pkgname
+ install -Dm755 $pkgname ${pkgdir}/usr/bin/$pkgname
+ install -Dm644 LICENSE -t ${pkgdir}/usr/share/licenses/$pkgname/
echo "README FILE: https://github.com/shadowsocks/v2ray-plugin/blob/master/README.md"
}