From 38c00cc2ecd7ca2a18e2824118c258b378aacb66 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 4 Aug 2022 23:49:20 -0400 Subject: [PATCH] build: Use gnome.post_install() Allows us to remove the custom postinstall.py script. --- build-aux/meson/postinstall.py | 21 --------------------- meson.build | 8 ++++++-- 2 files changed, 6 insertions(+), 23 deletions(-) delete mode 100755 build-aux/meson/postinstall.py diff --git a/build-aux/meson/postinstall.py b/build-aux/meson/postinstall.py deleted file mode 100755 index 6a3ea97..0000000 --- a/build-aux/meson/postinstall.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -from os import environ, path -from subprocess import call - -prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') -datadir = path.join(prefix, 'share') -destdir = environ.get('DESTDIR', '') - -# Package managers set this so we don't need to run -if not destdir: - print('Updating icon cache...') - call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) - - print('Updating desktop database...') - call(['update-desktop-database', '-q', path.join(datadir, 'applications')]) - - print('Compiling GSettings schemas...') - call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) - - diff --git a/meson.build b/meson.build index 5cd38b1..d106943 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('loupe', 'rust', version: '42.alpha', - meson_version: '>= 0.50.0', + meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', ], ) @@ -59,4 +59,8 @@ if get_option('profile') == 'development' run_command('cp', '-f', 'hooks/pre-commit.hook', '.git/hooks/pre-commit') endif -meson.add_install_script('build-aux/meson/postinstall.py') +gnome.post_install( + gtk_update_icon_cache: true, + glib_compile_schemas: true, + update_desktop_database: true, +)