Re: [gentoo-dev] [PATCH] vala.eclass: make has_version aware of ROOT for EAPI 7

2021-01-08 Thread David Michael
On Thu, Jan 7, 2021 at 3:42 AM Mart Raudsepp  wrote:
> Ühel kenal päeval, K, 06.01.2021 kell 19:27, kirjutas Matt Turner:
> > From: David Michael 
> > 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.
>
> I'm not exactly convinced that vapi stuff is arch independent and
> belongs in BDEPEND over DEPEND. Vala ships a lot of .vapi files along
> with valac that get used on compilation. Though the difference might be
> only when different endianness or size_of int

If there are target-specific files that need to be installed via
DEPEND, vala would still need to be installed in BDEPEND so that there
is an executable valac command, right?

In practice, I don't think DEPEND usage matters yet because vala
support seems to require gobject-introspection, which is virtually
impossible to cross-compile.  (I plan to implement something like
Void[0] locally to try it some time.)

This patch is to fix packages like ibus[1] that depend on vala
regardless of my disabling the USE flag, where the current eclass
behavior unconditionally fails.

Thanks.

David

[0] https://maxice8.github.io/8-cross-the-gir
[1] 
https://github.com/gentoo/gentoo/blob/master/app-i18n/ibus/ibus-1.5.23.ebuild#L80



Re: [gentoo-dev] [PATCH] vala.eclass: make has_version aware of ROOT for EAPI 7

2021-01-07 Thread Mart Raudsepp
Ühel kenal päeval, K, 06.01.2021 kell 19:27, kirjutas Matt Turner:
> From: David Michael 
> 
> 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.

I'm not exactly convinced that vapi stuff is arch independent and
belongs in BDEPEND over DEPEND. Vala ships a lot of .vapi files along
with valac that get used on compilation. Though the difference might be
only when different endianness or size_of int


Mart

> Signed-off-by: David Michael 
> Signed-off-by: Matt Turner 
> ---
>  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)"



signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] [PATCH] vala.eclass: make has_version aware of ROOT for EAPI 7

2021-01-06 Thread Ulrich Mueller
> On Thu, 07 Jan 2021, Matt Turner wrote:

> + has_version $([[ $EAPI == [1-6] ]] || echo -b) 
> "dev-lang/vala:${v}${u}" && echo "${v}" && return

> + has_version $([[ $EAPI == [1-6] ]] || echo -b) 
> "dev-lang/vala:${version}" || die "No installed vala:${version}"

Curly brackets please.


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH] vala.eclass: make has_version aware of ROOT for EAPI 7

2021-01-06 Thread Matt Turner
From: David Michael 

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 
Signed-off-by: Matt Turner 
---
 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)"
-- 
2.26.2