diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2017-02-03 14:25:30 +0100 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2017-02-03 14:25:34 +0100 |
commit | df51d2e28f3da642cfd375a1b0ae2d34d298704d (patch) | |
tree | 68e7ce780df8da442795e05771d6a503c116911c | |
parent | f6dd2fe58ac445996eb87206ec429559143019fd (diff) | |
download | aports-df51d2e28f3da642cfd375a1b0ae2d34d298704d.tar.bz2 aports-df51d2e28f3da642cfd375a1b0ae2d34d298704d.tar.xz |
testing/gitea: set proper go ldflags
-rw-r--r-- | testing/gitea/APKBUILD | 21 | ||||
-rw-r--r-- | testing/gitea/allow-to-set-version.patch | 15 |
2 files changed, 29 insertions, 7 deletions
diff --git a/testing/gitea/APKBUILD b/testing/gitea/APKBUILD index daa912db35..961dafee80 100644 --- a/testing/gitea/APKBUILD +++ b/testing/gitea/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: 7heo <7heo@mail.com> pkgname=gitea pkgver=1.0.1 -pkgrel=4 +pkgrel=5 pkgdesc="A self-hosted Git service written in Go" url="http://gitea.io/" arch="all" @@ -16,7 +16,9 @@ source="${pkgname}-${pkgver}.tar.gz::https://github.com/go-gitea/$pkgname/archiv $pkgname.initd $pkgname.confd $pkgname.ini - aarch64-go-log-fix.patch" + aarch64-go-log-fix.patch + allow-to-set-version.patch + " builddir="$srcdir/src/code.gitea.io/$pkgname" prepare() { @@ -31,7 +33,9 @@ prepare() { build() { cd "$builddir" export GOPATH="$srcdir" - go build -v -tags "tidb sqlite" -o bin/$pkgname || return 1 + export TAGS="tidb sqlite" + export VERSION="$pkgver" + make build } package() { @@ -52,7 +56,7 @@ package() { "$pkgdir"/var/log/$pkgname \ "$pkgdir"/etc/$pkgname/conf || return 1 - install -D -m 0755 bin/$pkgname \ + install -D -m 0755 $pkgname \ "$pkgdir"/usr/bin/$pkgname || return 1 # Allow to bind to port 80. setcap cap_net_bind_service=+ep \ @@ -76,14 +80,17 @@ md5sums="c031c1d3745e95afbb93309f76f9897c gitea-1.0.1.tar.gz 41eaec7f58dd872c1df9cf523b7595ae gitea.initd fc039e2eb200d020867a3105c227b267 gitea.confd b7a9ab6bf9a1c995c1edef73f6aaf374 gitea.ini -91caa13a896c29ec9bc52a259769ee7a aarch64-go-log-fix.patch" +91caa13a896c29ec9bc52a259769ee7a aarch64-go-log-fix.patch +9ac908812a0cb38c367fb699f48ac13f allow-to-set-version.patch" sha256sums="79df6391bdf9d7833dd16f312ec8ab998f18671f3a3d889875b4fa81cc010a17 gitea-1.0.1.tar.gz c5236c76d1db76390ec9c0c4e670916e64f4ea64ee856ad191098a55f644e8f7 gitea.initd 749340849d1066c04295267a013107d8517cce53a460e81eb448a2b6e5d45539 gitea.confd c9248a706c9c0c96b07304b2c03ba662473e5beaa0e1cb501dcaf1bb3ba40cbe gitea.ini -cd088148e2786c8c720e856d9d518568ea4e6dd7764c72eb86d06ff6eb47fa2f aarch64-go-log-fix.patch" +cd088148e2786c8c720e856d9d518568ea4e6dd7764c72eb86d06ff6eb47fa2f aarch64-go-log-fix.patch +f9e8942321b5c7028c96af140fcfd443a411e3e4e2379127275094c7eedf0a26 allow-to-set-version.patch" sha512sums="bde94f503ff7df33b0f891bfa726546d07c35c3731ed300dc9be50ee778229a0a358c22fc8206b0f0f4da5085a63bb196748968ed37b9310be9b1cab1c743ce4 gitea-1.0.1.tar.gz 5cd3144d040139ff27fb5acef9b09406f7acbdda2779638ba20fcf8a7739697351502a26a30020a42c84b9146fdc96b9943b85099819a86facf0d53a4f000078 gitea.initd ea4a771652871a6aefd5f236c6cd96bf0b17abb46a016e60fe1ae96b88df972e014be438f52dc9c0f8a35e50f5897d48b8a413a6aeaf54adf8ed1e1005e472c1 gitea.confd 07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini -c5762d3c06a5b9f5a40f15945f57963ebb114a4ccf40ab188fc379dfc8a077f478ef54b88561ee1f316423bd30d8bf8c12527acbddda50b884354374683c843b aarch64-go-log-fix.patch" +c5762d3c06a5b9f5a40f15945f57963ebb114a4ccf40ab188fc379dfc8a077f478ef54b88561ee1f316423bd30d8bf8c12527acbddda50b884354374683c843b aarch64-go-log-fix.patch +a2ad261c38310788b6d5bd2ff936930f13f58477c4ff6a3210d4824b3f3a696403ca66641c4a5ec7977e27b4b7f96e9d3a8415f6833ee8ace62eb7cb8528954e allow-to-set-version.patch" 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/) |