Use meson gnome module for post install steps v1 APPLIED

Michael Evans: 1
 Use meson gnome module for post install steps

 2 files changed, 7 insertions(+), 24 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~fabrixxm/confy-dev/patches/51824/mbox | git am -3
Learn more about email & git

[PATCH] Use meson gnome module for post install steps Export this patch

The current postinstall script calls gtk-update-icon-cache by name,
which refers to the GTK 3 version of the command. Using meson
gnome.post_install will use gtk4-update-icon-cache when appropriate.

Contributed as a part of the effort to eliminate GTK 3 dependencies from
Nixpkgs (https://github.com/NixOS/nixpkgs/issues/302605).

 build-aux/meson/postinstall.py | 21 ---------------------
 meson.build                    | 10 +++++++---
 2 files changed, 7 insertions(+), 24 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
@@ -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 b2c599f..52de237 100644
--- a/meson.build
+++ b/meson.build
@@ -1,15 +1,19 @@
          version: '0.7.1',
    meson_version: '>= 0.58.0',
    meson_version: '>= 0.59.0',
  default_options: [ 'warning_level=2',

i18n = import('i18n')

gnome = import('gnome')


  glib_compile_schemas: true,
  gtk_update_icon_cache: true,
  update_desktop_database: true,
Merged, thank you!

(I have to do the same on my other projects now :) )