File: meson_post_install.py

package info (click to toggle)
d-feet 0.3.15-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 944 kB
  • sloc: python: 1,381; makefile: 16; xml: 4
file content (24 lines) | stat: -rw-r--r-- 767 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3

import os
import subprocess
import sys

if not os.environ.get('DESTDIR'):
    prefix = os.environ['MESON_INSTALL_PREFIX']

    icondir = os.path.join(prefix, sys.argv[1], 'icons', 'hicolor')
    print('Updating icon cache...')
    subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])

    print('Compiling gsettings schemas...')
    subprocess.call(['glib-compile-schemas', sys.argv[2]])

    python = sys.argv[3]
    pythondir = os.path.join(prefix, sys.argv[4])

    print('Byte-compiling python modules...')
    subprocess.call([python, '-m', 'compileall', '-f', '-q', pythondir])

    print('Byte-compiling python modules (optimized versions) ...')
    subprocess.call([python, '-O', '-m', 'compileall', '-f', '-q', pythondir])