From daf729de118f6f955b767e3fec216db99616fbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 23 Dec 2021 02:40:22 +0100 Subject: [PATCH] build: Replace deprecated meson functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace deprecated functions with their direct replacements: - dep.get_pkgconfig_variable() → dep.get_variable() - prg.path() → prg.full_path() - source/build_root() → project_source/build_root() In one case we need meson.global_source_root() that was only added in meson 0.58, so bump the requirement to that. Part-of: --- docs/reference/shell/meson.build | 4 ++-- docs/reference/st/meson.build | 4 ++-- js/dbusServices/meson.build | 2 +- meson.build | 10 +++++----- src/meson.build | 2 +- src/st/meson.build | 6 +++--- subprojects/extensions-app/js/meson.build | 2 +- subprojects/extensions-app/meson.build | 2 +- subprojects/extensions-tool/meson.build | 6 +++--- subprojects/shew/meson.build | 2 +- tests/meson.build | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/reference/shell/meson.build b/docs/reference/shell/meson.build index 5936ea3f6..96b0d087d 100644 --- a/docs/reference/shell/meson.build +++ b/docs/reference/shell/meson.build @@ -41,8 +41,8 @@ configure_file( gnome.gtkdoc('shell', main_sgml: 'shell-docs.sgml', src_dir: [ - join_paths(meson.source_root(), 'src'), - join_paths(meson.build_root(), 'src') + join_paths(meson.project_source_root(), 'src'), + join_paths(meson.project_build_root(), 'src') ], scan_args: [ '--ignore-headers=' + ' '.join(private_headers + exclude_directories) diff --git a/docs/reference/st/meson.build b/docs/reference/st/meson.build index 3e9e9ab7c..0c4b4207b 100644 --- a/docs/reference/st/meson.build +++ b/docs/reference/st/meson.build @@ -12,8 +12,8 @@ configure_file( gnome.gtkdoc('st', main_sgml: 'st-docs.sgml', src_dir: [ - join_paths(meson.source_root(), 'src', 'st'), - join_paths(meson.build_root(), 'src', 'st') + join_paths(meson.project_source_root(), 'src', 'st'), + join_paths(meson.project_build_root(), 'src', 'st') ], scan_args: [ '--ignore-headers=' + ' '.join(private_headers), diff --git a/js/dbusServices/meson.build b/js/dbusServices/meson.build index 68e8bd12d..eb941ed90 100644 --- a/js/dbusServices/meson.build +++ b/js/dbusServices/meson.build @@ -27,7 +27,7 @@ foreach service, dir : dbus_services serviceconf = configuration_data() serviceconf.set('service', service) - serviceconf.set('gjs', gjs.path()) + serviceconf.set('gjs', gjs.full_path()) serviceconf.set('pkgdatadir', pkgdatadir) configure_file( diff --git a/meson.build b/meson.build index d4583ecf2..4b192847c 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('gnome-shell', 'c', version: '41.0', - meson_version: '>= 0.53.0', + meson_version: '>= 0.58.0', license: 'GPLv2+' ) @@ -65,7 +65,7 @@ servicedir = join_paths(datadir, 'dbus-1', 'services') keybindings_dep = dependency('gnome-keybindings', required: false) if keybindings_dep.found() - keysdir = keybindings_dep.get_pkgconfig_variable('keysdir', define_variable: ['datadir', datadir]) + keysdir = keybindings_dep.get_variable('keysdir', pkgconfig_define: ['datadir', datadir]) else keysdir = join_paths(datadir, 'gnome-control-center', 'keybindings') endif @@ -117,8 +117,8 @@ endif if get_option('systemd') libsystemd_dep = dependency('libsystemd') systemd_dep = dependency('systemd') - systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir', - define_variable: ['prefix', prefix]) + systemduserunitdir = systemd_dep.get_variable('systemduserunitdir', + pkgconfig_define: ['prefix', prefix]) have_systemd = true else libsystemd_dep = [] @@ -136,7 +136,7 @@ if get_option('man') endif endif -mutter_typelibdir = mutter_dep.get_pkgconfig_variable('typelibdir') +mutter_typelibdir = mutter_dep.get_variable('typelibdir') python = find_program('python3') gjs = find_program('gjs') diff --git a/src/meson.build b/src/meson.build index 53b8b527d..8dd0887c6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -13,7 +13,7 @@ script_data.set('libdir', libdir) script_data.set('libexecdir', libexecdir) script_data.set('pkgdatadir', pkgdatadir) script_data.set('pkglibdir', pkglibdir) -script_data.set('PYTHON', python.path()) +script_data.set('PYTHON', python.full_path()) script_data.set('VERSION', meson.project_version()) script_tools = ['gnome-shell-perf-tool'] diff --git a/src/st/meson.build b/src/st/meson.build index 084fb2ee4..717aa0588 100644 --- a/src/st/meson.build +++ b/src/st/meson.build @@ -153,7 +153,7 @@ st_enums = gnome.mkenums_simple('st-enum-types', st_gir_sources = st_sources + st_headers + st_enums -data_to_c = find_program(meson.source_root() + '/src/data-to-c.pl') +data_to_c = find_program(meson.project_source_root() + '/src/data-to-c.pl') glsl_sources = custom_target('scroll-view-fade-glsl', input: ['st-scroll-view-fade.glsl'], @@ -165,8 +165,8 @@ glsl_sources = custom_target('scroll-view-fade-glsl', st_nogir_sources = [glsl_sources] st_cflags = [ - '-I@0@/src'.format(meson.source_root()), - '-I@0@'.format(meson.build_root()), + '-I@0@/src'.format(meson.project_source_root()), + '-I@0@'.format(meson.project_build_root()), '-DPREFIX="@0@"'.format(prefix), '-DLIBDIR="@0@"'.format(libdir), '-DG_LOG_DOMAIN="St"', diff --git a/subprojects/extensions-app/js/meson.build b/subprojects/extensions-app/js/meson.build index f311db6e0..ce2a7768b 100644 --- a/subprojects/extensions-app/js/meson.build +++ b/subprojects/extensions-app/js/meson.build @@ -9,7 +9,7 @@ endif launcherconf.set('prefix', prefix) launcherconf.set('libdir', libdir) launcherconf.set('pkgdatadir', pkgdatadir) -launcherconf.set('gjs', gjs.path()) +launcherconf.set('gjs', gjs.full_path()) configure_file( input: prgname + '.in', diff --git a/subprojects/extensions-app/meson.build b/subprojects/extensions-app/meson.build index f9ccfc24d..21dd44825 100644 --- a/subprojects/extensions-app/meson.build +++ b/subprojects/extensions-app/meson.build @@ -1,6 +1,6 @@ project('gnome-extensions-app', version: '41.0', - meson_version: '>= 0.53.0', + meson_version: '>= 0.58.0', license: 'GPLv2+' ) diff --git a/subprojects/extensions-tool/meson.build b/subprojects/extensions-tool/meson.build index 3b797880f..07084fbe1 100644 --- a/subprojects/extensions-tool/meson.build +++ b/subprojects/extensions-tool/meson.build @@ -1,6 +1,6 @@ project('gnome-extensions-tool', 'c', version: '41.0', - meson_version: '>= 0.53.0', + meson_version: '>= 0.58.0', license: 'GPLv2+' ) @@ -36,13 +36,13 @@ cc = meson.get_compiler('c') bash_completion = dependency('bash-completion', required: get_option('bash_completion')) -po_dir = meson.source_root() + '/po' +po_dir = meson.global_source_root() + '/po' subdir('src') if bash_completion.found() install_data('completion/bash/gnome-extensions', - install_dir: bash_completion.get_pkgconfig_variable('completionsdir', define_variable: ['datadir', datadir]) + install_dir: bash_completion.get_variable('completionsdir', pkgconfig_define: ['datadir', datadir]) ) endif diff --git a/subprojects/shew/meson.build b/subprojects/shew/meson.build index d3d1aea24..0efb01095 100644 --- a/subprojects/shew/meson.build +++ b/subprojects/shew/meson.build @@ -1,6 +1,6 @@ project('shew', 'c', version: '41.0', - meson_version: '>= 0.53.0', + meson_version: '>= 0.58.0', license: 'LGPLv2+', ) diff --git a/tests/meson.build b/tests/meson.build index 50fb601e9..50f8313e9 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -8,7 +8,7 @@ run_test = configure_file( ) testenv = environment() -testenv.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.build_root(), 'data')) +testenv.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.project_build_root(), 'data')) tests = [ 'highlighter',