[PATCH 2/5] meson: Replace meson.source_root() with meson.project_source_root()

Michal Privoznik mprivozn at redhat.com
Fri Oct 7 10:44:22 UTC 2022


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 at 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



More information about the libvir-list mailing list