diff options
Diffstat (limited to 'mattermost-ldflags.patch')
-rw-r--r-- | mattermost-ldflags.patch | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/mattermost-ldflags.patch b/mattermost-ldflags.patch index 43e47c03b57d..7cab76649fa6 100644 --- a/mattermost-ldflags.patch +++ b/mattermost-ldflags.patch @@ -1,20 +1,22 @@ ---- src/mattermost-server-5.12.0/Makefile 2019-06-14 21:13:52.000000000 +0200 -+++ src/mattermost-server-5.12.0/Makefile.new 2019-07-01 03:04:42.875342812 +0200 -@@ -49,11 +49,20 @@ - GOFLAGS ?= $(GOFLAGS:) +diff --git a/Makefile b/Makefile +index 97cd2446d0..9340c9b3dc 100644 +--- a/Makefile ++++ b/Makefile +@@ -58,11 +58,20 @@ GOFLAGS ?= $(GOFLAGS:) -mod=vendor + export GOBIN ?= $(PWD)/bin GO=go DELVE=dlv --LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)" +-LDFLAGS += -X "github.com/mattermost/mattermost-server/v5/model.BuildNumber=$(BUILD_NUMBER)" + +# We need to use the second flavour of makefile variables and use a dedicated +# variable here, otherwise this will cause an infinite loop. +# src.: https://www.gnu.org/software/make/manual/make.html#Flavors +LDFLAGS_MATTERMOST := $(LDFLAGS) -+LDFLAGS = -X "github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)" - LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildDate=$(BUILD_DATE)" - LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildHash=$(BUILD_HASH)" - LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)" - LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)" ++LDFLAGS = -X "github.com/mattermost/mattermost-server/v5/model.BuildNumber=$(BUILD_NUMBER)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/v5/model.BuildDate=$(BUILD_DATE)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/v5/model.BuildHash=$(BUILD_HASH)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/v5/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)" + LDFLAGS += -X "github.com/mattermost/mattermost-server/v5/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)" +# The link mode needs to be at the end of the LDFLAGS statement otherwise the +# build pieces of info won't be populated to the about dialog in the app. +LDFLAGS += -linkmode external -extldflags '$(LDFLAGS_MATTERMOST)' -s -w |