diff options
author | Alice Gaudon | 2020-08-06 13:58:14 +0200 |
---|---|---|
committer | Alice Gaudon | 2020-08-06 13:58:14 +0200 |
commit | ee6b5099646ac0d33d599e7c8837d035f40ff3ff (patch) | |
tree | 8007e1df42867a697a4805428f965e1425c0b159 | |
parent | 7ddb703422a91469272a08d6e463c93bb4fad993 (diff) | |
download | aur-ee6b5099646ac0d33d599e7c8837d035f40ff3ff.tar.gz |
Use go build flags for go commands
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 20 |
2 files changed, 12 insertions, 10 deletions
@@ -1,7 +1,7 @@ pkgbase = caddy2 pkgdesc = Fast web server with automatic HTTPS pkgver = 2.1.1 - pkgrel = 5 + pkgrel = 6 url = https://caddyserver.com arch = x86_64 license = Apache @@ -7,7 +7,7 @@ _pkgname=caddy pkgver=2.1.1 _tag=v2.1.1 _distcommit='a509155e3cff18af793f6af5f930a71c89e05df8' -pkgrel=5 +pkgrel=6 pkgdesc="Fast web server with automatic HTTPS" arch=('x86_64') url="https://caddyserver.com" @@ -40,14 +40,6 @@ validpgpkeys=( prepare() { sed 's|/var/www/html|/srv/http|g' -i "${srcdir}/index-${_distcommit}.html" - - # Build instructions as per https://github.com/caddyserver/caddy#with-version-information-andor-plugins - cd "${_pkgname}/cmd/caddy/" - if ! test -f go.mod; then - go mod init caddy - fi - go get github.com/caddyserver/caddy/v2@${_tag} # Pin version - go mod tidy # Update go.sum } build() { @@ -57,6 +49,16 @@ build() { export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -modcacherw" + + # Build instructions as per https://github.com/caddyserver/caddy#with-version-information-andor-plugins + if ! test -f go.mod; then + go mod init caddy + fi + go get github.com/caddyserver/caddy/v2@${_tag} # Pin version + go mod tidy # Update go.sum + + # Add -mod=readonly export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" go build . } |