diff options
author | Jeffrey Zhang | 2020-09-04 15:43:32 +0800 |
---|---|---|
committer | Jeffrey Zhang | 2020-09-04 15:43:32 +0800 |
commit | f3bee5796168915cd9a2435834b3c03e72ca1ccb (patch) | |
tree | 3f597000d8995e1bdf95786bb8d9ecf54c3dd2a1 | |
parent | 9bcad73dd8d88bf242762580700e809fbf62cb55 (diff) | |
download | aur-f3bee5796168915cd9a2435834b3c03e72ca1ccb.tar.gz |
config version variable during building
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 8 |
2 files changed, 7 insertions, 3 deletions
@@ -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 @@ -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() { |