summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Childs2019-01-15 17:53:14 +0000
committerBryan Childs2019-01-15 17:53:14 +0000
commita1b120af29fb975c0d46a414c3118248a3d7759d (patch)
tree72b90da2f0cca90f92426550217ed6c0246ea41a
parenteb3273a045b72e8bb6b9ca390f1032f20bb234d7 (diff)
downloadaur-a1b120af29fb975c0d46a414c3118248a3d7759d.tar.gz
Updated the build to supply extra LDFLAGS
These flags allow the built binary to accurately report the version, commit id and build date.
-rw-r--r--PKGBUILD5
1 files changed, 4 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index abb998a255e2..d3f0a5a34b77 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,11 +18,14 @@ sha256sums=('daa58d7f310200ea8118bd947855fc0263f6e2ba75cdb80f396397b7a9a5fab4')
build() {
cd "$srcdir/$pkgname-$pkgver"
+ extraldflags=" -X github.com/twpayne/chezmoi/cmd.version=1.0.0 \
+ -X github.com/twpayne/chezmoi/cmd.commit=ff3f055 \
+ -X github.com/twpayne/chezmoi/cmd.date=20190113"
go build \
-gcflags "all=-trimpath=$PWD" \
-asmflags "all=-trimpath=$PWD" \
- -ldflags "-extldflags $LDFLAGS" \
+ -ldflags "$extraldflags -extldflags $LDFLAGS" \
-o $pkgname .
}