From baa14729a081b3ba2a1a415ef6c9cf0458ef3bac Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 10 May 2022 15:39:24 +0200 Subject: [PATCH] meson: Bump meson version and fix deprecations --- doc/meson.build | 4 ++-- meson.build | 8 ++++---- src/meson.build | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index 5fc253c..180d3e9 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -2,7 +2,7 @@ subdir('man') ifaces_refs = [] -dbus_dir = join_paths(meson.source_root(), 'dbus') +dbus_dir = join_paths(meson.project_source_root(), 'dbus') spec_to_docbook = files('spec-to-docbook.xsl') foreach iface: upowerd_dbus_interfaces @@ -30,7 +30,7 @@ version_xml = configure_file( if get_option('gtk-doc') gnome.gtkdoc('UPower', main_xml: 'upower-docs.xml', - src_dir: meson.source_root() / 'libupower-glib', + src_dir: meson.project_source_root() / 'libupower-glib', dependencies: [ libupower_glib_dep ], scan_args: ['--rebuild-types', '--rebuild-sections'], content_files: [ diff --git a/meson.build b/meson.build index edb713c..f0bcdc3 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('upower', 'c', 'warning_level=1', 'c_std=gnu99', ], - meson_version: '>= 0.49.0') + meson_version: '>= 0.56.0') soversion = 3 current = 1 @@ -91,20 +91,20 @@ endif udevrulesdir = get_option('udevrulesdir') if udevrulesdir == 'auto' udev_dep = dependency('udev', required: true) - udevrulesdir = udev_dep.get_pkgconfig_variable('udev_dir') / 'rules.d' + udevrulesdir = udev_dep.get_variable(pkgconfig: 'udev_dir') / 'rules.d' endif udevhwdbdir = get_option('udevhwdbdir') if udevhwdbdir == 'auto' udev_dep = dependency('udev', required: true) - udevhwdbdir = udev_dep.get_pkgconfig_variable('udev_dir') / 'hwdb.d' + udevhwdbdir = udev_dep.get_variable(pkgconfig: 'udev_dir') / 'hwdb.d' endif dbusdir = get_option('datadir') / 'dbus-1' systemdsystemunitdir = get_option('systemdsystemunitdir') if systemdsystemunitdir == '' systemd_dep = dependency('systemd') - systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir') + systemdsystemunitdir = systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir') endif # Generate configuration file diff --git a/src/meson.build b/src/meson.build index 98db841..3ee7073 100644 --- a/src/meson.build +++ b/src/meson.build @@ -61,7 +61,7 @@ up_self_test = executable('up_self_test', 'up-self-test.c', ], c_args: [ - '-DUPOWER_CONF_PATH="@0@"'.format(meson.source_root() / 'etc' / 'UPower.conf'), + '-DUPOWER_CONF_PATH="@0@"'.format(meson.project_source_root() / 'etc' / 'UPower.conf'), '-DG_LOG_DOMAIN="UPower"', ], dependencies: upowerd_deps, @@ -116,13 +116,13 @@ test( # defined here as we would have a circular dependency otherwise. if os_backend == 'linux' and gobject_introspection.found() env = environment() - env.prepend('top_builddir', join_paths(meson.build_root())) - env.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'libupower-glib')) - env.prepend('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'libupower-glib')) + env.prepend('top_builddir', join_paths(meson.project_build_root())) + env.prepend('LD_LIBRARY_PATH', join_paths(meson.project_build_root(), 'libupower-glib')) + env.prepend('GI_TYPELIB_PATH', join_paths(meson.project_build_root(), 'libupower-glib')) python3 = find_program('python3') unittest_inspector = find_program('linux/unittest_inspector.py') - r = run_command(unittest_inspector, files('linux/integration-test.py')) + r = run_command(unittest_inspector, files('linux/integration-test.py'), check: true) unit_tests = r.stdout().strip().split('\n') foreach ut: unit_tests