github-cli: fix setting build version and date

This commit is contained in:
Anshul Sirur 2021-01-18 14:24:52 +01:00 committed by Érico Nogueira Rolim
parent cee91f6180
commit 4d6216abc2

View file

@ -1,12 +1,12 @@
# Template file for 'github-cli'
pkgname=github-cli
version=1.4.0
revision=1
revision=2
wrksrc="cli-${version}"
build_style=go
build_helper=qemu
go_import_path="github.com/cli/cli/cmd/gh"
go_ldflags="-X github.com/cli/cli/command.Version=v${version}"
go_ldflags="-X github.com/cli/cli/internal/build.Version=v${version}"
short_desc="GitHub CLI tool"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@ -19,7 +19,7 @@ pre_build() {
local _date
if [ "$SOURCE_DATE_EPOCH" ]; then
_date="$(date --utc --date "@$SOURCE_DATE_EPOCH" "+%Y-%m-%d")"
go_ldflags="$go_ldflags -X github.com/cli/cli/command.BuildDate=${_date}"
go_ldflags="$go_ldflags -X github.com/cli/cli/internal/build.Date=${_date}"
fi
}