You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.2KB

  1. #!/usr/bin/env python3
  2. import os
  3. import subprocess
  4. import shutil
  5. prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr')
  6. datadir = os.path.join(prefix, 'share')
  7. # Packaging tools define DESTDIR and this isn't needed for them
  8. if 'DESTDIR' not in os.environ:
  9. print('Updating icon cache...')
  10. icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
  11. gtk_update_icon_cache = shutil.which('gtk-update-icon-cache')
  12. if not gtk_update_icon_cache:
  13. gtk_update_icon_cache = shutil.which('gtk-update-icon-cache-3.0')
  14. if not os.path.exists(icon_cache_dir):
  15. os.makedirs(icon_cache_dir)
  16. subprocess.call([gtk_update_icon_cache, '-qtf', icon_cache_dir])
  17. print('Updating desktop database...')
  18. desktop_database_dir = os.path.join(datadir, 'applications')
  19. if not os.path.exists(desktop_database_dir):
  20. os.makedirs(desktop_database_dir)
  21. subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
  22. print('Compiling GSettings schemas...')
  23. schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas')
  24. if not os.path.exists(schemas_dir):
  25. os.makedirs(schemas_dir)
  26. subprocess.call(['glib-compile-schemas', schemas_dir])