40 lines
1.0 KiB
Bash
40 lines
1.0 KiB
Bash
# Template file for 'github-cli'
|
|
pkgname=github-cli
|
|
version=1.9.2
|
|
revision=1
|
|
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/internal/build.Version=v${version}"
|
|
short_desc="GitHub CLI tool"
|
|
maintainer="shizonic <realtiaz@gmail.com>"
|
|
license="MIT"
|
|
homepage="https://cli.github.com"
|
|
changelog="https://github.com/cli/cli/releases"
|
|
distfiles="https://github.com/cli/cli/archive/v${version}.tar.gz"
|
|
checksum=a1d5a326c9311f8d208a0e5b5ba47023c3982494063e34ea10da916f9b8ba5c3
|
|
|
|
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/internal/build.Date=${_date}"
|
|
fi
|
|
}
|
|
|
|
post_build() {
|
|
gh=$(find $GOPATH/bin -name gh)
|
|
for shell in bash fish zsh; do
|
|
vtargetrun $gh completion -s $shell > github-cli.$shell
|
|
done
|
|
}
|
|
|
|
post_install() {
|
|
vlicense LICENSE
|
|
|
|
for shell in bash fish zsh; do
|
|
vcompletion github-cli.$shell $shell gh
|
|
done
|
|
}
|