diff options
author | Bin Jin | 2018-06-29 00:50:35 +0800 |
---|---|---|
committer | Bin Jin | 2018-06-29 00:50:35 +0800 |
commit | 2abb8432f9fbc4481cee8964fb16f78dc8f721e8 (patch) | |
tree | fa489733071e968a284abe5d6dbb56a27b4836cd | |
download | aur-2abb8432f9fbc4481cee8964fb16f78dc8f721e8.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | 00-enable-on-linux.diff | 53 | ||||
-rw-r--r-- | PKGBUILD | 36 |
4 files changed, 111 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..49d60a572dad --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = wireguard-go + pkgdesc = Go Implementation of WireGuard (experimental) + pkgver = 0.0.20180613 + pkgrel = 1 + url = https://git.zx2c4.com/wireguard-go/ + arch = x86_64 + license = GPL2 + makedepends = go + depends = glibc + optdepends = wireguard-tools: tools to configure WireGuard interfaces + options = !strip + options = !emptydirs + source = https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-0.0.20180613.tar.xz + source = 00-enable-on-linux.diff + sha256sums = 3e22e6f2a715f05f9bbc5b1a9c737ab2edc8f26b2af61f9cc31f83391cd663ff + sha256sums = e3780098f682e06480baefae4e4a30b0b179f033cb4e1bca4346c61172c457d8 + +pkgname = wireguard-go + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..91d7c7cefc24 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/src +/pkg +*.xz diff --git a/00-enable-on-linux.diff b/00-enable-on-linux.diff new file mode 100644 index 000000000000..e478f1f55ddb --- /dev/null +++ b/00-enable-on-linux.diff @@ -0,0 +1,53 @@ +diff --git a/Makefile b/Makefile +index e10fdc2..bba6411 100644 +--- a/Makefile ++++ b/Makefile +@@ -2,14 +2,6 @@ PREFIX ?= /usr + DESTDIR ?= + BINDIR ?= $(PREFIX)/bin + +-ifeq ($(shell go env GOOS),linux) +-ifeq ($(wildcard .git),) +-$(error Do not build this for Linux. Instead use the Linux kernel module. See wireguard.com/install/ for more info.) +-else +-$(shell printf 'package main\nconst UseTheKernelModuleInstead = 0xdeadbabe\n' > ireallywantobuildon_linux.go) +-endif +-endif +- + all: wireguard-go + + export GOPATH := $(CURDIR)/.gopath +diff --git a/donotuseon_linux.go b/donotuseon_linux.go +deleted file mode 100644 +index 7197375..0000000 +--- a/donotuseon_linux.go ++++ /dev/null +@@ -1,15 +0,0 @@ +-// +build !android +- +-/* SPDX-License-Identifier: GPL-2.0 +- * +- * Copyright (C) 2017-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. +- */ +- +-package main +- +-const DoNotUseThisProgramOnLinux = UseTheKernelModuleInstead +- +-// -------------------------------------------------------- +-// Do not use this on Linux. Instead use the kernel module. +-// See wireguard.com/install for more information. +-// -------------------------------------------------------- +diff --git a/main.go b/main.go +index b85ec5c..75bb0db 100644 +--- a/main.go ++++ b/main.go +@@ -79,8 +79,6 @@ func main() { + return + } + +- warning() +- + // parse arguments + + var foreground bool diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..6506f224690f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,36 @@ +pkgname=wireguard-go +pkgver=0.0.20180613 +pkgrel=1 +pkgdesc="Go Implementation of WireGuard (experimental)" +arch=('x86_64') +url="https://git.zx2c4.com/wireguard-go/" +license=('GPL2') +depends=('glibc') +makedepends=('go') +optdepends=('wireguard-tools: tools to configure WireGuard interfaces') +options=('!strip' '!emptydirs') +source=("https://git.zx2c4.com/$pkgname/snapshot/$pkgname-$pkgver.tar.xz" + "00-enable-on-linux.diff") +sha256sums=('3e22e6f2a715f05f9bbc5b1a9c737ab2edc8f26b2af61f9cc31f83391cd663ff' + 'e3780098f682e06480baefae4e4a30b0b179f033cb4e1bca4346c61172c457d8') + +prepare() { + cd "$pkgname-$pkgver" + + patch -p1 < "$srcdir"/00-enable-on-linux.diff +} + +build() { + cd "$pkgname-$pkgver" + + make +} + +package() { + cd "$pkgname-$pkgver" + + install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname" + install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +# vim:set ts=2 sw=2 et: |