[gtk: 1/2] Meson: Use gnome.post_install()




commit 629e70f89dd1c8c4a1b80f0ea67e6e7e4698485c
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Fri Jan 29 18:46:32 2021 -0500

    Meson: Use gnome.post_install()
    
    See https://github.com/mesonbuild/meson/pull/8272 and
    https://github.com/mesonbuild/meson/issues/8268.

 meson.build                       | 21 ++++++++++++++-------
 modules/meson.build               |  1 +
 modules/printbackends/meson.build |  1 +
 tools/meson.build                 |  1 +
 4 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/meson.build b/meson.build
index 145a848a86..a60e061b96 100644
--- a/meson.build
+++ b/meson.build
@@ -798,14 +798,21 @@ subdir('po-properties')
 subdir('docs/tools')
 subdir('docs/reference')
 
-# Keep this in sync with post-install.sh expected arguments
 if not meson.is_cross_build()
-  meson.add_install_script('build-aux/meson/post-install.py',
-                           gtk_api_version,
-                           gtk_binary_version,
-                           gtk_libdir,
-                           gtk_datadir,
-                           gtk_bindir)
+  if meson.version().version_compare('>=0.57.0')
+    gnome.post_install(
+      glib_compile_schemas: true,
+      gio_querymodules: gio_module_dirs,
+      gtk_update_icon_cache: true,
+    )
+  else
+    meson.add_install_script('build-aux/meson/post-install.py',
+                             gtk_api_version,
+                             gtk_binary_version,
+                             gtk_libdir,
+                             gtk_datadir,
+                             gtk_bindir)
+  endif
 else
   message('Not executing post-install steps automatically when cross compiling')
 endif
diff --git a/modules/meson.build b/modules/meson.build
index 614be805f5..4bd67114f8 100644
--- a/modules/meson.build
+++ b/modules/meson.build
@@ -1,3 +1,4 @@
+gio_module_dirs = []
 if os_unix
   subdir('printbackends')
 else
diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build
index fa55d60e3b..833a160747 100644
--- a/modules/printbackends/meson.build
+++ b/modules/printbackends/meson.build
@@ -2,6 +2,7 @@ print_backends = []
 
 printbackends_subdir = 'gtk-4.0/@0@/printbackends'.format(gtk_binary_version)
 printbackends_install_dir = join_paths(get_option('libdir'), printbackends_subdir)
+gio_module_dirs += printbackends_install_dir
 
 printbackends_args = [
   '-DGTK_COMPILATION',
diff --git a/tools/meson.build b/tools/meson.build
index 7b82caf132..1811b6969e 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -51,6 +51,7 @@ foreach tool: gtk_tools
   )
 
   set_variable(tool_name.underscorify(), exe) # used in testsuites
+  meson.override_find_program(tool_name, exe)
 endforeach
 
 # Data to install


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]