forked from GNOME/gnome-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson_post_install.py
44 lines (32 loc) · 1.16 KB
/
meson_post_install.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
import glob
import os
import re
import subprocess
import sys
datadir = sys.argv[1]
destdir = os.environ.get('DESTDIR', '')
bindir = os.path.normpath(destdir + os.sep + sys.argv[2])
appid = sys.argv[3];
# FIXME: meson will not track the creation of these files
# https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
if not os.path.exists(bindir):
os.makedirs(bindir)
src = os.path.join(datadir, 'gnome-maps', appid)
dest = os.path.join(bindir, 'gnome-maps')
subprocess.call(['ln', '-s', '-f', src, dest])
if not os.environ.get('DESTDIR'):
icondir = os.path.join(datadir, 'icons', 'hicolor')
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
schemadir = os.path.join(datadir, 'glib-2.0', 'schemas')
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
# FIXME
'''
search_pattern = '/*.desktop'
desktopdir = os.path.join(datadir, 'applications')
print('Validate desktop files...')
[subprocess.call(['desktop-file-validate', file])
for file in glob.glob(desktopdir + search_pattern, recursive=False)]
'''