File: meson_post_install.py

package info (click to toggle)
gnome-2048 3.38.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,056 kB
  • sloc: xml: 70; python: 18; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 654 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
22
23
24
25
#!/usr/bin/env python3

import os
import subprocess
import sys


if len(sys.argv) < 3:
  sys.exit("usage: meson_post_install.py <icondir> <schemadir>")

icon_cache_dir = sys.argv[1]
schemadir = sys.argv[2]

if not os.environ.get('DESTDIR'):
  print('Updating icon cache...')
  if not os.path.exists(icon_cache_dir):
    os.makedirs(icon_cache_dir)
  subprocess.call(['gtk-update-icon-cache',
                   '--quiet', '--force', '--ignore-theme-index',
                   icon_cache_dir])

  print('Compiling GSettings schemas...')
  if not os.path.exists(schemadir):
    os.makedirs(schemadir)
  subprocess.call(['glib-compile-schemas', schemadir])