File: meson_post_install.py

package info (click to toggle)
network-manager-applet 1.36.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 22,512 kB
  • sloc: ansic: 34,599; sh: 5,052; makefile: 535; xml: 43; python: 17; sed: 16
file content (23 lines) | stat: -rw-r--r-- 834 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3

import os
import shutil
import subprocess
import sys

if not os.environ.get('DESTDIR'):
  schemadir = os.path.join(sys.argv[1], '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(sys.argv[2], 'xdg', 'autostart')
src = os.path.join(sys.argv[1], 'applications', 'nm-applet.desktop')
if os.environ.get('DESTDIR'):
  dst_dir = os.environ.get('DESTDIR') + os.path.join(os.getcwd(), dst_dir)
  src = os.environ.get('DESTDIR') + os.path.join(os.getcwd(), src)
if not os.path.exists(dst_dir):
  os.makedirs(dst_dir)
dst = os.path.join(dst_dir, 'nm-applet.desktop')
shutil.copyfile(src, dst)