meson: do not use meson.source_root() and meson.build_root()

Using meson.source_root() and meson.build_root() are deprectated in
meson-0.56.  Using current_source_dir() or current_build_dir() (which
have been available in all Meson versions) would require manually
adding "../" in some places.  Instead, use project_source_root() and
project_build_root() and require meson-0.56.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2022-03-06 16:06:39 +10:00
parent 3a39eff15e
commit c89f42f17b
3 changed files with 9 additions and 9 deletions

View file

@ -8,7 +8,7 @@ project('pacman',
'sysconfdir=/etc', 'sysconfdir=/etc',
'localstatedir=/var', 'localstatedir=/var',
], ],
meson_version : '>= 0.55') meson_version : '>= 0.56')
libalpm_version = '13.0.1' libalpm_version = '13.0.1'
@ -29,7 +29,7 @@ PKGDATADIR = join_paths(PREFIX, DATAROOTDIR, meson.project_name())
PYTHON = import('python').find_installation('python3') PYTHON = import('python').find_installation('python3')
LDCONFIG = get_option('ldconfig') LDCONFIG = get_option('ldconfig')
MESON_MAKE_SYMLINK = join_paths(meson.source_root(), 'build-aux/meson-make-symlink.sh') MESON_MAKE_SYMLINK = join_paths(meson.project_source_root(), 'build-aux/meson-make-symlink.sh')
BASH = find_program('bash4', 'bash') BASH = find_program('bash4', 'bash')
if BASH.found() if BASH.found()
@ -382,7 +382,7 @@ foreach wrapper : script_wrappers
# directory. Use configure_file instead of a custom_target to ensure that # directory. Use configure_file instead of a custom_target to ensure that
# permissions on the input script wrapper are preserved. # permissions on the input script wrapper are preserved.
configure_file( configure_file(
input : join_paths(meson.source_root(), 'build-aux', 'script-wrapper.sh.in'), input : join_paths(meson.project_source_root(), 'build-aux', 'script-wrapper.sh.in'),
output : wrapper[0], output : wrapper[0],
configuration : cdata) configuration : cdata)
endforeach endforeach
@ -416,10 +416,10 @@ foreach path : [
endforeach endforeach
TEST_ENV = environment() TEST_ENV = environment()
TEST_ENV.set('PMTEST_SCRIPTLIB_DIR', join_paths(meson.source_root(), 'scripts/library/')) TEST_ENV.set('PMTEST_SCRIPTLIB_DIR', join_paths(meson.project_source_root(), 'scripts/library/'))
TEST_ENV.set('PMTEST_LIBMAKEPKG_DIR', join_paths(meson.build_root(), 'scripts/libmakepkg/')) TEST_ENV.set('PMTEST_LIBMAKEPKG_DIR', join_paths(meson.project_build_root(), 'scripts/libmakepkg/'))
TEST_ENV.set('PMTEST_UTIL_DIR', meson.build_root() + '/') TEST_ENV.set('PMTEST_UTIL_DIR', meson.project_build_root() + '/')
TEST_ENV.set('PMTEST_SCRIPT_DIR', join_paths(meson.build_root(), 'scripts/')) TEST_ENV.set('PMTEST_SCRIPT_DIR', join_paths(meson.project_build_root(), 'scripts/'))
subdir('test/pacman') subdir('test/pacman')
subdir('test/scripts') subdir('test/scripts')

View file

@ -10,7 +10,7 @@ scripts = [
] ]
SCRIPT_EDITOR = find_program(configure_file( SCRIPT_EDITOR = find_program(configure_file(
input : join_paths(meson.source_root(), 'build-aux/edit-script.sh.in'), input : join_paths(meson.project_source_root(), 'build-aux/edit-script.sh.in'),
output : 'edit-script.sh', output : 'edit-script.sh',
configuration : substs)) configuration : substs))

View file

@ -354,7 +354,7 @@ foreach input : pacman_tests
args = [ args = [
join_paths(meson.current_source_dir(), 'pactest.py'), join_paths(meson.current_source_dir(), 'pactest.py'),
'--scriptlet-shell', get_option('scriptlet-shell'), '--scriptlet-shell', get_option('scriptlet-shell'),
'--bindir', meson.build_root(), '--bindir', meson.project_build_root(),
'--ldconfig', LDCONFIG, '--ldconfig', LDCONFIG,
'--verbose', '--verbose',
join_paths(meson.current_source_dir(), input) join_paths(meson.current_source_dir(), input)