[pangomm] meson.build: Specify 'check' option in run_command()



commit a192e7fcc009298f67d32a777dbb827efdd07853
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Tue Feb 15 13:23:19 2022 +0100

    meson.build: Specify 'check' option in run_command()
    
    The default value will be changed in future Meson releases.
    
    Don't use deprecated python3.path().
    Let import('python').find_installation() always find the python
    installation used to run Meson.

 docs/reference/meson.build |  4 ++--
 meson.build                | 18 ++++++++++--------
 pango/pangomm/meson.build  |  5 +++--
 3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index cc16bd0..d331a0d 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -142,7 +142,7 @@ devhelp_file = custom_target('devhelp',
 
 # Install Devhelp file and html files.
 meson.add_install_script(
-  python3.path(), doc_reference_py, 'install_doc',
+  python3, doc_reference_py, 'install_doc',
   doctool_dir,
   devhelp_file.full_path(),
   install_devhelpdir,
@@ -165,7 +165,7 @@ install_data(image_files, install_dir: install_image_docdir)
 if can_add_dist_script
   # Distribute built files and files copied by mm-common-get.
   meson.add_dist_script(
-    python3.path(), doc_reference_py, 'dist_doc',
+    python3, doc_reference_py, 'dist_doc',
     doctool_dir,
     doctool_dist_dir,
     meson.current_build_dir(),
diff --git a/meson.build b/meson.build
index 13e31e3..ee0b468 100644
--- a/meson.build
+++ b/meson.build
@@ -6,8 +6,8 @@ project('pangomm', 'cpp',
   default_options: [
     'cpp_std=c++17'
   ],
-  meson_version: '>= 0.54.0', # required for meson.override_dependency()
-                              # and dep.get_variable(internal:)
+  meson_version: '>= 0.55.0', # required for meson.add_dist_script(python3, ...)
+                              # and meson.add_install_script(python3, ...)
 )
 
 pangomm_api_version = '2.48'
@@ -44,7 +44,7 @@ project_build_root = meson.current_build_dir()
 
 cpp_compiler = meson.get_compiler('cpp')
 is_msvc = cpp_compiler.get_id() == 'msvc'
-python3 = import('python').find_installation('python3')
+python3 = import('python').find_installation()
 
 python_version = python3.language_version()
 python_version_req = '>= 3.5'
@@ -59,7 +59,7 @@ import os
 import sys
 sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@"))
 '''.format(project_source_root / '.git')
-is_git_build = run_command(python3, '-c', cmd_py).returncode() != 0
+is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() != 0
 
 # Are we testing a dist tarball while it's being built?
 # There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866
@@ -147,14 +147,16 @@ dist_build_scripts_py = script_dir / 'dist-build-scripts.py'
 if maintainer_mode
   # Copy files to untracked/build_scripts and untracked/docs.
   run_command(mm_common_get, '--force', script_dir,
-    project_source_root / 'untracked' / 'docs')
+    project_source_root / 'untracked' / 'docs',
+    check: true,
+  )
 else
   cmd_py = '''
 import os
 import sys
 sys.exit(os.path.isfile("@0@"))
 '''.format(generate_binding_py)
-  file_exists = run_command(python3, '-c', cmd_py).returncode() != 0
+  file_exists = run_command(python3, '-c', cmd_py, check: false).returncode() != 0
   if not file_exists
     error('Missing files in untracked/. You must enable maintainer-mode.')
   endif
@@ -236,13 +238,13 @@ subdir('docs/reference')
 if can_add_dist_script
   # Add a ChangeLog file to the distribution directory.
   meson.add_dist_script(
-    python3.path(), dist_changelog_py,
+    python3, dist_changelog_py,
     project_source_root,
   )
   # Add build scripts to the distribution directory, and delete .gitignore
   # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
   meson.add_dist_script(
-    python3.path(), dist_build_scripts_py,
+    python3, dist_build_scripts_py,
     project_source_root,
     'untracked' / 'build_scripts',
   )
diff --git a/pango/pangomm/meson.build b/pango/pangomm/meson.build
index 76deea7..5e0d2bc 100644
--- a/pango/pangomm/meson.build
+++ b/pango/pangomm/meson.build
@@ -193,6 +193,7 @@ else # not maintainer_mode
     meson.current_build_dir(),
     src_untracked_pangomm,
     hg_ccg_basenames,
+    check: true,
   )
 
   built_cc_files = [ rel_untracked_pangomm / 'wrap_init.cc' ]
@@ -219,7 +220,7 @@ endif
 
 # Install built .h and _p.h files.
 meson.add_install_script(
-  python3.path(), generate_binding_py, 'install_built_h_files',
+  python3, generate_binding_py, 'install_built_h_files',
   built_h_cc_dir,
   install_includedir / pangomm_pcname / 'pangomm', # subdir below {prefix}
   hg_ccg_basenames
@@ -228,7 +229,7 @@ meson.add_install_script(
 if can_add_dist_script
   # Distribute built files.
   meson.add_dist_script(
-    python3.path(), generate_binding_py, 'dist_built_files',
+    python3, generate_binding_py, 'dist_built_files',
     built_h_cc_dir,
     untracked_pangomm,
     hg_ccg_basenames,


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