meson: Bump meson version and fix deprecations

This commit is contained in:
Benjamin Berg 2022-05-10 15:39:24 +02:00
parent a87cb420cd
commit baa14729a0
3 changed files with 11 additions and 11 deletions

View file

@ -2,7 +2,7 @@ subdir('man')
ifaces_refs = [] 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') spec_to_docbook = files('spec-to-docbook.xsl')
foreach iface: upowerd_dbus_interfaces foreach iface: upowerd_dbus_interfaces
@ -30,7 +30,7 @@ version_xml = configure_file(
if get_option('gtk-doc') if get_option('gtk-doc')
gnome.gtkdoc('UPower', gnome.gtkdoc('UPower',
main_xml: 'upower-docs.xml', main_xml: 'upower-docs.xml',
src_dir: meson.source_root() / 'libupower-glib', src_dir: meson.project_source_root() / 'libupower-glib',
dependencies: [ libupower_glib_dep ], dependencies: [ libupower_glib_dep ],
scan_args: ['--rebuild-types', '--rebuild-sections'], scan_args: ['--rebuild-types', '--rebuild-sections'],
content_files: [ content_files: [

View file

@ -6,7 +6,7 @@ project('upower', 'c',
'warning_level=1', 'warning_level=1',
'c_std=gnu99', 'c_std=gnu99',
], ],
meson_version: '>= 0.49.0') meson_version: '>= 0.56.0')
soversion = 3 soversion = 3
current = 1 current = 1
@ -91,20 +91,20 @@ endif
udevrulesdir = get_option('udevrulesdir') udevrulesdir = get_option('udevrulesdir')
if udevrulesdir == 'auto' if udevrulesdir == 'auto'
udev_dep = dependency('udev', required: true) 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 endif
udevhwdbdir = get_option('udevhwdbdir') udevhwdbdir = get_option('udevhwdbdir')
if udevhwdbdir == 'auto' if udevhwdbdir == 'auto'
udev_dep = dependency('udev', required: true) 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 endif
dbusdir = get_option('datadir') / 'dbus-1' dbusdir = get_option('datadir') / 'dbus-1'
systemdsystemunitdir = get_option('systemdsystemunitdir') systemdsystemunitdir = get_option('systemdsystemunitdir')
if systemdsystemunitdir == '' if systemdsystemunitdir == ''
systemd_dep = dependency('systemd') systemd_dep = dependency('systemd')
systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir') systemdsystemunitdir = systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir')
endif endif
# Generate configuration file # Generate configuration file

View file

@ -61,7 +61,7 @@ up_self_test = executable('up_self_test',
'up-self-test.c', 'up-self-test.c',
], ],
c_args: [ 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"', '-DG_LOG_DOMAIN="UPower"',
], ],
dependencies: upowerd_deps, dependencies: upowerd_deps,
@ -116,13 +116,13 @@ test(
# defined here as we would have a circular dependency otherwise. # defined here as we would have a circular dependency otherwise.
if os_backend == 'linux' and gobject_introspection.found() if os_backend == 'linux' and gobject_introspection.found()
env = environment() env = environment()
env.prepend('top_builddir', join_paths(meson.build_root())) env.prepend('top_builddir', join_paths(meson.project_build_root()))
env.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'libupower-glib')) env.prepend('LD_LIBRARY_PATH', join_paths(meson.project_build_root(), 'libupower-glib'))
env.prepend('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'libupower-glib')) env.prepend('GI_TYPELIB_PATH', join_paths(meson.project_build_root(), 'libupower-glib'))
python3 = find_program('python3') python3 = find_program('python3')
unittest_inspector = find_program('linux/unittest_inspector.py') 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') unit_tests = r.stdout().strip().split('\n')
foreach ut: unit_tests foreach ut: unit_tests