[glib: 1/2] meson: use the new 'python' module instead of the 'python3' one. Closes #1455



commit 631c3534b784b44578860c1971c4ebd297c40f33
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Wed Jul 18 17:03:22 2018 +0200

    meson: use the new 'python' module instead of the 'python3' one. Closes #1455
    
    The new python module, added with 0.46, works with Python 2 and 3 and
    allows to pass a path for the interpreter to use, if the need arises.
    
    Previously the meson build set PYTHON, used in the shebang line of
    the scripts installed by glib, to the full path of the interpreter.
    The new meson module doesn't expose that atm, but we should set it to
    a executable name anyway, and not a full path.

 gio/gdbus-2.0/codegen/meson.build | 2 +-
 gobject/meson.build               | 2 +-
 gobject/tests/meson.build         | 7 ++-----
 meson.build                       | 4 +++-
 4 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build
index af1bc9fb2..f5e82a2ff 100644
--- a/gio/gdbus-2.0/codegen/meson.build
+++ b/gio/gdbus-2.0/codegen/meson.build
@@ -10,7 +10,7 @@ gdbus_codegen_files = [
 
 gdbus_codegen_conf = configuration_data()
 gdbus_codegen_conf.set('VERSION', glib_version)
-gdbus_codegen_conf.set('PYTHON', python.path())
+gdbus_codegen_conf.set('PYTHON', python_name)
 gdbus_codegen_conf.set('DATADIR', glib_datadir)
 
 # Install gdbus-codegen executable
diff --git a/gobject/meson.build b/gobject/meson.build
index d34a897a7..ffa8b75d0 100644
--- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -92,7 +92,7 @@ python_tools = [
 
 python_tools_conf = configuration_data()
 python_tools_conf.set('VERSION', glib_version)
-python_tools_conf.set('PYTHON', python.path())
+python_tools_conf.set('PYTHON', python_name)
 
 foreach tool: python_tools
   tool_bin = configure_file(
diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build
index 53b76d3eb..88515006c 100644
--- a/gobject/tests/meson.build
+++ b/gobject/tests/meson.build
@@ -1,6 +1,3 @@
-py3_mod = import('python3')
-py3 = py3_mod.find_python()
-
 gobject_tests = [
   'qdata',
   'boxed',
@@ -82,8 +79,8 @@ test('signals', exe, env : test_env, suite : ['gobject'])
 
 test(
   'mkenums.py',
-  py3,
+  python,
   args: files('mkenums.py'),
   env: test_env,
   suite: ['gobject'],
-)
\ No newline at end of file
+)
diff --git a/meson.build b/meson.build
index 15f895e7f..5f7c7707c 100644
--- a/meson.build
+++ b/meson.build
@@ -1800,7 +1800,9 @@ elif meson.get_cross_property('have_strlcpy', false)
   glib_conf.set('HAVE_STRLCPY', 1)
 endif
 
-python = import('python3').find_python()
+python = import('python').find_installation('python3')
+# used for '#!/usr/bin/env <name>'
+python_name = 'python3'
 
 # Determine which user environment-dependent files that we want to install
 have_bash = find_program('bash', required : false).found() # For completion scripts


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]