summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Kramer2020-02-12 06:51:42 +0100
committerTimo Kramer2020-02-12 06:51:42 +0100
commit385c87d55dad7ab6b90c814bcd9c2d76f26ba512 (patch)
treed47f8945ed64834d39a18efb1c317bf2b6e7394f
parentff4a67aaac807b5ca1d867db10288b1bc5595d2f (diff)
downloadaur-385c87d55dad7ab6b90c814bcd9c2d76f26ba512.tar.gz
changed build of wireguard-go to use go-pie and build-flags
as pointed out by yochananmarqos there are reasons described in https://wiki.archlinux.org/index.php/Go_package_guidelines#Building to build your go binary with these flags and to use go-pie
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD14
2 files changed, 11 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f97ebd0cdb4a..2631c13c8207 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -8,7 +8,7 @@ pkgbase = mullvad-vpn-cli
license = GPL3
makedepends = git
makedepends = cargo
- makedepends = go
+ makedepends = go-pie
depends = nss
conflicts = mullvad-vpn
source = git+https://github.com/mullvad/mullvadvpn-app.git#tag=2020.1?signed
diff --git a/PKGBUILD b/PKGBUILD
index 442ccdaaf64d..774ab241c93f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ url="https://www.mullvad.net"
arch=('x86_64')
license=('GPL3')
depends=('nss')
-makedepends=('git' 'cargo' 'go')
+makedepends=('git' 'cargo' 'go-pie')
conflicts=('mullvad-vpn')
install="${pkgname}.install"
_commit='90b0c06b59a0b9d6cda69924377335f39854b216'
@@ -35,10 +35,16 @@ prepare() {
}
build() {
- cd "${srcdir}/mullvadvpn-app"
-
# Build wireguard-go
- ./wireguard/build-wireguard-go.sh
+ cd "$srcdir/mullvadvpn-app/wireguard/wireguard-go"
+ mkdir -p "../../build/lib/$arch-unknown-linux-gnu"
+ go build \
+ -trimpath \
+ -ldflags "-extldflags $LDFLAGS" \
+ -v -o "../../build/lib/$arch-unknown-linux-gnu"/libwg.a \
+ -buildmode c-archive
+
+ cd "${srcdir}/mullvadvpn-app"
# Remove old Rust build artifacts
cargo clean --release --locked