Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
0001-update-for-go-package-guidelines.patch
From 8b7834b7d21487410df5ba768f2e6e9fb709e8c0 Mon Sep 17 00:00:00 2001
From: Cody Schafer <cody@berkshiregrey.com>
Date: Fri, 25 Sep 2020 20:49:51 -0400
Subject: [PATCH] update for go package guidelines
---
PKGBUILD | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PKGBUILD b/PKGBUILD
index 549dd58..d7a2770 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,13 +19,14 @@ build() {
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
GO_LDFLAGS="-X github.com/zrepl/zrepl/version.zreplVersion=${zrepl_version}"
cd "${pkgname}-${pkgver}"
go build \
- -ldflags "${GO_LDFLAGS} -extldflags ${LDFLAGS}" \
+ -ldflags "${GO_LDFLAGS} -linkmode=external -extldflags ${LDFLAGS}" \
-o "${pkgname}" .
}
--
2.28.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment