aboutsummaryrefslogtreecommitdiffstats
path: root/testing/gitea/allow-to-set-version.patch
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2017-02-03 14:25:30 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2017-02-03 14:25:34 +0100
commitdf51d2e28f3da642cfd375a1b0ae2d34d298704d (patch)
tree68e7ce780df8da442795e05771d6a503c116911c /testing/gitea/allow-to-set-version.patch
parentf6dd2fe58ac445996eb87206ec429559143019fd (diff)
downloadaports-df51d2e28f3da642cfd375a1b0ae2d34d298704d.tar.bz2
aports-df51d2e28f3da642cfd375a1b0ae2d34d298704d.tar.xz
testing/gitea: set proper go ldflags
Diffstat (limited to 'testing/gitea/allow-to-set-version.patch')
-rw-r--r--testing/gitea/allow-to-set-version.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/gitea/allow-to-set-version.patch b/testing/gitea/allow-to-set-version.patch
new file mode 100644
index 0000000000..3e698d787a
--- /dev/null
+++ b/testing/gitea/allow-to-set-version.patch
@@ -0,0 +1,15 @@
+--- ./Makefile.orig
++++ ./Makefile
+@@ -6,7 +6,11 @@
+ STYLESHEETS := $(wildcard public/less/index.less public/less/_*.less)
+ JAVASCRIPTS :=
+
+-LDFLAGS += -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')"
++ifeq ($(origin VERSION), undefined)
++ VERSION=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
++endif
++
++LDFLAGS += -X "main.Version=$(VERSION)"
+
+ TARGETS ?= linux/*,darwin/*,windows/*
+ PACKAGES ?= $(shell go list ./... | grep -v /vendor/)