build: Replace deprecated meson functions

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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2077>
This commit is contained in:
Florian Müllner 2021-12-23 02:40:22 +01:00 committed by Marge Bot
parent 0d3894c471
commit daf729de11
11 changed files with 21 additions and 21 deletions

View File

@ -41,8 +41,8 @@ configure_file(
gnome.gtkdoc('shell', gnome.gtkdoc('shell',
main_sgml: 'shell-docs.sgml', main_sgml: 'shell-docs.sgml',
src_dir: [ src_dir: [
join_paths(meson.source_root(), 'src'), join_paths(meson.project_source_root(), 'src'),
join_paths(meson.build_root(), 'src') join_paths(meson.project_build_root(), 'src')
], ],
scan_args: [ scan_args: [
'--ignore-headers=' + ' '.join(private_headers + exclude_directories) '--ignore-headers=' + ' '.join(private_headers + exclude_directories)

View File

@ -12,8 +12,8 @@ configure_file(
gnome.gtkdoc('st', gnome.gtkdoc('st',
main_sgml: 'st-docs.sgml', main_sgml: 'st-docs.sgml',
src_dir: [ src_dir: [
join_paths(meson.source_root(), 'src', 'st'), join_paths(meson.project_source_root(), 'src', 'st'),
join_paths(meson.build_root(), 'src', 'st') join_paths(meson.project_build_root(), 'src', 'st')
], ],
scan_args: [ scan_args: [
'--ignore-headers=' + ' '.join(private_headers), '--ignore-headers=' + ' '.join(private_headers),

View File

@ -27,7 +27,7 @@ foreach service, dir : dbus_services
serviceconf = configuration_data() serviceconf = configuration_data()
serviceconf.set('service', service) serviceconf.set('service', service)
serviceconf.set('gjs', gjs.path()) serviceconf.set('gjs', gjs.full_path())
serviceconf.set('pkgdatadir', pkgdatadir) serviceconf.set('pkgdatadir', pkgdatadir)
configure_file( configure_file(

View File

@ -1,6 +1,6 @@
project('gnome-shell', 'c', project('gnome-shell', 'c',
version: '41.0', version: '41.0',
meson_version: '>= 0.53.0', meson_version: '>= 0.58.0',
license: 'GPLv2+' license: 'GPLv2+'
) )
@ -65,7 +65,7 @@ servicedir = join_paths(datadir, 'dbus-1', 'services')
keybindings_dep = dependency('gnome-keybindings', required: false) keybindings_dep = dependency('gnome-keybindings', required: false)
if keybindings_dep.found() 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 else
keysdir = join_paths(datadir, 'gnome-control-center', 'keybindings') keysdir = join_paths(datadir, 'gnome-control-center', 'keybindings')
endif endif
@ -117,8 +117,8 @@ endif
if get_option('systemd') if get_option('systemd')
libsystemd_dep = dependency('libsystemd') libsystemd_dep = dependency('libsystemd')
systemd_dep = dependency('systemd') systemd_dep = dependency('systemd')
systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir', systemduserunitdir = systemd_dep.get_variable('systemduserunitdir',
define_variable: ['prefix', prefix]) pkgconfig_define: ['prefix', prefix])
have_systemd = true have_systemd = true
else else
libsystemd_dep = [] libsystemd_dep = []
@ -136,7 +136,7 @@ if get_option('man')
endif endif
endif endif
mutter_typelibdir = mutter_dep.get_pkgconfig_variable('typelibdir') mutter_typelibdir = mutter_dep.get_variable('typelibdir')
python = find_program('python3') python = find_program('python3')
gjs = find_program('gjs') gjs = find_program('gjs')

View File

@ -13,7 +13,7 @@ script_data.set('libdir', libdir)
script_data.set('libexecdir', libexecdir) script_data.set('libexecdir', libexecdir)
script_data.set('pkgdatadir', pkgdatadir) script_data.set('pkgdatadir', pkgdatadir)
script_data.set('pkglibdir', pkglibdir) 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_data.set('VERSION', meson.project_version())
script_tools = ['gnome-shell-perf-tool'] script_tools = ['gnome-shell-perf-tool']

View File

@ -153,7 +153,7 @@ st_enums = gnome.mkenums_simple('st-enum-types',
st_gir_sources = st_sources + st_headers + st_enums 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', glsl_sources = custom_target('scroll-view-fade-glsl',
input: ['st-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_nogir_sources = [glsl_sources]
st_cflags = [ st_cflags = [
'-I@0@/src'.format(meson.source_root()), '-I@0@/src'.format(meson.project_source_root()),
'-I@0@'.format(meson.build_root()), '-I@0@'.format(meson.project_build_root()),
'-DPREFIX="@0@"'.format(prefix), '-DPREFIX="@0@"'.format(prefix),
'-DLIBDIR="@0@"'.format(libdir), '-DLIBDIR="@0@"'.format(libdir),
'-DG_LOG_DOMAIN="St"', '-DG_LOG_DOMAIN="St"',

View File

@ -9,7 +9,7 @@ endif
launcherconf.set('prefix', prefix) launcherconf.set('prefix', prefix)
launcherconf.set('libdir', libdir) launcherconf.set('libdir', libdir)
launcherconf.set('pkgdatadir', pkgdatadir) launcherconf.set('pkgdatadir', pkgdatadir)
launcherconf.set('gjs', gjs.path()) launcherconf.set('gjs', gjs.full_path())
configure_file( configure_file(
input: prgname + '.in', input: prgname + '.in',

View File

@ -1,6 +1,6 @@
project('gnome-extensions-app', project('gnome-extensions-app',
version: '41.0', version: '41.0',
meson_version: '>= 0.53.0', meson_version: '>= 0.58.0',
license: 'GPLv2+' license: 'GPLv2+'
) )

View File

@ -1,6 +1,6 @@
project('gnome-extensions-tool', 'c', project('gnome-extensions-tool', 'c',
version: '41.0', version: '41.0',
meson_version: '>= 0.53.0', meson_version: '>= 0.58.0',
license: 'GPLv2+' license: 'GPLv2+'
) )
@ -36,13 +36,13 @@ cc = meson.get_compiler('c')
bash_completion = dependency('bash-completion', required: get_option('bash_completion')) 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') subdir('src')
if bash_completion.found() if bash_completion.found()
install_data('completion/bash/gnome-extensions', 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 endif

View File

@ -1,6 +1,6 @@
project('shew', 'c', project('shew', 'c',
version: '41.0', version: '41.0',
meson_version: '>= 0.53.0', meson_version: '>= 0.58.0',
license: 'LGPLv2+', license: 'LGPLv2+',
) )

View File

@ -8,7 +8,7 @@ run_test = configure_file(
) )
testenv = environment() 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 = [ tests = [
'highlighter', 'highlighter',