build: Add post-install script to update caches

Update the desktop, schema and icon caches.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #9
This commit is contained in:
Philip Withnall 2020-02-19 13:58:09 +00:00
parent b4eab1a7c0
commit eef28da339
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
install_prefix = os.environ['MESON_INSTALL_PREFIX']
schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas…')
subprocess.call(['glib-compile-schemas', schemadir])
print('Updating icon cache…')
icon_cache_dir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
print('Updating desktop database…')
desktop_database_dir = os.path.join(install_prefix, 'share', 'applications')
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])

View File

@ -133,3 +133,5 @@ subdir('malcontent-client')
subdir('malcontent-control') subdir('malcontent-control')
subdir('pam') subdir('pam')
subdir('po') subdir('po')
meson.add_install_script('build-aux/meson_post_install.py')