]> TLD Linux GIT Repositories - packages/zabbix.git/commitdiff
- go build/install fixes
authorMarcin Krol <hawk@tld-linux.org>
Thu, 20 Jul 2023 15:06:14 +0000 (17:06 +0200)
committerMarcin Krol <hawk@tld-linux.org>
Thu, 20 Jul 2023 15:06:14 +0000 (17:06 +0200)
go.patch [new file with mode: 0644]

diff --git a/go.patch b/go.patch
new file mode 100644 (file)
index 0000000..043a804
--- /dev/null
+++ b/go.patch
@@ -0,0 +1,36 @@
+diff -ur zabbix-6.0.19.orig/src/go/Makefile.am zabbix-6.0.19/src/go/Makefile.am
+--- zabbix-6.0.19.orig/src/go/Makefile.am      2023-06-27 09:11:01.000000000 +0200
++++ zabbix-6.0.19/src/go/Makefile.am   2023-07-20 16:29:58.932599626 +0200
+@@ -49,10 +49,10 @@
+ all: build
+ zabbix.com/cmd/zabbix_agent2:
+-      CGO_CFLAGS="${CGO_CFLAGS}" CGO_LDFLAGS="${CGO_LDFLAGS}" go build -tags="${AGENT_GOTAGS}" -ldflags="${AGENT_GOLDFLAGS}" -o bin zabbix.com/cmd/zabbix_agent2
++      CGO_CFLAGS="${CGO_CFLAGS}" CGO_LDFLAGS="${CGO_LDFLAGS}" go build -mod=vendor -tags="${AGENT_GOTAGS}" -ldflags="${AGENT_GOLDFLAGS}" -o bin zabbix.com/cmd/zabbix_agent2
+ zabbix.com/cmd/zabbix_web_service:
+-      go build -ldflags="${WEBSERVICE_GOLDFLAGS}" -o bin zabbix.com/cmd/zabbix_web_service
++      go build -mod=vendor -ldflags="${WEBSERVICE_GOLDFLAGS}" -o bin zabbix.com/cmd/zabbix_web_service
+ build: ${TARGETS}
+@@ -61,8 +61,8 @@
+       rm -f bin/zabbix_agent2 bin/mock_server
+ install-zabbix.com/cmd/zabbix_agent2:
+-      CGO_CFLAGS="${CGO_CFLAGS}" CGO_LDFLAGS="${CGO_LDFLAGS}" GOBIN=${GOBIN} \
+-              go install -ldflags="${AGENT_GOLDFLAGS}" ${TARGETS}
++      CGO_CFLAGS="${CGO_CFLAGS}" CGO_LDFLAGS="${CGO_LDFLAGS}" GOBIN=${DESTDIR}${GOBIN} \
++              go install -mod=vendor -ldflags="${AGENT_GOLDFLAGS}" ${TARGETS}
+       $(MKDIR_P) "$(DESTDIR)$(AGENT2_CONFIG_PLUGINS_PATH)"
+       test -f "$(DESTDIR)$(AGENT2_CONFIG_FILE)" || cp "conf/zabbix_agent2.conf" "$(DESTDIR)$(AGENT2_CONFIG_FILE)"
+       for cfg in conf/zabbix_agent2.d/plugins.d/*.conf; do \
+@@ -71,7 +71,7 @@
+       done
+ install-zabbix.com/cmd/zabbix_web_service:
+-      GOBIN=${GOBIN} go install -ldflags="${WEBSERVICE_GOLDFLAGS}" zabbix.com/cmd/zabbix_web_service
++      GOBIN=${DESTDIR}${GOBIN} go install -mod=vendor -ldflags="${WEBSERVICE_GOLDFLAGS}" zabbix.com/cmd/zabbix_web_service
+ install-exec-local: ${INSTALL_TARGETS}