[gnome-maps/wip/jtojnar/fix-build: 3/4] build: Use gnome.post_install() and install_symlink()




commit cbb6cddb264a0c1f4a6d4b6b8d3310510261ee3c
Author: Jan Tojnar <jtojnar gmail com>
Date:   Tue Sep 6 22:35:54 2022 +0200

    build: Use gnome.post_install() and install_symlink()
    
    The custom install script still depended on GTK 3.
    Instead of updating it, let’s just use Meson’s purpose-built functions.
    
    The FIXME in the install script was already resolved by
    https://gitlab.gnome.org/GNOME/gnome-maps/commit/7ed2ff45342bda73244c7675677ab1d63e4527eb
    
    Also let’s run `update-desktop-database` since we install a desktop file.
    
    This requires Meson 0.59 for `post_install`’s `update_desktop_database` kwarg,
    and Meson 0.61 for `install_symlink`.

 meson.build           | 10 +++++-----
 meson_post_install.py | 44 --------------------------------------------
 src/meson.build       |  6 ++++++
 3 files changed, 11 insertions(+), 49 deletions(-)
---
diff --git a/meson.build b/meson.build
index 93830388..f5a5e945 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,7 @@
 project('gnome-maps', 'c',
        version: '43.0',
        license: 'GPL-2.0-or-later',
+       meson_version: '>= 0.61.0',
 )
 
 app_id = 'org.gnome.Maps'
@@ -61,9 +62,8 @@ subdir('lib')
 subdir('data')
 subdir('tests')
 
-meson.add_install_script(
-  'meson_post_install.py',
-  datadir,
-  bindir,
-  app_id
+gnome.post_install(
+  glib_compile_schemas: true,
+  gtk_update_icon_cache: true,
+  update_desktop_database: true,
 )
diff --git a/src/meson.build b/src/meson.build
index 5ac721b4..25ec53b0 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -21,6 +21,12 @@ configure_file(
        install_dir: pkgdatadir
 )
 
+install_symlink(
+       'gnome-maps',
+       install_dir: bindir,
+       pointing_to: pkgdatadir / app_id,
+)
+
 sources_conf = configuration_data()
 sources_conf.set('suffix', suffix)
 # comment-out test sources


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