Skip to content

Commit

Permalink
Improve post_install.py
Browse files Browse the repository at this point in the history
  • Loading branch information
be1 committed Feb 21, 2024
1 parent 8bc1552 commit 4cc55aa
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions meson/post_install.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/usr/bin/env python3

import os
from os import path, environ
import subprocess

schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
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')
desktop_database_dir = path.join(datadir, 'applications')

if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
if not environ.get('DESTDIR'):
print('Compiling gsettings schemas…')
subprocess.call(['glib-compile-schemas', schemadir])
print('Updating desktop database…')
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
print('Updating icon cache…')
subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])

0 comments on commit 4cc55aa

Please sign in to comment.