commit:     ffcf0ed0166a91e2e6f1bd5ea8ab7e39117ae38c
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  7 17:53:16 2020 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sun Jun  7 17:59:47 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffcf0ed0

dev-util/github-cli: drop patch and use "go run" for completions

The makefile uses "go run" to generate the man pages, so we really don't
need to  build a gen-docs binary.

Also, switch to using "go run" to generate the shell completions.

Once we allow cross compiling, we can use the first emake to compile gh
for the target and run everything else on the host.

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 dev-util/github-cli/github-cli-0.9.0-r1.ebuild | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

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 9da2da770a1..a85b465b8d8 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
@@ -273,13 +273,6 @@ LICENSE="MIT Apache-2.0 BSD BSD-2 MPL-2.0"
 SLOT="0"
 
 RDEPEND=">=dev-vcs/git-1.7.3"
-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
@@ -292,17 +285,19 @@ src_unpack() {
 
 src_compile() {
        [[ ${PV} == *9999 ]] || export GH_VERSION="v${PV}"
-       # Golang LDFLAGS are not the same as GCC/Binutils LDFLAGS
+       # Go LDFLAGS are not the same as GCC/Binutils LDFLAGS
        unset LDFLAGS
+       # Once we set up cross compiling, this line will need to be adjusted
+       # to compile for the target.
+       # Everything else in this function happens on the host.
+       emake
 
-       emake bin/gh # default target
-
-       einfo "Building manpage"
+       einfo "Building man pages"
        emake manpages
 
-       einfo "Building completion"
-       bin/gh completion -s bash > gh.bash-completion || die
-       bin/gh completion -s zsh > gh.zsh-completion || die
+       einfo "Building completions"
+       go run ./cmd/gh completion -s bash > gh.bash-completion || die
+       go run ./cmd/gh completion -s zsh > gh.zsh-completion || die
 }
 
 src_install() {

Reply via email to