File: meson_post_install.py

package info (click to toggle)
gnome-session 3.32.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,216 kB
  • sloc: ansic: 15,207; xml: 969; sh: 45; python: 18; makefile: 17
file content (26 lines) | stat: -rw-r--r-- 795 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
26
#!/usr/bin/env python3

import os
import shutil
import subprocess
import sys

if os.environ.get('DESTDIR'):
  install_root = os.environ.get('DESTDIR') + os.path.abspath(sys.argv[1])
else:
  install_root = sys.argv[1]

if not os.environ.get('DESTDIR'):
  schemadir = os.path.join(install_root, 'glib-2.0', 'schemas')
  print('Compile gsettings schemas...')
  subprocess.call(['glib-compile-schemas', schemadir])

# FIXME: this is due to unable to copy a generated target file:
#        https://groups.google.com/forum/#!topic/mesonbuild/3iIoYPrN4P0
dst_dir = os.path.join(install_root, 'wayland-sessions')
if not os.path.exists(dst_dir):
  os.makedirs(dst_dir)

src = os.path.join(install_root, 'xsessions', 'gnome.desktop')
dst = os.path.join(dst_dir, 'gnome.desktop')
shutil.copyfile(src, dst)