summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Zhang2020-09-04 15:43:32 +0800
committerJeffrey Zhang2020-09-04 15:43:32 +0800
commitf3bee5796168915cd9a2435834b3c03e72ca1ccb (patch)
tree3f597000d8995e1bdf95786bb8d9ecf54c3dd2a1
parent9bcad73dd8d88bf242762580700e809fbf62cb55 (diff)
downloadaur-f3bee5796168915cd9a2435834b3c03e72ca1ccb.tar.gz
config version variable during building
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD8
2 files changed, 7 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e3d9430f0b2e..c8657ff9e09f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = assh-git
pkgdesc = make your ssh client smarter https://manfred.life/assh
pkgver = 2.10.0.r0.g1ff23bee
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/moul/assh.git
arch = any
license = MIT
diff --git a/PKGBUILD b/PKGBUILD
index 5eace2eef6a3..62013f0aadef 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=assh-git
_pkgname=assh
pkgver=2.10.0.r0.g1ff23bee
-pkgrel=1
+pkgrel=2
pkgdesc='make your ssh client smarter https://manfred.life/assh'
arch=('any')
url='https://github.com/moul/assh.git'
@@ -21,9 +21,13 @@ pkgver() {
build() {
cd "${srcdir}/${_pkgname}"
+ version=$(git describe --tags --always)
+ vcs_ref=$(git rev-parse --short HEAD)
GOPATH=${srcdir} \
GO111MODULE=on \
- go build -modcacherw -o assh
+ go build \
+ --ldflags "-X moul.io/assh/v2/pkg/version.Version=$version -X moul.io/assh/v2/pkg/version.VcsRef=$vcs_ref" \
+ -modcacherw -o assh
}
package() {