Commit df51d2e2 authored by Carlo Landmeter's avatar Carlo Landmeter
Browse files

testing/gitea: set proper go ldflags

parent f6dd2fe5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Maintainer: 7heo <7heo@mail.com> # Maintainer: 7heo <7heo@mail.com>
pkgname=gitea pkgname=gitea
pkgver=1.0.1 pkgver=1.0.1
pkgrel=4 pkgrel=5
pkgdesc="A self-hosted Git service written in Go" pkgdesc="A self-hosted Git service written in Go"
url="http://gitea.io/" url="http://gitea.io/"
arch="all" arch="all"
...@@ -16,7 +16,9 @@ source="${pkgname}-${pkgver}.tar.gz::https://github.com/go-gitea/$pkgname/archiv ...@@ -16,7 +16,9 @@ source="${pkgname}-${pkgver}.tar.gz::https://github.com/go-gitea/$pkgname/archiv
$pkgname.initd $pkgname.initd
$pkgname.confd $pkgname.confd
$pkgname.ini $pkgname.ini
aarch64-go-log-fix.patch" aarch64-go-log-fix.patch
allow-to-set-version.patch
"
builddir="$srcdir/src/code.gitea.io/$pkgname" builddir="$srcdir/src/code.gitea.io/$pkgname"
prepare() { prepare() {
...@@ -31,7 +33,9 @@ prepare() { ...@@ -31,7 +33,9 @@ prepare() {
build() { build() {
cd "$builddir" cd "$builddir"
export GOPATH="$srcdir" export GOPATH="$srcdir"
go build -v -tags "tidb sqlite" -o bin/$pkgname || return 1 export TAGS="tidb sqlite"
export VERSION="$pkgver"
make build
} }
package() { package() {
...@@ -52,7 +56,7 @@ package() { ...@@ -52,7 +56,7 @@ package() {
"$pkgdir"/var/log/$pkgname \ "$pkgdir"/var/log/$pkgname \
"$pkgdir"/etc/$pkgname/conf || return 1 "$pkgdir"/etc/$pkgname/conf || return 1
install -D -m 0755 bin/$pkgname \ install -D -m 0755 $pkgname \
"$pkgdir"/usr/bin/$pkgname || return 1 "$pkgdir"/usr/bin/$pkgname || return 1
# Allow to bind to port 80. # Allow to bind to port 80.
setcap cap_net_bind_service=+ep \ setcap cap_net_bind_service=+ep \
...@@ -76,14 +80,17 @@ md5sums="c031c1d3745e95afbb93309f76f9897c gitea-1.0.1.tar.gz ...@@ -76,14 +80,17 @@ md5sums="c031c1d3745e95afbb93309f76f9897c gitea-1.0.1.tar.gz
41eaec7f58dd872c1df9cf523b7595ae gitea.initd 41eaec7f58dd872c1df9cf523b7595ae gitea.initd
fc039e2eb200d020867a3105c227b267 gitea.confd fc039e2eb200d020867a3105c227b267 gitea.confd
b7a9ab6bf9a1c995c1edef73f6aaf374 gitea.ini 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 sha256sums="79df6391bdf9d7833dd16f312ec8ab998f18671f3a3d889875b4fa81cc010a17 gitea-1.0.1.tar.gz
c5236c76d1db76390ec9c0c4e670916e64f4ea64ee856ad191098a55f644e8f7 gitea.initd c5236c76d1db76390ec9c0c4e670916e64f4ea64ee856ad191098a55f644e8f7 gitea.initd
749340849d1066c04295267a013107d8517cce53a460e81eb448a2b6e5d45539 gitea.confd 749340849d1066c04295267a013107d8517cce53a460e81eb448a2b6e5d45539 gitea.confd
c9248a706c9c0c96b07304b2c03ba662473e5beaa0e1cb501dcaf1bb3ba40cbe gitea.ini 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 sha512sums="bde94f503ff7df33b0f891bfa726546d07c35c3731ed300dc9be50ee778229a0a358c22fc8206b0f0f4da5085a63bb196748968ed37b9310be9b1cab1c743ce4 gitea-1.0.1.tar.gz
5cd3144d040139ff27fb5acef9b09406f7acbdda2779638ba20fcf8a7739697351502a26a30020a42c84b9146fdc96b9943b85099819a86facf0d53a4f000078 gitea.initd 5cd3144d040139ff27fb5acef9b09406f7acbdda2779638ba20fcf8a7739697351502a26a30020a42c84b9146fdc96b9943b85099819a86facf0d53a4f000078 gitea.initd
ea4a771652871a6aefd5f236c6cd96bf0b17abb46a016e60fe1ae96b88df972e014be438f52dc9c0f8a35e50f5897d48b8a413a6aeaf54adf8ed1e1005e472c1 gitea.confd ea4a771652871a6aefd5f236c6cd96bf0b17abb46a016e60fe1ae96b88df972e014be438f52dc9c0f8a35e50f5897d48b8a413a6aeaf54adf8ed1e1005e472c1 gitea.confd
07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini 07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini
c5762d3c06a5b9f5a40f15945f57963ebb114a4ccf40ab188fc379dfc8a077f478ef54b88561ee1f316423bd30d8bf8c12527acbddda50b884354374683c843b aarch64-go-log-fix.patch" c5762d3c06a5b9f5a40f15945f57963ebb114a4ccf40ab188fc379dfc8a077f478ef54b88561ee1f316423bd30d8bf8c12527acbddda50b884354374683c843b aarch64-go-log-fix.patch
a2ad261c38310788b6d5bd2ff936930f13f58477c4ff6a3210d4824b3f3a696403ca66641c4a5ec7977e27b4b7f96e9d3a8415f6833ee8ace62eb7cb8528954e allow-to-set-version.patch"
--- ./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/)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment