commit:     8ce09c2ea369a9eb9973e02dfec64dfc9cc7d1dd
Author:     Lucian Poston <lucianposton <AT> pm <DOT> me>
AuthorDate: Sun Mar  8 20:08:01 2020 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Mar 12 19:53:08 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ce09c2e

dev-vcs/cli: Add 9999 and misc cleanups

- Added 9999 live ebuild
- Removed unused eclass
- Added missing licenses
- Use default src_test since it is sufficient
- Add "v" prefix to GH_VERSION to be consistent with upstream builds
- Fix --version by setting LDFLAGS env var instead of Makefile var

Closes: https://bugs.gentoo.org/711998
Closes: https://github.com/gentoo/gentoo/pull/14870
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Lucian Poston <lucianposton <AT> pm.me>
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 dev-vcs/cli/cli-0.6.1.ebuild                      | 35 ++++++++++++++++-------
 dev-vcs/cli/{cli-0.6.1.ebuild => cli-9999.ebuild} | 35 ++++++++++++++++-------
 2 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/dev-vcs/cli/cli-0.6.1.ebuild b/dev-vcs/cli/cli-0.6.1.ebuild
index 0f4c7fd08d0..7deea7cf7bf 100644
--- a/dev-vcs/cli/cli-0.6.1.ebuild
+++ b/dev-vcs/cli/cli-0.6.1.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit bash-completion-r1 go-module
+inherit go-module
 
 DESCRIPTION="GitHub CLI"
 HOMEPAGE="https://github.com/cli/cli";
@@ -250,24 +250,37 @@ EGO_SUM=(
        "gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod"
        "honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod"
        )
-go-module_set_globals
-SRC_URI="https://github.com/cli/cli/archive/v${PV}.tar.gz -> ${P}.tar.gz
-               ${EGO_SUM_SRC_URI}"
 
-LICENSE="MIT"
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/cli/cli.git";
+       PROPERTIES="live"
+else
+       go-module_set_globals
+       SRC_URI="https://github.com/cli/cli/archive/v${PV}.tar.gz -> ${P}.tar.gz
+                       ${EGO_SUM_SRC_URI}"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="MIT Apache-2.0 BSD BSD-2 MPL-2.0"
 SLOT="0"
-KEYWORDS="~amd64"
 
 RDEPEND=">=dev-vcs/git-1.7.3"
 BDEPEND=">=dev-lang/go-1.13"
 
-src_compile() {
-       # Golang LDFLAGS are not the same as GCC/Binutils LDFLAGS
-       emake bin/gh GH_VERSION=${PV} LDFLAGS=""
+src_unpack() {
+       if has live "${PROPERTIES}"; then
+               git-r3_src_unpack
+               go-module_live_vendor
+       else
+               go-module_src_unpack
+       fi
 }
 
-src_test() {
-       emake test
+src_compile() {
+       has live "${PROPERTIES}" || export GH_VERSION="v${PV}"
+       # Golang LDFLAGS are not the same as GCC/Binutils LDFLAGS
+       LDFLAGS="" emake bin/gh
 }
 
 src_install() {

diff --git a/dev-vcs/cli/cli-0.6.1.ebuild b/dev-vcs/cli/cli-9999.ebuild
similarity index 96%
copy from dev-vcs/cli/cli-0.6.1.ebuild
copy to dev-vcs/cli/cli-9999.ebuild
index 0f4c7fd08d0..7deea7cf7bf 100644
--- a/dev-vcs/cli/cli-0.6.1.ebuild
+++ b/dev-vcs/cli/cli-9999.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit bash-completion-r1 go-module
+inherit go-module
 
 DESCRIPTION="GitHub CLI"
 HOMEPAGE="https://github.com/cli/cli";
@@ -250,24 +250,37 @@ EGO_SUM=(
        "gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod"
        "honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod"
        )
-go-module_set_globals
-SRC_URI="https://github.com/cli/cli/archive/v${PV}.tar.gz -> ${P}.tar.gz
-               ${EGO_SUM_SRC_URI}"
 
-LICENSE="MIT"
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/cli/cli.git";
+       PROPERTIES="live"
+else
+       go-module_set_globals
+       SRC_URI="https://github.com/cli/cli/archive/v${PV}.tar.gz -> ${P}.tar.gz
+                       ${EGO_SUM_SRC_URI}"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="MIT Apache-2.0 BSD BSD-2 MPL-2.0"
 SLOT="0"
-KEYWORDS="~amd64"
 
 RDEPEND=">=dev-vcs/git-1.7.3"
 BDEPEND=">=dev-lang/go-1.13"
 
-src_compile() {
-       # Golang LDFLAGS are not the same as GCC/Binutils LDFLAGS
-       emake bin/gh GH_VERSION=${PV} LDFLAGS=""
+src_unpack() {
+       if has live "${PROPERTIES}"; then
+               git-r3_src_unpack
+               go-module_live_vendor
+       else
+               go-module_src_unpack
+       fi
 }
 
-src_test() {
-       emake test
+src_compile() {
+       has live "${PROPERTIES}" || export GH_VERSION="v${PV}"
+       # Golang LDFLAGS are not the same as GCC/Binutils LDFLAGS
+       LDFLAGS="" emake bin/gh
 }
 
 src_install() {

Reply via email to