webpin/meson/post_install.py
2019-04-22 18:58:35 +02:00

16 lines
651 B
Python
Executable file

#!/usr/bin/env python3
from os import path, environ
import subprocess
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')
if not environ.get('DESTDIR'):
print('Compiling gsettings schemas…')
subprocess.call(['glib-compile-schemas', schemadir])
print('Updating icon cache…')
subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
print('Updating desktop database…')
subprocess.call(['update-desktop-database', '-q', path.join(datadir, 'applications')])