During src_compile, LDFLAGS must be set such that Makefile's LDFLAGS var contains the correct flags with GH_VERSION. $ emerge -pv cli These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ~] dev-vcs/cli-0.6.1::gentoo 0 KiB $ gh --version gh version DEV Expected output is something something 0.6.1, not DEV.
https://github.com/gentoo/gentoo/pull/14870 has a fix
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ce09c2ea369a9eb9973e02dfec64dfc9cc7d1dd commit 8ce09c2ea369a9eb9973e02dfec64dfc9cc7d1dd Author: Lucian Poston <lucianposton@pm.me> AuthorDate: 2020-03-08 20:08:01 +0000 Commit: Robin H. Johnson <robbat2@gentoo.org> CommitDate: 2020-03-12 19:53:08 +0000 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@pm.me> Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> dev-vcs/cli/cli-0.6.1.ebuild | 35 ++++-- dev-vcs/cli/cli-9999.ebuild | 289 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 313 insertions(+), 11 deletions(-)