commit:     817f07236de8779110a64c4c626a49caec8d5f52
Author:     David Michael <fedora.dm0 <AT> gmail <DOT> com>
AuthorDate: Sat Dec 26 02:04:16 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Jan 18 21:09:52 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=817f0723

vala.eclass: make has_version aware of ROOT for EAPI 7

The vala dependencies are declared in BDEPEND since EAPI 7 so that
the valac command is natively executable.  With no arguments, the
has_version function would look for a cross-compiled vala package
in the target ROOT and always fail.

Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/18813
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 eclass/vala.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index 52899f163dc..88c5231286a 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -102,7 +102,7 @@ vala_best_api_version() {
        u=$(_vala_use_depend)
 
        for v in $(vala_api_versions); do
-               has_version "dev-lang/vala:${v}${u}" && echo "${v}" && return
+               has_version $([[ $EAPI == [1-6] ]] || echo -b) 
"dev-lang/vala:${v}${u}" && echo "${v}" && return
        done
 }
 
@@ -136,7 +136,7 @@ vala_src_prepare() {
        fi
 
        if [[ ${version} ]]; then
-               has_version "dev-lang/vala:${version}" || die "No installed 
vala:${version}"
+               has_version $([[ $EAPI == [1-6] ]] || echo -b) 
"dev-lang/vala:${version}" || die "No installed vala:${version}"
        else
                version=$(vala_best_api_version)
                [[ ${version} ]] || die "No installed vala in $(vala_depend)"

Reply via email to