commit:     1f645e13c3bdd0ef8b850dfd084bc0e914ce65c6
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun May 31 04:16:15 2020 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun May 31 04:16:39 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f645e13

dev-util/github-cli: fix PR#16024 issues

Closes: https://github.com/gentoo/gentoo/pull/16024
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 .../files/cli-0.9.0-manpage-build-gen-docs.patch   | 15 +++++++++++++++
 dev-util/github-cli/github-cli-0.9.0-r1.ebuild     | 22 +++++++++++++++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)

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 00000000000..ff79812f2f5
--- /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 766be325438..9da2da770a1 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
 }

Reply via email to