Mesa (master): meson: Improve detection of Python when using Meson >=0.50.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 28 19:52:01 UTC 2019


Module: Mesa
Branch: master
Commit: b120a02b21791ef9898dd342af8102ec9f4d36d9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b120a02b21791ef9898dd342af8102ec9f4d36d9

Author: Arfrever Frehtes Taifersar Arahesis <Arfrever at Apache.Org>
Date:   Mon Jun 17 18:37:44 2019 +0000

meson: Improve detection of Python when using Meson >=0.50.

Previously, on systems where multiple versions of Python 3 (e.g. 3.6 and 3.7)
are installed, wrong version of Python 3 could have been used.

The proper fix requires availability of path() method in Meson's python
module, which has been added in Meson 0.50:
https://github.com/mesonbuild/meson/pull/4616

Distro Bug: https://bugs.gentoo.org/671308
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever at Apache.Org>
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

v2: - Add missing `endif` keyword (Dylan)

---

 meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 2da66b74924..4e1990eb600 100644
--- a/meson.build
+++ b/meson.build
@@ -746,7 +746,11 @@ if with_platform_haiku
   pre_args += '-DHAVE_HAIKU_PLATFORM'
 endif
 
-prog_python = import('python3').find_python()
+if meson.version().version_compare('>=0.50')
+  prog_python = import('python').find_installation('python3')
+else
+  prog_python = import('python3').find_python()
+endif
 has_mako = run_command(
   prog_python, '-c',
   '''




More information about the mesa-commit mailing list