Meson: Use gnome.post_install

Only available on Meson 0.57.0 and later
This commit is contained in:
Luca Bacci 2022-01-14 16:46:22 +01:00
parent 8252f99e08
commit b5d0c44a87
No known key found for this signature in database
GPG Key ID: 8E3C8D989C98883D
5 changed files with 42 additions and 9 deletions

View File

@ -1067,6 +1067,8 @@ install_data('gtkbuilder.loc', 'gtkbuilder.its',
install_dir: join_paths(gtk_datadir, 'gettext/its'))
####### Utils ######
gtk_tools = []
gtk_query_settings = executable(
'gtk-query-settings',
'gtk-query-settings.c',
@ -1074,6 +1076,7 @@ gtk_query_settings = executable(
dependencies: libgtk_dep,
install: true
)
gtk_tools += gtk_query_settings
gtk_builder_tool = executable(
'gtk-builder-tool',
@ -1082,6 +1085,7 @@ gtk_builder_tool = executable(
dependencies: libgtk_dep,
install: true
)
gtk_tools += gtk_builder_tool
extra_update_icon_cache_objs = []
if win32_enabled
@ -1113,8 +1117,9 @@ gtk_update_icon_cache = executable(
dependencies: libgtk_dep,
install: true
)
gtk_tools += gtk_update_icon_cache
gtk_query_immodules = executable(
gtk_query_immodules = executable(
'gtk-query-immodules-3.0',
'queryimmodules.c',
'gtkutils.c',
@ -1122,6 +1127,7 @@ gtk_update_icon_cache = executable(
dependencies: libgtk_dep,
install: true
)
gtk_tools += gtk_query_immodules
gtk_encode_symbolic_svg = executable(
'gtk-encode-symbolic-svg',
@ -1130,6 +1136,7 @@ gtk_encode_symbolic_svg = executable(
dependencies: libgtk_dep,
install: true
)
gtk_tools += gtk_encode_symbolic_svg
gtk_launch = executable(
'gtk-launch',
@ -1138,3 +1145,10 @@ gtk_launch = executable(
dependencies: libgtk_dep,
install: true
)
gtk_tools += gtk_launch
if meson.version().version_compare('>=0.54.0')
foreach tool: gtk_tools
meson.override_find_program(tool.name(), tool)
endforeach
endif

View File

@ -1008,13 +1008,25 @@ subdir('docs/reference')
install_data('m4macros/gtk-3.0.m4', install_dir: join_paths(get_option('datadir'), 'aclocal'))
# Keep this in sync with post-install.py expected arguments
meson.add_install_script('build-aux/meson/post-install.py',
gtk_api_version,
gtk_binary_version,
join_paths(gtk_prefix, get_option('bindir')),
gtk_libdir,
gtk_datadir)
if not meson.is_cross_build()
if meson.version().version_compare('>=0.57.0')
gnome.post_install(
glib_compile_schemas: true,
gio_querymodules: gio_module_dirs,
gtk_update_icon_cache: get_option('demos'),
)
else
# Keep this in sync with post-install.py expected arguments
meson.add_install_script('build-aux/meson/post-install.py',
gtk_api_version,
gtk_binary_version,
join_paths(gtk_prefix, get_option('bindir')),
gtk_libdir,
gtk_datadir)
endif
else
message('Not executing post-install steps automatically when cross compiling')
endif
if host_machine.system() != 'windows'
# Install Valgrind suppression files (except on Windows,

View File

@ -1,6 +1,9 @@
# Note: the list of immodules is in $(srcroot)/meson.build!
immodules_install_dir = '@0@/gtk-@1@/@2@/immodules/'.format(gtk_libdir, gtk_api_version, gtk_binary_version)
gio_module_dirs += immodules_install_dir
foreach l: immodules
name = l[0]
immod_sources = l[1]
@ -12,7 +15,7 @@ foreach l: immodules
immod_sources,
c_args: common_cflags + cflags,
dependencies: [ libgtk_dep ],
install_dir: '@0@/gtk-@1@/@2@/immodules/'.format(gtk_libdir, gtk_api_version, gtk_binary_version),
install_dir: immodules_install_dir,
include_directories: [confinc, gtkinc],
install : true,
name_suffix: module_suffix,

View File

@ -1,2 +1,4 @@
gio_module_dirs = []
subdir('input')
subdir('printbackends')

View File

@ -95,6 +95,8 @@ printbackends_args = [
printbackends_subdir = 'gtk-3.0/@0@/printbackends'.format(gtk_binary_version)
printbackends_install_dir = join_paths(get_option('libdir'), printbackends_subdir)
gio_module_dirs += printbackends_install_dir
if print_backends.contains('file')
shared_module('printbackend-file',
'file/gtkprintbackendfile.c',