[PATCH 0/5] meson: Bump minimal required version

*** BLURB HERE *** Michal Prívozník (5): meson: Replace meson.build_root() with meson.project_build_root() meson: Replace meson.source_root() with meson.project_source_root() meson: Replace external_program.path() with external_program.full_path() Replace dep.get_pkgconfig_variable() with dep.get_variable(pkgconfig:) meson: Bump minimal required meson version build-aux/meson.build | 14 +++--- docs/go/meson.build | 2 +- docs/html/meson.build | 4 +- docs/kbase/internals/meson.build | 2 +- docs/kbase/meson.build | 2 +- docs/manpages/meson.build | 2 +- docs/meson.build | 18 +++---- libvirt.spec.in | 2 +- meson.build | 64 ++++++++++++------------- po/meson.build | 4 +- src/access/meson.build | 4 +- src/esx/meson.build | 8 ++-- src/hyperv/meson.build | 4 +- src/meson.build | 30 ++++++------ src/network/meson.build | 2 +- src/util/meson.build | 4 +- tests/meson.build | 10 ++-- tools/wireshark/src/libvirt/meson.build | 8 ++-- 18 files changed, 92 insertions(+), 92 deletions(-) -- 2.35.1

The build_root() method is deprecated in 0.56.0 and we're recommended to use project_build_root() instead. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- build-aux/meson.build | 2 +- docs/go/meson.build | 2 +- docs/html/meson.build | 4 ++-- docs/kbase/internals/meson.build | 2 +- docs/kbase/meson.build | 2 +- docs/manpages/meson.build | 2 +- docs/meson.build | 6 +++--- meson.build | 8 ++++---- po/meson.build | 2 +- src/esx/meson.build | 4 ++-- src/hyperv/meson.build | 2 +- src/meson.build | 4 ++-- tests/meson.build | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index fcd231a386..6017f07c0a 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -30,7 +30,7 @@ awk_prog = find_program('awk') syntax_check_conf = configuration_data({ 'top_srcdir': meson.source_root(), - 'top_builddir': meson.build_root(), + 'top_builddir': meson.project_build_root(), 'flake8_path': flake8_path, 'runutf8': ' '.join(runutf8), 'PYTHON3': python3_prog.path(), diff --git a/docs/go/meson.build b/docs/go/meson.build index c0e19c4182..29467c61f0 100644 --- a/docs/go/meson.build +++ b/docs/go/meson.build @@ -31,7 +31,7 @@ foreach data : html_xslt_gen command: [ xsltproc_prog, '--stringparam', 'pagesrc', data.get('source', ''), - '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'builddir', meson.project_build_root(), '--stringparam', 'timestamp', docs_timestamp, '--stringparam', 'href_base', data.get('href_base', ''), '--nonet', diff --git a/docs/html/meson.build b/docs/html/meson.build index e194b5942c..b0ca400d08 100644 --- a/docs/html/meson.build +++ b/docs/html/meson.build @@ -39,7 +39,7 @@ index_api_gen = custom_target( ], command: [ xsltproc_prog, '--nonet', '-o', docs_builddir, - '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'builddir', meson.project_build_root(), '--stringparam', 'timestamp', docs_timestamp, '@INPUT@', ], @@ -66,7 +66,7 @@ foreach name : [ 'admin', 'lxc', 'qemu' ] ], command: [ xsltproc_prog, '--nonet', '-o', docs_builddir, - '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'builddir', meson.project_build_root(), '--stringparam', 'timestamp', docs_timestamp, '--stringparam', 'indexfile', 'index-@0@.html'.format(name), '@INPUT@', diff --git a/docs/kbase/internals/meson.build b/docs/kbase/internals/meson.build index a16d5a290b..f1e9122f8f 100644 --- a/docs/kbase/internals/meson.build +++ b/docs/kbase/internals/meson.build @@ -40,7 +40,7 @@ foreach data : html_xslt_gen command: [ xsltproc_prog, '--stringparam', 'pagesrc', data.get('source', ''), - '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'builddir', meson.project_build_root(), '--stringparam', 'timestamp', docs_timestamp, '--stringparam', 'href_base', data.get('href_base', ''), '--nonet', diff --git a/docs/kbase/meson.build b/docs/kbase/meson.build index c7eae3738f..5b608293e2 100644 --- a/docs/kbase/meson.build +++ b/docs/kbase/meson.build @@ -50,7 +50,7 @@ foreach data : html_xslt_gen command: [ xsltproc_prog, '--stringparam', 'pagesrc', data.get('source', ''), - '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'builddir', meson.project_build_root(), '--stringparam', 'timestamp', docs_timestamp, '--stringparam', 'href_base', data.get('href_base', ''), '--nonet', diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build index ba673cf472..0a5a8a32d4 100644 --- a/docs/manpages/meson.build +++ b/docs/manpages/meson.build @@ -147,7 +147,7 @@ foreach data : html_xslt_gen command: [ xsltproc_prog, '--stringparam', 'pagesrc', data.get('source', ''), - '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'builddir', meson.project_build_root(), '--stringparam', 'timestamp', docs_timestamp, '--stringparam', 'href_base', data.get('href_base', ''), '--nonet', diff --git a/docs/meson.build b/docs/meson.build index 39c60f9034..2b292b1a5a 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -264,7 +264,7 @@ hvsupport_html_in = custom_target( python3_prog, hvsupport_prog, meson.source_root(), - meson.build_root(), + meson.project_build_root(), ], capture: true, depend_files: [ @@ -305,7 +305,7 @@ foreach data : html_xslt_gen command: [ xsltproc_prog, '--stringparam', 'pagesrc', data.get('source', ''), - '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'builddir', meson.project_build_root(), '--stringparam', 'timestamp', docs_timestamp, '--stringparam', 'href_base', data.get('href_base', ''), '--nonet', @@ -360,7 +360,7 @@ test( args: [ check_html_references_prog.path(), '--prefix', - meson.build_root() / 'docs' + meson.project_build_root() / 'docs' ], env: runutf8, ) diff --git a/meson.build b/meson.build index 0f4650f467..b7a0e4726f 100644 --- a/meson.build +++ b/meson.build @@ -26,7 +26,7 @@ endif conf = configuration_data() conf.set('_GNU_SOURCE', 1) -conf.set_quoted('abs_top_builddir', meson.build_root()) +conf.set_quoted('abs_top_builddir', meson.project_build_root()) conf.set_quoted('abs_top_srcdir', meson.source_root()) conf.set_quoted('PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE_NAME', meson.project_name()) @@ -2171,7 +2171,7 @@ if git foreach file : dist_files meson.add_dist_script( meson_python_prog.path(), python3_prog.path(), meson_dist_prog.path(), - meson.build_root(), file + meson.project_build_root(), file ) endforeach endif @@ -2183,8 +2183,8 @@ configure_file(output: 'meson-config.h', configuration: conf) # generate run helper run_conf = configuration_data({ - 'abs_builddir': meson.build_root(), - 'abs_top_builddir': meson.build_root(), + 'abs_builddir': meson.project_build_root(), + 'abs_top_builddir': meson.project_build_root(), }) configure_file( diff --git a/po/meson.build b/po/meson.build index f5d05e2b31..0f2a1bb617 100644 --- a/po/meson.build +++ b/po/meson.build @@ -8,7 +8,7 @@ i18n.gettext( '--keyword=N_', '--add-comments=TRANSLATORS:', '--directory=@0@'.format(meson.source_root()), - '--directory=@0@'.format(meson.build_root()), + '--directory=@0@'.format(meson.project_build_root()), '--files-from=@0@'.format(meson.current_source_dir() / 'POTFILES'), '--msgid-bugs-address=https://libvirt.org/bugs.html', '--package-version=@0@'.format(meson.project_version()), diff --git a/src/esx/meson.build b/src/esx/meson.build index 5861e90afa..2d05294ba1 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -27,7 +27,7 @@ esx_gen_headers = custom_target( command: [ meson_python_prog, python3_prog, esx_vi_generator_prog, meson.source_root() / 'src', - meson.build_root() / 'src', + meson.project_build_root() / 'src', 'header', ], ) @@ -48,7 +48,7 @@ esx_gen_sources = custom_target( command: [ meson_python_prog, python3_prog, esx_vi_generator_prog, meson.source_root() / 'src', - meson.build_root() / 'src', + meson.project_build_root() / 'src', 'source', ], ) diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build index 0f0cdb9e54..2589fc5437 100644 --- a/src/hyperv/meson.build +++ b/src/hyperv/meson.build @@ -19,7 +19,7 @@ hyperv_gen_sources = custom_target( command: [ meson_python_prog, python3_prog, hyperv_wmi_generator_prog, meson.source_root() / 'src', - meson.build_root() / 'src', + meson.project_build_root() / 'src', ], ) diff --git a/src/meson.build b/src/meson.build index 88a6f15760..8000796733 100644 --- a/src/meson.build +++ b/src/meson.build @@ -3,7 +3,7 @@ src_inc_dir = include_directories('.') src_dep = declare_dependency( compile_args: [ '-DIN_LIBVIRT', - '-Dabs_top_builddir="@0@"'.format(meson.build_root()), + '-Dabs_top_builddir="@0@"'.format(meson.project_build_root()), '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), ] + coverage_flags + win32_flags, dependencies: [ @@ -1032,7 +1032,7 @@ run_pkg_config_files = [ run_pkg_config_conf = configuration_data({ 'VERSION': meson.project_version(), - 'abs_top_builddir': meson.build_root(), + 'abs_top_builddir': meson.project_build_root(), 'abs_top_srcdir': meson.source_root(), }) diff --git a/tests/meson.build b/tests/meson.build index 2556b71444..3819eb8ba9 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,7 +1,7 @@ tests_dep = declare_dependency( compile_args: [ '-Dabs_builddir="@0@"'.format(meson.current_build_dir()), - '-Dabs_top_builddir="@0@"'.format(meson.build_root()), + '-Dabs_top_builddir="@0@"'.format(meson.project_build_root()), '-Dabs_srcdir="@0@"'.format(meson.current_source_dir()), '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), ] + coverage_flags + cc_flags_relaxed_frame_limit, @@ -36,7 +36,7 @@ tests_dep = declare_dependency( tests_env = [ 'abs_builddir=@0@'.format(meson.current_build_dir()), 'abs_srcdir=@0@'.format(meson.current_source_dir()), - 'abs_top_builddir=@0@'.format(meson.build_root()), + 'abs_top_builddir=@0@'.format(meson.project_build_root()), 'abs_top_srcdir=@0@'.format(meson.source_root()), 'LC_ALL=C', 'LIBVIRT_AUTOSTART=0', -- 2.35.1

The source_root() method is deprecated in 0.56.0 and we're recommended to use project_source_root() instead. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- build-aux/meson.build | 2 +- docs/meson.build | 4 ++-- meson.build | 4 ++-- po/meson.build | 2 +- src/access/meson.build | 2 +- src/esx/meson.build | 4 ++-- src/hyperv/meson.build | 2 +- src/meson.build | 4 ++-- src/util/meson.build | 4 ++-- tests/meson.build | 4 ++-- tools/wireshark/src/libvirt/meson.build | 8 ++++---- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index 6017f07c0a..1c6b7fab53 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -29,7 +29,7 @@ endif awk_prog = find_program('awk') syntax_check_conf = configuration_data({ - 'top_srcdir': meson.source_root(), + 'top_srcdir': meson.project_source_root(), 'top_builddir': meson.project_build_root(), 'flake8_path': flake8_path, 'runutf8': ' '.join(runutf8), diff --git a/docs/meson.build b/docs/meson.build index 2b292b1a5a..d88879fd2f 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -263,7 +263,7 @@ hvsupport_html_in = custom_target( meson_python_prog, python3_prog, hvsupport_prog, - meson.source_root(), + meson.project_source_root(), meson.project_build_root(), ], capture: true, @@ -282,7 +282,7 @@ html_xslt_gen += { 'file': hvsupport_html_in, } -news_html_in = docs_rst2html5_gen.process(meson.source_root() / 'NEWS.rst') +news_html_in = docs_rst2html5_gen.process(meson.project_source_root() / 'NEWS.rst') html_xslt_gen += { 'name': 'news', 'file': news_html_in, diff --git a/meson.build b/meson.build index b7a0e4726f..92f22d3538 100644 --- a/meson.build +++ b/meson.build @@ -27,7 +27,7 @@ conf = configuration_data() conf.set('_GNU_SOURCE', 1) conf.set_quoted('abs_top_builddir', meson.project_build_root()) -conf.set_quoted('abs_top_srcdir', meson.source_root()) +conf.set_quoted('abs_top_srcdir', meson.project_source_root()) conf.set_quoted('PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE_NAME', meson.project_name()) conf.set_quoted('PACKAGE_VERSION', meson.project_version()) @@ -514,7 +514,7 @@ elif host_machine.system() == 'darwin' # macOS libraries don't support symbol versioning version_script_flags = '' else - test_file = '@0@/src/libvirt_qemu.syms'.format(meson.source_root()) + test_file = '@0@/src/libvirt_qemu.syms'.format(meson.project_source_root()) if cc.has_link_argument('-Wl,--version-script=@0@'.format(test_file)) version_script_flags = '-Wl,--version-script=' else diff --git a/po/meson.build b/po/meson.build index 0f2a1bb617..fbfdc2d08d 100644 --- a/po/meson.build +++ b/po/meson.build @@ -7,7 +7,7 @@ i18n.gettext( '--keyword=_', '--keyword=N_', '--add-comments=TRANSLATORS:', - '--directory=@0@'.format(meson.source_root()), + '--directory=@0@'.format(meson.project_source_root()), '--directory=@0@'.format(meson.project_build_root()), '--files-from=@0@'.format(meson.current_source_dir() / 'POTFILES'), '--msgid-bugs-address=https://libvirt.org/bugs.html', diff --git a/src/access/meson.build b/src/access/meson.build index 36aff6fd88..4d563a1a60 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -11,7 +11,7 @@ access_polkit_sources = [ access_perm_h = files('viraccessperm.h') -remote_path = meson.source_root() / 'src' / 'remote' +remote_path = meson.project_source_root() / 'src' / 'remote' access_gen_headers = [] access_gen_sources = [] diff --git a/src/esx/meson.build b/src/esx/meson.build index 2d05294ba1..d1f42fdcc4 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -26,7 +26,7 @@ esx_gen_headers = custom_target( ], command: [ meson_python_prog, python3_prog, esx_vi_generator_prog, - meson.source_root() / 'src', + meson.project_source_root() / 'src', meson.project_build_root() / 'src', 'header', ], @@ -47,7 +47,7 @@ esx_gen_sources = custom_target( ], command: [ meson_python_prog, python3_prog, esx_vi_generator_prog, - meson.source_root() / 'src', + meson.project_source_root() / 'src', meson.project_build_root() / 'src', 'source', ], diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build index 2589fc5437..3509ce12f7 100644 --- a/src/hyperv/meson.build +++ b/src/hyperv/meson.build @@ -18,7 +18,7 @@ hyperv_gen_sources = custom_target( ], command: [ meson_python_prog, python3_prog, hyperv_wmi_generator_prog, - meson.source_root() / 'src', + meson.project_source_root() / 'src', meson.project_build_root() / 'src', ], ) diff --git a/src/meson.build b/src/meson.build index 8000796733..916bf1c863 100644 --- a/src/meson.build +++ b/src/meson.build @@ -4,7 +4,7 @@ src_dep = declare_dependency( compile_args: [ '-DIN_LIBVIRT', '-Dabs_top_builddir="@0@"'.format(meson.project_build_root()), - '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), + '-Dabs_top_srcdir="@0@"'.format(meson.project_source_root()), ] + coverage_flags + win32_flags, dependencies: [ glib_dep, @@ -1033,7 +1033,7 @@ run_pkg_config_files = [ run_pkg_config_conf = configuration_data({ 'VERSION': meson.project_version(), 'abs_top_builddir': meson.project_build_root(), - 'abs_top_srcdir': meson.source_root(), + 'abs_top_srcdir': meson.project_source_root(), }) foreach file : run_pkg_config_files diff --git a/src/util/meson.build b/src/util/meson.build index 07ae94631c..c81500ea04 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -137,8 +137,8 @@ keyname_list = [ 'win32', ] -keymap_gen_prog = find_program('@0@/src/keycodemapdb/tools/keymap-gen'.format(meson.source_root())) -keymap_src_file = '@0@/src/keycodemapdb/data/keymaps.csv'.format(meson.source_root()) +keymap_gen_prog = find_program('@0@/src/keycodemapdb/tools/keymap-gen'.format(meson.project_source_root())) +keymap_src_file = '@0@/src/keycodemapdb/data/keymaps.csv'.format(meson.project_source_root()) foreach name : keycode_list keycode_gen_sources += custom_target( diff --git a/tests/meson.build b/tests/meson.build index 3819eb8ba9..967a01fe14 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -3,7 +3,7 @@ tests_dep = declare_dependency( '-Dabs_builddir="@0@"'.format(meson.current_build_dir()), '-Dabs_top_builddir="@0@"'.format(meson.project_build_root()), '-Dabs_srcdir="@0@"'.format(meson.current_source_dir()), - '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), + '-Dabs_top_srcdir="@0@"'.format(meson.project_source_root()), ] + coverage_flags + cc_flags_relaxed_frame_limit, dependencies: [ apparmor_dep, @@ -37,7 +37,7 @@ tests_env = [ 'abs_builddir=@0@'.format(meson.current_build_dir()), 'abs_srcdir=@0@'.format(meson.current_source_dir()), 'abs_top_builddir=@0@'.format(meson.project_build_root()), - 'abs_top_srcdir=@0@'.format(meson.source_root()), + 'abs_top_srcdir=@0@'.format(meson.project_source_root()), 'LC_ALL=C', 'LIBVIRT_AUTOSTART=0', ] diff --git a/tools/wireshark/src/libvirt/meson.build b/tools/wireshark/src/libvirt/meson.build index 9d54f827d3..9c3b8aadc1 100644 --- a/tools/wireshark/src/libvirt/meson.build +++ b/tools/wireshark/src/libvirt/meson.build @@ -1,10 +1,10 @@ wireshark_protocol = custom_target( 'protocol.h', input: [ - meson.source_root() / 'src' / 'remote' / 'remote_protocol.x', - meson.source_root() / 'src' / 'remote' / 'qemu_protocol.x', - meson.source_root() / 'src' / 'remote' / 'lxc_protocol.x', - meson.source_root() / 'src' / 'rpc' / 'virkeepaliveprotocol.x', + meson.project_source_root() / 'src' / 'remote' / 'remote_protocol.x', + meson.project_source_root() / 'src' / 'remote' / 'qemu_protocol.x', + meson.project_source_root() / 'src' / 'remote' / 'lxc_protocol.x', + meson.project_source_root() / 'src' / 'rpc' / 'virkeepaliveprotocol.x', ], output: [ 'protocol.h', -- 2.35.1

The path() method is deprecated in 0.55.0 and we're recommended to use full_path() instead. Interestingly, we were already doing do in couple of place, but not all of them. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- build-aux/meson.build | 10 +++++----- docs/meson.build | 8 ++++---- meson.build | 36 ++++++++++++++++++------------------ src/access/meson.build | 2 +- src/meson.build | 22 +++++++++++----------- src/network/meson.build | 2 +- tests/meson.build | 2 +- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index 1c6b7fab53..16d085505d 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -1,6 +1,6 @@ flake8_path = '' if flake8_prog.found() - flake8_path = flake8_prog.path() + flake8_path = flake8_prog.full_path() endif if host_machine.system() == 'freebsd' or host_machine.system() == 'darwin' @@ -33,10 +33,10 @@ syntax_check_conf = configuration_data({ 'top_builddir': meson.project_build_root(), 'flake8_path': flake8_path, 'runutf8': ' '.join(runutf8), - 'PYTHON3': python3_prog.path(), - 'GREP': grep_prog.path(), - 'SED': sed_prog.path(), - 'AWK': awk_prog.path(), + 'PYTHON3': python3_prog.full_path(), + 'GREP': grep_prog.full_path(), + 'SED': sed_prog.full_path(), + 'AWK': awk_prog.full_path(), }) configure_file( diff --git a/docs/meson.build b/docs/meson.build index d88879fd2f..5c0c762db1 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -129,7 +129,7 @@ aclperms_gen = custom_target( ) docs_timestamp = run_command( - python3_prog, meson_timestamp_prog.path(), env: runutf8, check: true, + python3_prog, meson_timestamp_prog.full_path(), env: runutf8, check: true, ).stdout().strip() site_xsl = files('site.xsl') @@ -175,7 +175,7 @@ docs_programs_groups = [ foreach item : docs_programs_groups prog = find_program(item.get('prog'), dirs: libvirt_sbin_path) varname = item.get('name').underscorify() - conf.set_quoted(varname.to_upper(), prog.path()) + conf.set_quoted(varname.to_upper(), prog.full_path()) set_variable('@0@_prog'.format(varname), prog) endforeach @@ -348,7 +348,7 @@ endforeach run_target( 'install-web', command: [ - meson_python_prog, python3_prog.path(), meson_install_web_prog.path(), + meson_python_prog, python3_prog.full_path(), meson_install_web_prog.full_path(), install_web_files, ], depends: install_web_deps, @@ -358,7 +358,7 @@ test( 'check-html-references', python3_prog, args: [ - check_html_references_prog.path(), + check_html_references_prog.full_path(), '--prefix', meson.project_build_root() / 'docs' ], diff --git a/meson.build b/meson.build index 92f22d3538..822344e8a1 100644 --- a/meson.build +++ b/meson.build @@ -798,14 +798,14 @@ endif foreach name : required_programs prog = find_program(name, dirs: libvirt_sbin_path) varname = name.underscorify() - conf.set_quoted(varname.to_upper(), prog.path()) + conf.set_quoted(varname.to_upper(), prog.full_path()) set_variable('@0@_prog'.format(varname), prog) endforeach foreach item : required_programs_groups prog = find_program(item.get('prog'), dirs: libvirt_sbin_path) varname = item.get('name').underscorify() - conf.set_quoted(varname.to_upper(), prog.path()) + conf.set_quoted(varname.to_upper(), prog.full_path()) set_variable('@0@_prog'.format(varname), prog) endforeach @@ -835,7 +835,7 @@ foreach name : optional_programs prog = find_program(name, required: false, dirs: libvirt_sbin_path) varname = name.underscorify() if prog.found() - prog_path = prog.path() + prog_path = prog.full_path() else prog_path = name endif @@ -1446,9 +1446,9 @@ if not get_option('driver_bhyve').disabled() and host_machine.system() == 'freeb if bhyve_prog.found() and bhyvectl_prog.found() and bhyveload_prog.found() conf.set('WITH_BHYVE', 1) - conf.set_quoted('BHYVE', bhyve_prog.path()) - conf.set_quoted('BHYVECTL', bhyvectl_prog.path()) - conf.set_quoted('BHYVELOAD', bhyveload_prog.path()) + conf.set_quoted('BHYVE', bhyve_prog.full_path()) + conf.set_quoted('BHYVECTL', bhyvectl_prog.full_path()) + conf.set_quoted('BHYVELOAD', bhyveload_prog.full_path()) endif elif get_option('driver_bhyve').enabled() error('The bhyve driver cannot be enabled') @@ -1690,7 +1690,7 @@ if not get_option('driver_qemu').disabled() required: false ) if qemu_bridge_prog.found() - qemu_bridge_path = qemu_bridge_prog.path() + qemu_bridge_path = qemu_bridge_prog.full_path() else qemu_bridge_path = '/usr/libexec/qemu-bridge-helper' endif @@ -1702,7 +1702,7 @@ if not get_option('driver_qemu').disabled() required: false ) if qemu_pr_prog.found() - qemu_pr_path = qemu_pr_prog.path() + qemu_pr_path = qemu_pr_prog.full_path() else qemu_pr_path = '/usr/bin/qemu-pr-helper' endif @@ -1714,7 +1714,7 @@ if not get_option('driver_qemu').disabled() required: false ) if qemu_slirp_prog.found() - qemu_slirp_path = qemu_slirp_prog.path() + qemu_slirp_path = qemu_slirp_prog.full_path() else qemu_slirp_path = '/usr/bin/slirp-helper' endif @@ -1726,7 +1726,7 @@ if not get_option('driver_qemu').disabled() required: false ) if qemu_dbus_daemon_prog.found() - qemu_dbus_daemon_path = qemu_dbus_daemon_prog.path() + qemu_dbus_daemon_path = qemu_dbus_daemon_prog.full_path() else qemu_dbus_daemon_path = '/usr/bin/dbus-daemon' endif @@ -1822,14 +1822,14 @@ if conf.has('WITH_LIBVIRTD') use_storage = true conf.set('WITH_STORAGE_FS', 1) - conf.set_quoted('MOUNT', mount_prog.path()) - conf.set_quoted('UMOUNT', umount_prog.path()) - conf.set_quoted('MKFS', mkfs_prog.path()) + conf.set_quoted('MOUNT', mount_prog.full_path()) + conf.set_quoted('UMOUNT', umount_prog.full_path()) + conf.set_quoted('MKFS', mkfs_prog.full_path()) showmount_prog = find_program('showmount', required: false, dirs: libvirt_sbin_path) showmount_path = '' if showmount_prog.found() - showmount_path = showmount_prog.path() + showmount_path = showmount_prog.full_path() endif conf.set_quoted('SHOWMOUNT', showmount_path) endif @@ -1879,7 +1879,7 @@ if conf.has('WITH_LIBVIRTD') conf.set('WITH_STORAGE_LVM', 1) foreach name : lvm_progs - conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(name)).path()) + conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(name)).full_path()) endforeach endif endif @@ -2033,7 +2033,7 @@ if not get_option('numad').disabled() and numactl_dep.found() numad_prog = find_program('numad', required: get_option('numad'), dirs: libvirt_sbin_path) if numad_prog.found() conf.set('WITH_NUMAD', 1) - conf.set_quoted('NUMAD', numad_prog.path()) + conf.set_quoted('NUMAD', numad_prog.full_path()) endif elif get_option('numad').enabled() error('You must have numactl enabled for numad support.') @@ -2148,7 +2148,7 @@ if git configuration: spec_conf, ) - authors = run_command(python3_prog, meson_gen_authors_prog.path(), + authors = run_command(python3_prog, meson_gen_authors_prog.full_path(), env: runutf8, check: true) authors_file = 'AUTHORS.rst.in' @@ -2170,7 +2170,7 @@ if git foreach file : dist_files meson.add_dist_script( - meson_python_prog.path(), python3_prog.path(), meson_dist_prog.path(), + meson_python_prog.full_path(), python3_prog.full_path(), meson_dist_prog.full_path(), meson.project_build_root(), file ) endforeach diff --git a/src/access/meson.build b/src/access/meson.build index 4d563a1a60..07fd7d372e 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -120,6 +120,6 @@ generated_sym_files += access_gen_sym test( 'check-aclperms', python3_prog, - args: [ check_aclperms_prog.path(), access_perm_h, files('viraccessperm.c') ], + args: [ check_aclperms_prog.full_path(), access_perm_h, files('viraccessperm.c') ], env: runutf8, ) diff --git a/src/meson.build b/src/meson.build index 916bf1c863..35951d8990 100644 --- a/src/meson.build +++ b/src/meson.build @@ -909,7 +909,7 @@ virt_install_dirs += [ ] meson.add_install_script( - meson_python_prog.path(), python3_prog.path(), meson_install_dirs_prog.path(), + meson_python_prog.full_path(), python3_prog.full_path(), meson_install_dirs_prog.full_path(), virt_install_dirs, ) @@ -920,7 +920,7 @@ if host_machine.system() == 'linux' test( 'check-symfile', python3_prog, - args: [ check_symfile_prog.path(), libvirt_syms, libvirt_lib ], + args: [ check_symfile_prog.full_path(), libvirt_syms, libvirt_lib ], env: runutf8, ) @@ -928,7 +928,7 @@ if host_machine.system() == 'linux' test( 'check-admin-symfile', python3_prog, - args: [ check_symfile_prog.path(), libvirt_admin_syms, libvirt_admin_lib ], + args: [ check_symfile_prog.full_path(), libvirt_admin_syms, libvirt_admin_lib ], env: runutf8, ) endif @@ -938,7 +938,7 @@ test( 'check-symsorting', python3_prog, args: [ - check_symsorting_prog.path(), + check_symsorting_prog.full_path(), meson.current_source_dir(), files(sym_files, used_sym_files), ], @@ -949,7 +949,7 @@ test( 'check-admin-symsorting', python3_prog, args: [ - check_symsorting_prog.path(), + check_symsorting_prog.full_path(), meson.current_source_dir(), libvirt_admin_private_syms, ], @@ -960,7 +960,7 @@ test( 'check-drivername', python3_prog, args: [ - check_drivername_prog.path(), files(driver_headers), + check_drivername_prog.full_path(), files(driver_headers), files('libvirt_public.syms'), libvirt_qemu_syms, libvirt_lxc_syms, ], env: runutf8, @@ -970,7 +970,7 @@ test( 'check-admin-drivername', python3_prog, args: [ - check_drivername_prog.path(), libvirt_admin_public_syms, + check_drivername_prog.full_path(), libvirt_admin_public_syms, ], env: runutf8, ) @@ -978,14 +978,14 @@ test( test( 'check-driverimpls', python3_prog, - args: [ check_driverimpls_prog.path(), driver_source_files ], + args: [ check_driverimpls_prog.full_path(), driver_source_files ], env: runutf8, ) test( 'check-aclrules', python3_prog, - args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], + args: [ check_aclrules_prog.full_path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], env: runutf8, ) @@ -1010,11 +1010,11 @@ if pdwtags_prog.found() and cc.get_id() != 'clang' 'check-@0@'.format(proto['name']), python3_prog, args: [ - check_remote_protocol_prog.path(), + check_remote_protocol_prog.full_path(), proto['name'], lib.name(), lib.full_path(), - pdwtags_prog.path(), + pdwtags_prog.full_path(), files('@0@-structs'.format(proto['name'])), ], env: runutf8, diff --git a/src/network/meson.build b/src/network/meson.build index 395074a0a0..d5f9ba2254 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -90,7 +90,7 @@ if conf.has('WITH_NETWORK') ) meson.add_install_script( - meson_python_prog.path(), python3_prog.path(), meson_install_symlink_prog.path(), + meson_python_prog.full_path(), python3_prog.full_path(), meson_install_symlink_prog.full_path(), confdir / 'qemu' / 'networks' / 'autostart', '../default.xml', 'default.xml', ) diff --git a/tests/meson.build b/tests/meson.build index 967a01fe14..1149211756 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -700,7 +700,7 @@ testenv += 'VIR_TEST_FILE_ACCESS=1' add_test_setup( 'access', env: testenv, - exe_wrapper: [ python3_prog, check_file_access_prog.path() ], + exe_wrapper: [ python3_prog, check_file_access_prog.full_path() ], ) add_test_setup( -- 2.35.1

On a Friday in 2022, Michal Privoznik wrote:
The path() method is deprecated in 0.55.0 and we're recommended to use full_path() instead. Interestingly, we were already doing do in couple of place, but not all of them.
*places Jano
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- build-aux/meson.build | 10 +++++----- docs/meson.build | 8 ++++---- meson.build | 36 ++++++++++++++++++------------------ src/access/meson.build | 2 +- src/meson.build | 22 +++++++++++----------- src/network/meson.build | 2 +- tests/meson.build | 2 +- 7 files changed, 41 insertions(+), 41 deletions(-)

The get_pkgconfig_variable() method is deprecated in 0.56.0 and we're recommended to use get_variable(pkgconfig : ...) instead. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- meson.build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 822344e8a1..2d19d4b735 100644 --- a/meson.build +++ b/meson.build @@ -1267,10 +1267,10 @@ endif if wireshark_dep.found() wireshark_plugindir = get_option('wireshark_plugindir') if wireshark_plugindir == '' - wireshark_plugindir = wireshark_dep.get_pkgconfig_variable('plugindir') + wireshark_plugindir = wireshark_dep.get_variable(pkgconfig : 'plugindir') endif - wireshark_prefix = wireshark_dep.get_pkgconfig_variable('prefix') + wireshark_prefix = wireshark_dep.get_variable(pkgconfig : 'prefix') if wireshark_prefix == '' # If wireshark's prefix cannot be retrieved from pkg-config, # this is our best bet. @@ -1318,7 +1318,7 @@ if yajl_dep.found() # # [1] https://github.com/Homebrew/homebrew-core/pull/74516 if host_machine.system() != 'linux' - yajl_includedir = yajl_dep.get_pkgconfig_variable('includedir') + yajl_includedir = yajl_dep.get_variable(pkgconfig : 'includedir') if yajl_includedir.contains('include/yajl') rc = run_command( 'python3', '-c', @@ -1351,8 +1351,8 @@ endif if bash_completion_dep.found() bash_completion_dir = get_option('bash_completion_dir') if bash_completion_dir == '' - bash_completion_dir = bash_completion_dep.get_pkgconfig_variable('completionsdir') - bash_completion_prefix = bash_completion_dep.get_pkgconfig_variable('prefix') + bash_completion_dir = bash_completion_dep.get_variable(pkgconfig : 'completionsdir') + bash_completion_prefix = bash_completion_dep.get_variable(pkgconfig : 'prefix') rc = run_command( 'python3', '-c', 'print("@0@".replace("@1@", "@2@"))'.format( @@ -1478,8 +1478,8 @@ if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD') libxl_dep = dependency('xenlight', version: '>=' + libxl_version, required: get_option('driver_libxl')) if libxl_dep.found() - libxl_firmware_dir = libxl_dep.get_pkgconfig_variable('xenfirmwaredir') - libxl_execbin = libxl_dep.get_pkgconfig_variable('libexec_bin') + libxl_firmware_dir = libxl_dep.get_variable(pkgconfig : 'xenfirmwaredir') + libxl_execbin = libxl_dep.get_variable(pkgconfig : 'libexec_bin') if libxl_firmware_dir != '' conf.set_quoted('LIBXL_FIRMWARE_DIR', libxl_firmware_dir) endif -- 2.35.1

Bump the minimal required version to 0.56.0. Looking into our CI this is the oldest version we install. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- libvirt.spec.in | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 950c5a3b6d..ba792345e7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -271,7 +271,7 @@ Requires: libvirt-libs = %{version}-%{release} # listed against each sub-RPM BuildRequires: python3-docutils BuildRequires: gcc -BuildRequires: meson >= 0.54.0 +BuildRequires: meson >= 0.56.0 BuildRequires: ninja-build BuildRequires: git BuildRequires: perl-interpreter diff --git a/meson.build b/meson.build index 2d19d4b735..93de355430 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'libvirt', 'c', version: '8.9.0', license: 'LGPLv2+', - meson_version: '>= 0.54.0', + meson_version: '>= 0.56.0', default_options: [ 'buildtype=debugoptimized', 'b_pie=true', -- 2.35.1

On a Friday in 2022, Michal Privoznik wrote:
*** BLURB HERE ***
Michal Prívozník (5): meson: Replace meson.build_root() with meson.project_build_root() meson: Replace meson.source_root() with meson.project_source_root() meson: Replace external_program.path() with external_program.full_path() Replace dep.get_pkgconfig_variable() with dep.get_variable(pkgconfig:) meson: Bump minimal required meson version
build-aux/meson.build | 14 +++--- docs/go/meson.build | 2 +- docs/html/meson.build | 4 +- docs/kbase/internals/meson.build | 2 +- docs/kbase/meson.build | 2 +- docs/manpages/meson.build | 2 +- docs/meson.build | 18 +++---- libvirt.spec.in | 2 +- meson.build | 64 ++++++++++++------------- po/meson.build | 4 +- src/access/meson.build | 4 +- src/esx/meson.build | 8 ++-- src/hyperv/meson.build | 4 +- src/meson.build | 30 ++++++------ src/network/meson.build | 2 +- src/util/meson.build | 4 +- tests/meson.build | 10 ++-- tools/wireshark/src/libvirt/meson.build | 8 ++-- 18 files changed, 92 insertions(+), 92 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Michal Privoznik