File: meson_vapi_link.py

package info (click to toggle)
libgit2-glib 0.99.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,692 kB
  • sloc: ansic: 17,155; python: 1,989; makefile: 21; sh: 7
file content (28 lines) | stat: -rwxr-xr-x 681 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
27
28
#!/usr/bin/env python3

import os
import shutil
import sys

datadir = sys.argv[1]

destdir = os.environ.get('DESTDIR')
if destdir:
    datadir = os.path.splitdrive(datadir)[1].lstrip(os.path.sep)
    datadir = os.path.join(destdir, datadir)

vapidir = os.path.join(datadir, 'vala', 'vapi')
os.chdir(vapidir)

# FIXME: meson will not track the creation of these files
#        https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
old = 'ggit-1.0'
new = 'libgit2-glib-1.0'

for ext in ['vapi', 'deps']:
  src = '{}.{}'.format(new, ext)
  dest = '{}.{}'.format(old, ext)
  try:
      os.symlink(src, dest)
  except OSError:
      shutil.copy(src, dest)