Merge branch 'valgrind-variable' into 'main'

meson: Add glib_valgrind_suppressions variable to glib pkg-config file

See merge request GNOME/glib!3361
This commit is contained in:
Marco Trevisan
2023-04-17 12:52:28 +00:00
8 changed files with 181 additions and 22 deletions

View File

@@ -875,18 +875,20 @@ libgio_dep = declare_dependency(link_with : libgio,
pkg.generate(libgio,
requires : ['glib-2.0', 'gobject-2.0'],
variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')),
'schemasdir=' + join_paths('${datadir}', schemas_subdir),
'bindir=' + join_paths('${prefix}', get_option('bindir')),
'giomoduledir=' + pkgconfig_giomodulesdir,
'gio=' + join_paths('${bindir}', 'gio'),
'gio_querymodules=@0@'.format(pkgconfig_multiarch_bindir / 'gio-querymodules'),
'glib_compile_schemas=@0@'.format(pkgconfig_multiarch_bindir / 'glib-compile-schemas'),
'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'),
'gdbus=' + join_paths('${bindir}', 'gdbus'),
'gdbus_codegen=' + join_paths('${bindir}', 'gdbus-codegen'),
'gresource=' + join_paths('${bindir}', 'gresource'),
'gsettings=' + join_paths('${bindir}', 'gsettings')],
variables : [
'datadir=' + '${prefix}' / get_option('datadir'),
'schemasdir=' + '${datadir}' / schemas_subdir,
'bindir=' + '${prefix}' / get_option('bindir'),
'giomoduledir=' + pkgconfig_giomodulesdir,
'gio=' + '${bindir}' / 'gio',
'gio_querymodules=' + pkgconfig_multiarch_bindir / 'gio-querymodules',
'glib_compile_schemas=' + pkgconfig_multiarch_bindir / 'glib-compile-schemas',
'glib_compile_resources=' + '${bindir}' / 'glib-compile-resources',
'gdbus=' + '${bindir}' /'gdbus',
'gdbus_codegen=' + '${bindir}' / 'gdbus-codegen',
'gresource=' + '${bindir}' / 'gresource',
'gsettings=' + '${bindir}' / 'gsettings',
],
version : glib_version,
install_dir : glib_pkgconfigreldir,
filebase : 'gio-2.0',

View File

@@ -1096,4 +1096,72 @@ if installed_tests_enabled
)
endif
if have_bash and have_pkg_config
prefix = get_option('prefix')
if prefix.endswith(':/')
prefix += '/'
endif
pkg_config_tests = [
'pkg-config --validate gio-2.0',
'test "$(pkg-config --modversion gio-2.0)" = "@0@"'.format(glib_version),
'test "$(pkg-config --variable=prefix gio-2.0)" = "@0@"'.format(
get_option('prefix')),
'test "$(pkg-config --variable=datadir gio-2.0)" = "@0@"'.format(
prefix / get_option('datadir')),
'test "$(pkg-config --variable=schemasdir gio-2.0)" = "@0@"'.format(
prefix / get_option('datadir') / schemas_subdir),
'test "$(pkg-config --variable=giomoduledir gio-2.0)" = "@0@"'.format(
get_option('gio_module_dir') != '' ?
prefix / get_option('gio_module_dir') :
prefix / get_option('libdir') / 'gio' / 'modules'),
]
gio_binaries = [
'gio',
'gio-querymodules',
'glib-compile-schemas',
'glib-compile-resources',
'gdbus',
'gdbus-codegen',
'gresource',
'gsettings',
]
foreach binary: gio_binaries
pkg_config_tests += [
'test "$(pkg-config --variable=@0@ gio-2.0)" = "@1@"'.format(
binary.underscorify(),
prefix / get_option('bindir') / binary)
]
endforeach
test('gio-2.0-pkg-config',
bash,
args: [ '-xe', '-c', '\n'.join(pkg_config_tests) ],
suite: ['gio', 'no-valgrind', 'pkg-config'],
env: {
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
},
)
platform_module = host_system == 'windows' ? 'gio-windows-2.0' : 'gio-unix-2.0'
pkg_config_tests = [
'pkg-config --validate ' + platform_module,
'test "$(pkg-config --modversion @0@)" = "@1@"'.format(platform_module,
glib_version),
'test "$(pkg-config --variable=prefix @0@)" = "@1@"'.format(platform_module,
get_option('prefix')),
]
test(platform_module + '-pkg-config',
bash,
args: [ '-xe', '-c', '\n'.join(pkg_config_tests) ],
suite: ['gio', 'no-valgrind', 'pkg-config'],
env: {
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
},
)
endif
subdir('services')