summarylogtreecommitdiffstats
path: root/gitea-ldflags.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gitea-ldflags.patch')
-rw-r--r--gitea-ldflags.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/gitea-ldflags.patch b/gitea-ldflags.patch
new file mode 100644
index 000000000000..b9aefcda289a
--- /dev/null
+++ b/gitea-ldflags.patch
@@ -0,0 +1,19 @@
+--- a/Makefile
++++ b/Makefile
+@@ -33,6 +33,7 @@ else
+ GITEA_VERSION := $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
+ endif
+
++EXTLDFLAGS := ${LDFLAGS}
+ LDFLAGS := -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
+
+ PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/))
+@@ -240,7 +241,7 @@ install: $(wildcard *.go)
+ build: $(EXECUTABLE)
+
+ $(EXECUTABLE): $(SOURCES)
+- $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
++ $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-linkmode external -extldflags "$(EXTLDFLAGS)" -s -w $(LDFLAGS)' -o $@
+
+ .PHONY: release
+ release: release-dirs release-windows release-linux release-darwin release-copy release-compress release-check