add Go trimming to reduce binary size

This commit is contained in:
Sam Therapy 2022-10-14 15:04:57 +02:00
parent d876d6de34
commit a38be687ff
No known key found for this signature in database
GPG key ID: 1D039418B79BF3A0
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
pkgbase = awl-dns-git
pkgdesc = A DNS client
pkgver = 0.5.0.r1.g0d011bb
pkgver = 0.5.2.r32.g2d94ea6
pkgrel = 1
url = https://git.froth.zone/sam/awl
arch = i686

View file

@ -1,6 +1,6 @@
# Maintainer: Sam Therapy <sam at samtherapy dot net>
pkgname=awl-dns-git
pkgver=0.5.0.r1.g0d011bb
pkgver=0.5.2.r32.g2d94ea6
pkgrel=1
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
pkgdesc="A DNS client"
@ -28,7 +28,7 @@ build() {
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -ldflags=-X=main.version=${pkgver} -mod=readonly -modcacherw"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -ldflags=-X=main.version=${pkgver} -ldflags=-s -ldflags=-w -mod=readonly -modcacherw"
export CGO_ENABLED=1
make VERSION=$pkgver DESTDIR="$pkgdir" PREFIX="/usr"