diff options
author | Timo Kramer | 2020-02-12 06:51:42 +0100 |
---|---|---|
committer | Timo Kramer | 2020-02-12 06:51:42 +0100 |
commit | 385c87d55dad7ab6b90c814bcd9c2d76f26ba512 (patch) | |
tree | d47f8945ed64834d39a18efb1c317bf2b6e7394f | |
parent | ff4a67aaac807b5ca1d867db10288b1bc5595d2f (diff) | |
download | aur-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-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 14 |
2 files changed, 11 insertions, 5 deletions
@@ -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 @@ -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 |