diff --git a/build-aux/meson/postinstall.py b/build-aux/meson/postinstall.py deleted file mode 100644 index bd76f1a..0000000 --- a/build-aux/meson/postinstall.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -from os import environ, path -from subprocess import call - -# Package managers set this, so we don't need to run -if not environ.get('DESTDIR', ''): - prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') - datadir = path.join(prefix, 'share') - - print('Updating icon cache...') - call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) - - print('Updating desktop database...') - call(['update-desktop-database', path.join(datadir, 'applications')]) - - print('Compiling schemas...') - call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) diff --git a/meson.build b/meson.build index a978d7d..dfc72fa 100644 --- a/meson.build +++ b/meson.build @@ -137,4 +137,14 @@ subdir('plugins') subdir('doc') subdir('data') -meson.add_install_script('build-aux/meson/postinstall.py') +# gnome.post_install() is available since meson 0.59.0 +# Distributions use their own tooling (e.g. postinst, triggers, etc) +# so it is okay if the post_install() is not run on distro builds +m_ver = meson.version().split('.') +if m_ver[0].to_int() > 0 or m_ver[1].to_int() > 58 + gnome.post_install( + glib_compile_schemas: true, + gtk_update_icon_cache: true, + update_desktop_database: true, + ) +endif