File: meson_post_install.py

package info (click to toggle)
pithos 1.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 780 kB
  • sloc: python: 5,256; xml: 107; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3

from compileall import compile_dir
from os import environ, path
from subprocess import call

prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = path.join(prefix, 'share')
destdir = environ.get('DESTDIR', '')

# Package managers set this so we don't need to run
if not destdir:
    print('Updating icon cache...')
    for theme in ('hicolor', 'ubuntu-mono-dark', 'ubuntu-mono-light'):
        call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', theme)])

    print('Compiling GSettings schemas...')
    call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])

print('Compiling python bytecode...')
compile_dir(destdir + path.join(datadir, 'pithos', 'pithos'), optimize=2)