From bf12d56f14d8cf76bda03c6d3dd2a28c36068b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 21 Mar 2019 13:06:00 +0000 Subject: [PATCH] meson: use new 'python' module instead of deprecated 'python3' one https://github.com/mesonbuild/meson/pull/4169 --- debug-viewer/meson.build | 13 +++++++------ meson.build | 7 +++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/debug-viewer/meson.build b/debug-viewer/meson.build index a077bb9715..2ea9fe088d 100644 --- a/debug-viewer/meson.build +++ b/debug-viewer/meson.build @@ -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 diff --git a/meson.build b/meson.build index 600d7a8b74..a8b9817453 100644 --- a/meson.build +++ b/meson.build @@ -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")')