termux-packages/packages/gh/build.sh

32 lines
1.1 KiB
Bash
Raw Normal View History

TERMUX_PKG_HOMEPAGE=https://cli.github.com/
TERMUX_PKG_DESCRIPTION="GitHubs official command line tool"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Krishna kanhaiya @kcubeterm"
2021-04-21 00:27:30 +02:00
TERMUX_PKG_VERSION=1.9.2
2021-04-21 08:03:47 +02:00
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/cli/cli/archive/v${TERMUX_PKG_VERSION}.tar.gz
2021-04-21 00:27:30 +02:00
TERMUX_PKG_SHA256=a1d5a326c9311f8d208a0e5b5ba47023c3982494063e34ea10da916f9b8ba5c3
2020-11-13 21:24:24 +01:00
termux_step_make() {
termux_setup_golang
cd "$TERMUX_PKG_SRCDIR"
(
unset GOOS GOARCH CGO_LDFLAGS
unset CC CXX CFLAGS CXXFLAGS LDFLAGS
go run ./cmd/gen-docs --man-page --doc-path $TERMUX_PREFIX/share/man/man1/
)
export GOPATH=$TERMUX_PKG_BUILDDIR
mkdir -p "$GOPATH"/src/github.com/cli/
mkdir -p "$TERMUX_PREFIX"/share/doc/gh
cp -a "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/github.com/cli/cli
cd "$GOPATH"/src/github.com/cli/cli/cmd/gh
go get -d -v
2021-04-21 08:03:47 +02:00
go build -ldflags="-X github.com/cli/cli/internal/build.Version=$TERMUX_PKG_VERSION"
}
termux_step_make_install() {
install -Dm700 -t "$TERMUX_PREFIX"/bin "$GOPATH"/src/github.com/cli/cli/cmd/gh/gh
install -Dm600 -t "$TERMUX_PREFIX"/share/doc/gh/ "$TERMUX_PKG_SRCDIR"/docs/*
}