postinstall.py 652 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python3
  2. from os import environ, path
  3. from subprocess import call
  4. prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
  5. datadir = path.join(prefix, 'share')
  6. destdir = environ.get('DESTDIR', '')
  7. # Package managers set this so we don't need to run
  8. if not destdir:
  9. print('Updating icon cache...')
  10. call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
  11. print('Updating desktop database...')
  12. call(['update-desktop-database', '-q', path.join(datadir, 'applications')])
  13. print('Compiling GSettings schemas...')
  14. call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])