[Mesa-dev] [PATCH v2 2/5] meson: use python3 module to find python3

2018-08-15 Thread Dylan Baker
This handy helper is nice for OSes that are not linux or BSD like (mac
and windows) as it knows how to find python3 in odd places.
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 5dc9b45eb42..c8bac35659f 100644
--- a/meson.build
+++ b/meson.build
@@ -697,7 +697,7 @@ if with_platform_haiku
   pre_args += '-DHAVE_HAIKU_PLATFORM'
 endif
 
-prog_python = find_program('python3')
+prog_python = import('python3').find_python()
 has_mako = run_command(prog_python, '-c', 'import mako; assert 
mako.__version__ >= "0.8.0"')
 if has_mako.returncode() != 0
   error('Python (3.x) mako module >= 0.8.0 required to build mesa.')
-- 
2.18.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 2/5] meson: use python3 module to find python3

2018-08-16 Thread Eric Engestrom
On Wednesday, 2018-08-15 09:18:05 -0700, Dylan Baker wrote:
> This handy helper is nice for OSes that are not linux or BSD like (mac
> and windows) as it knows how to find python3 in odd places.
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 5dc9b45eb42..c8bac35659f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -697,7 +697,7 @@ if with_platform_haiku
>pre_args += '-DHAVE_HAIKU_PLATFORM'
>  endif
>  
> -prog_python = find_program('python3')
> +prog_python = import('python3').find_python()

You'll need to bump meson_version to 0.46 if you want to do that;
otherwise you can use the patch I sent last month ;)

>  has_mako = run_command(prog_python, '-c', 'import mako; assert 
> mako.__version__ >= "0.8.0"')
>  if has_mako.returncode() != 0
>error('Python (3.x) mako module >= 0.8.0 required to build mesa.')
> -- 
> 2.18.0
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 2/5] meson: use python3 module to find python3

2018-08-16 Thread Mathieu Bridon
On Thu, 2018-08-16 at 11:00 +0100, Eric Engestrom wrote:
> On Wednesday, 2018-08-15 09:18:05 -0700, Dylan Baker wrote:
> > This handy helper is nice for OSes that are not linux or BSD like
> > (mac
> > and windows) as it knows how to find python3 in odd places.
> > ---
> >  meson.build | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 5dc9b45eb42..c8bac35659f 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -697,7 +697,7 @@ if with_platform_haiku
> >pre_args += '-DHAVE_HAIKU_PLATFORM'
> >  endif
> >  
> > -prog_python = find_program('python3')
> > +prog_python = import('python3').find_python()
> 
> You'll need to bump meson_version to 0.46 if you want to do that;
> otherwise you can use the patch I sent last month ;)

Unless I missed something, the "python3" module and its find_python()
method were added in 0.38.0:

http://mesonbuild.com/Python-3-module.html

Are you confusing this with the "python" module, which was added in
0.46.0?

http://mesonbuild.com/Python-module.html


-- 
Mathieu

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 2/5] meson: use python3 module to find python3

2018-08-16 Thread Eric Engestrom
On Thursday, 2018-08-16 12:25:07 +0200, Mathieu Bridon wrote:
> On Thu, 2018-08-16 at 11:00 +0100, Eric Engestrom wrote:
> > On Wednesday, 2018-08-15 09:18:05 -0700, Dylan Baker wrote:
> > > This handy helper is nice for OSes that are not linux or BSD like
> > > (mac
> > > and windows) as it knows how to find python3 in odd places.
> > > ---
> > >  meson.build | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/meson.build b/meson.build
> > > index 5dc9b45eb42..c8bac35659f 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -697,7 +697,7 @@ if with_platform_haiku
> > >pre_args += '-DHAVE_HAIKU_PLATFORM'
> > >  endif
> > >  
> > > -prog_python = find_program('python3')
> > > +prog_python = import('python3').find_python()
> > 
> > You'll need to bump meson_version to 0.46 if you want to do that;
> > otherwise you can use the patch I sent last month ;)
> 
> Unless I missed something, the "python3" module and its find_python()
> method were added in 0.38.0:
> 
> http://mesonbuild.com/Python-3-module.html
> 
> Are you confusing this with the "python" module, which was added in
> 0.46.0?
> 
> http://mesonbuild.com/Python-module.html

Ahem... there's a non-zero chance you might be right :]

Sorry for the noise, this patch is indeed correct, and also removes the
need for the windows fix I had sent :)

Reviewed-by: Eric Engestrom 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev