diff --git a/meson/post_install.py b/meson/post_install.py index f54f6ef..09828fa 100644 --- a/meson/post_install.py +++ b/meson/post_install.py @@ -1,10 +1,17 @@ #!/usr/bin/env python3 -import os +from os import path, environ import subprocess -schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') +prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') +schemadir = path.join(environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') +datadir = path.join(prefix, 'share') +desktop_database_dir = path.join(datadir, 'applications') -if not os.environ.get('DESTDIR'): - print('Compiling gsettings schemas...') -subprocess.call(['glib-compile-schemas', schemadir]) +if not environ.get('DESTDIR'): + print('Compiling gsettings schemas…') + subprocess.call(['glib-compile-schemas', schemadir]) + print('Updating desktop database…') + subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) + print('Updating icon cache…') + subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])