webpin/meson/post_install.py

16 lines
651 B
Python
Raw Permalink Normal View History

2019-04-22 17:58:35 +01:00
#!/usr/bin/env python3
2018-10-11 20:56:34 +01:00
2019-04-18 10:40:17 +01:00
from os import path, environ
2018-10-11 20:56:34 +01:00
import subprocess
2019-04-18 10:40:17 +01:00
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')])