meson: use new 'python' module instead of deprecated 'python3' one
authorTim-Philipp Müller <tim@centricular.com>
Thu, 21 Mar 2019 13:06:00 +0000 (13:06 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 21 Mar 2019 13:06:00 +0000 (13:06 +0000)
https://github.com/mesonbuild/meson/pull/4169

debug-viewer/meson.build
meson.build

index a077bb971505b6acbdfba41bec5450813c4f06c4..2ea9fe088d022f4fe268f208cc8c94f2b71a684e 100644 (file)
@@ -1,6 +1,7 @@
-install_subdir('GstDebugViewer', install_dir: python3.sysconfig_path('purelib'),
+py_purelib_path = python3.get_path('purelib')
+install_subdir('GstDebugViewer', install_dir: py_purelib_path,
     exclude_files: ['__init__.py'])
-message('Installing in ' + python3.sysconfig_path('purelib'))
+message('Installing in ' + py_purelib_path)
 
 if find_program('msgfmt', required : get_option('nls')).found()
   # Desktop launcher and description file.
@@ -43,7 +44,7 @@ configure_file(input: 'gst-debug-viewer',
 configure_file(input: 'GstDebugViewer/__init__.py',
                output: '__init__.py',
                configuration: cdata,
-               install_dir: join_paths(python3.sysconfig_path('purelib'), 'GstDebugViewer'))
+               install_dir: join_paths(py_purelib_path, 'GstDebugViewer'))
 
 pkgdatadir = join_paths(get_option('datadir'), meson.project_name())
 icondir = join_paths(get_option('datadir'), 'icons/hicolor')
@@ -51,8 +52,8 @@ icondir = join_paths(get_option('datadir'), 'icons/hicolor')
 subdir('data')
 
 
-if run_command(python3.find_python(),
+if run_command(python3,
     '-c', 'import gi; gi.require_version("Gtk", "3.0")').returncode() == 0
-  test('gst-debug-viewer', python3.find_python(), args: ['-m', 'unittest'],
+  test('gst-debug-viewer', python3, args: ['-m', 'unittest'],
       workdir: meson.current_source_dir())
-endif
\ No newline at end of file
+endif
index 600d7a8b74017990c2004c4d91b3415b408b9c62..a8b98174532d01df3b1c30d76b2dc9756fc4f75f 100644 (file)
@@ -140,7 +140,10 @@ if get_option('default_library') == 'shared'
 endif
 
 i18n = import('i18n')
-python3 = import('python3')
+
+python_mod = import('python')
+python3 = python_mod.find_installation()
+
 if get_option('validate')
   subdir('validate')
 endif
@@ -149,4 +152,4 @@ if get_option('debug_viewer')
   subdir('debug-viewer')
 endif
 
-run_command(python3.find_python(), '-c', 'import shutil; shutil.copy("hooks/multi-pre-commit.hook", ".git/hooks/pre-commit")')
+run_command(python3, '-c', 'import shutil; shutil.copy("hooks/multi-pre-commit.hook", ".git/hooks/pre-commit")')