From 1f645e13c3bdd0ef8b850dfd084bc0e914ce65c6 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 30 May 2020 21:16:15 -0700 Subject: [PATCH] dev-util/github-cli: fix PR#16024 issues Closes: https://github.com/gentoo/gentoo/pull/16024 Signed-off-by: Robin H. Johnson --- .../cli-0.9.0-manpage-build-gen-docs.patch | 15 +++++++++++++ .../github-cli/github-cli-0.9.0-r1.ebuild | 22 ++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 dev-util/github-cli/files/cli-0.9.0-manpage-build-gen-docs.patch diff --git a/dev-util/github-cli/files/cli-0.9.0-manpage-build-gen-docs.patch b/dev-util/github-cli/files/cli-0.9.0-manpage-build-gen-docs.patch new file mode 100644 index 0000000000000..ff79812f2f509 --- /dev/null +++ b/dev-util/github-cli/files/cli-0.9.0-manpage-build-gen-docs.patch @@ -0,0 +1,15 @@ +--- cli-0.9.0/Makefile.orig 2020-05-30 20:59:44.372628296 -0700 ++++ cli-0.9.0/Makefile 2020-05-30 21:02:17.172650230 -0700 +@@ -46,6 +46,10 @@ + .PHONY: site-publish + + ++bin/gen-docs: ++ @go build -trimpath -ldflags "$(LDFLAGS)" -o "$@" ./cmd/gen-docs ++ + .PHONY: manpages +-manpages: +- go run ./cmd/gen-docs --man-page --doc-path ./share/man/man1/ ++manpages: bin/gen-docs ++ bin/gen-docs --man-page --doc-path ./share/man/man1/ ++ diff --git a/dev-util/github-cli/github-cli-0.9.0-r1.ebuild b/dev-util/github-cli/github-cli-0.9.0-r1.ebuild index 766be325438a2..9da2da770a1ff 100644 --- a/dev-util/github-cli/github-cli-0.9.0-r1.ebuild +++ b/dev-util/github-cli/github-cli-0.9.0-r1.ebuild @@ -277,6 +277,10 @@ BDEPEND=">=dev-lang/go-1.13" unset GOBIN GOPATH GOCODE +PATCHES=( + "${FILESDIR}/cli-0.9.0-manpage-build-gen-docs.patch" +) + src_unpack() { if [[ ${PV} == *9999 ]]; then git-r3_src_unpack @@ -290,16 +294,24 @@ src_compile() { [[ ${PV} == *9999 ]] || export GH_VERSION="v${PV}" # Golang LDFLAGS are not the same as GCC/Binutils LDFLAGS unset LDFLAGS - emake + + emake bin/gh # default target + + einfo "Building manpage" + emake manpages + + einfo "Building completion" + bin/gh completion -s bash > gh.bash-completion || die + bin/gh completion -s zsh > gh.zsh-completion || die } src_install() { dobin bin/gh dodoc README.md - make manpages - doman share/man/man1/gh*.1 + doman share/man/man?/gh*.? - bin/gh completion -s bash > gh - dobashcomp gh + newbashcomp gh.bash-completion gh + insinto /usr/share/zsh/site-functions + newins gh.zsh-completion _gh }