easyssh/meson/post_install.py

25 lines
910 B
Python
Raw Normal View History

2018-04-18 23:29:56 +08:00
#!/usr/bin/env python3
import os
import subprocess
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = os.path.join(prefix, 'share')
2018-12-19 20:52:05 +08:00
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
2018-04-18 23:29:56 +08:00
2018-12-19 20:52:05 +08:00
if not os.environ.get('DESTDIR'):
2018-04-18 23:29:56 +08:00
print('Updating icon cache...')
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
if not os.path.exists(icon_cache_dir):
os.makedirs(icon_cache_dir)
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
print('Updating desktop database...')
desktop_database_dir = os.path.join(datadir, 'applications')
if not os.path.exists(desktop_database_dir):
os.makedirs(desktop_database_dir)
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
2018-12-19 20:52:05 +08:00
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])