summarylogtreecommitdiffstats
path: root/mattermost-ldflags.patch
diff options
context:
space:
mode:
authorWilliam Gathoye2019-09-14 00:32:42 +0200
committerWilliam Gathoye2019-09-14 01:35:27 +0200
commitd2da11d984e3857376171cfa54f530145dc3794a (patch)
tree483a8ba5c26431af0bc1f6c330523331e6ca5048 /mattermost-ldflags.patch
parent83d79d16e6609da0489302c735e77251650c2232 (diff)
downloadaur-d2da11d984e3857376171cfa54f530145dc3794a.tar.gz
Update build process to latest master
Diffstat (limited to 'mattermost-ldflags.patch')
-rw-r--r--mattermost-ldflags.patch31
1 files changed, 22 insertions, 9 deletions
diff --git a/mattermost-ldflags.patch b/mattermost-ldflags.patch
index 2f863a0ff9b8..43e47c03b57d 100644
--- a/mattermost-ldflags.patch
+++ b/mattermost-ldflags.patch
@@ -1,11 +1,24 @@
---- a/Makefile
-+++ b/Makefile
-@@ -48,6 +48,7 @@ GOFLAGS ?= $(GOFLAGS:)
+--- 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:)
GO=go
DELVE=dlv
- GO_LINKER_FLAGS ?= -ldflags \
-- "-X github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)\
-+ "-linkmode external -extldflags '$(LDFLAGS)' -s -w \
-+ -X github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)\
- -X 'github.com/mattermost/mattermost-server/model.BuildDate=$(BUILD_DATE)'\
- -X github.com/mattermost/mattermost-server/model.BuildHash=$(BUILD_HASH)\
+-LDFLAGS += -X "github.com/mattermost/mattermost-server/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)"
++# 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
++
+ GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
+ GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
+ MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1