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])
# FIXME: meson will not track the creation of these files
# https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
apps = [
['org.gnome.Documents', 'gnome-documents']
]
if not os.path.exists(bindir):
os.makedirs(bindir)
for app in apps:
src = os.path.join(datadir, 'gnome-documents', app[0])
dest = os.path.join(bindir, app[1])
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])
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)]
|