From da301c2633389ee4d5b20ab46b651e7fb2f66a60 Mon Sep 17 00:00:00 2001 From: Renato Aguiar Date: Fri, 14 Feb 2020 06:37:37 -0800 Subject: [PATCH] github-cli: fix version output --- srcpkgs/github-cli/template | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/srcpkgs/github-cli/template b/srcpkgs/github-cli/template index 78f34c7b20d..d590cb099d8 100644 --- a/srcpkgs/github-cli/template +++ b/srcpkgs/github-cli/template @@ -1,11 +1,11 @@ # Template file for 'github-cli' pkgname=github-cli version=0.5.5 -revision=1 +revision=2 wrksrc="cli-${version}" -# create_wrksrc=yes build_style=go go_import_path="github.com/cli/cli/cmd/gh" +go_ldflags="-X github.com/cli/cli/command.Version=v${version}" short_desc="GitHub CLI tool" maintainer="shizonic " license="MIT" @@ -14,6 +14,14 @@ changelog="https://github.com/cli/cli/releases" distfiles="https://github.com/cli/cli/archive/v${version}.tar.gz" checksum=7c2cfdafe765a598b70b3e6de839590e8fa30a89bedc85799a43bdbc6fd3277e +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}" + fi +} + post_install() { vlicense LICENSE }