diff options
author | Christian Muehlhaeuser | 2021-04-02 01:55:12 +0200 |
---|---|---|
committer | Christian Muehlhaeuser | 2021-04-02 01:55:12 +0200 |
commit | 252d8b3b18457da13a56f64a698344a19a237bbd (patch) | |
tree | 00e3a2df06e8caa9e79b3c16c5ebdd6caa8e81b3 | |
parent | a451c341b072657d8c9be3a6528cf11b273fe3f1 (diff) | |
download | aur-252d8b3b18457da13a56f64a698344a19a237bbd.tar.gz |
Fix linking and revision parsing
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 22 |
2 files changed, 10 insertions, 14 deletions
@@ -1,6 +1,6 @@ pkgbase = duf-git pkgdesc = Disk Usage/Free Utility - pkgver = r107.4c15e83 + pkgver = r128.bb93070 pkgrel = 1 url = https://github.com/muesli/duf arch = x86_64 @@ -1,25 +1,18 @@ # Maintainer: Christian Muehlhaeuser <muesli at gmail dot com> pkgname=duf-git -pkgver=r107.4c15e83 +pkgver=r128.bb93070 pkgrel=1 pkgdesc="Disk Usage/Free Utility" arch=('x86_64' 'i686' 'armv6h' 'armv7h' 'aarch64') -url="https://github.com/muesli/duf" +url="https://github.com/muesli/${pkgname%-git}" license=('MIT') makedepends=('go' 'git') provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") -source=($pkgname::git://github.com/muesli/duf.git) +source=($pkgname::"git://github.com/muesli/${pkgname%-git}.git") sha256sums=('SKIP') -prepare() { - export GOPATH="$srcdir/gopath" - export GO111MODULE=on - - go clean -modcache -} - pkgver() { cd "$srcdir/$pkgname" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" @@ -28,6 +21,11 @@ pkgver() { build() { cd "$srcdir/$pkgname" + local commit + local extraflags + commit=$(git rev-parse --short HEAD) + extraflags="-X main.Version=${pkgver} -X main.CommitSHA=${commit}" + export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" @@ -38,10 +36,8 @@ build() { -buildmode=pie \ -mod=readonly \ -modcacherw \ - -ldflags "-X main.Version=$pkgver -linkmode external -extldflags \"${LDFLAGS}\"" \ + -ldflags "${extraflags} -extldflags \"${LDFLAGS}\"" \ -o "${pkgname%-git}" . - - go clean -modcache } package() { |