From: Marcin Krol Date: Thu, 20 Jul 2023 15:06:14 +0000 (+0200) Subject: - go build/install fixes X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=bf5de5699a130527eb2f5b7a93fafcc1f4cc3fe4;p=packages%2Fzabbix.git - go build/install fixes --- diff --git a/go.patch b/go.patch new file mode 100644 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} +