[gnome-sound-recorder/ebassi/build-back-better: 5/5] build: Use gnome.post_install()




commit 16f76bb39c31f733d27af47e58fa4aeddc5504f3
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Aug 15 17:21:50 2022 +0100

    build: Use gnome.post_install()
    
    Instead of coding the post-installation bits for schemas, desktop/MIME
    entries, and icon cache, we can use the GNOME module inside Meson, which
    will check the binaries we depend on, and will do a better job at
    keeping up to date.

 build-aux/meson_post_install.py | 10 ----------
 meson.build                     | 10 ++++++++--
 2 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py
index 6c4855b..3f78a49 100755
--- a/build-aux/meson_post_install.py
+++ b/build-aux/meson_post_install.py
@@ -16,13 +16,3 @@ if not os.path.exists(bindir):
 src = os.path.join(pkgdatadir, application_id)
 dest = os.path.join(bindir, 'gnome-sound-recorder')
 subprocess.call(['ln', '-s', '-f', src, dest])
-
-if not os.environ.get('DESTDIR'):
-    print('Compiling gsettings schemas...')
-    subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0', 'schemas')])
-
-    print('Updating icon cache...')
-    subprocess.call(['gtk-update-icon-cache', '-qtf', os.path.join(datadir, 'icons', 'hicolor')])
-
-    print('Updating desktop database...')
-    subprocess.call(['update-desktop-database', '-q', os.path.join(datadir, 'applications')])
diff --git a/meson.build b/meson.build
index 66932e9..c862661 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project(
   'gnome-sound-recorder',
   version: '43.beta',
   license: 'GPL2+',
-  meson_version: '>= 0.56.0'
+  meson_version: '>= 0.59.0',
 )
 
 if get_option('profile') == 'development'
@@ -53,10 +53,16 @@ subdir('data')
 subdir('src')
 subdir('po')
 
+gnome.post_install(
+  glib_compile_schemas: true,
+  gtk_update_icon_cache: true,
+  update_desktop_database: true,
+)
+
 meson.add_install_script(
   'build-aux' / 'meson_post_install.py',
   sound_recorder_datadir,
   sound_recorder_bindir,
   sound_recorder_pkgdatadir,
-  application_id
+  application_id,
 )


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