File: update.py

package info (click to toggle)
harfbuzz 12.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 100,084 kB
  • sloc: ansic: 77,785; cpp: 61,949; python: 4,961; xml: 4,651; sh: 426; makefile: 105
file content (29 lines) | stat: -rwxr-xr-x 1,044 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
24
25
26
27
28
29
#!/usr/bin/env python3

import sys, os, subprocess, shutil

os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))

git = shutil.which ('git'); assert git
make = shutil.which ('make'); assert make
java = shutil.which ('java'); assert java
cxx = shutil.which ('c++'); assert cxx

pull = False
if not os.path.exists ('aots'):
	subprocess.run ([git, 'clone', 'https://github.com/adobe-type-tools/aots'], check=True)
	pull = True

if pull or 'pull' in sys.argv:
	subprocess.run ([git, 'pull'], cwd='aots', check=True)
	subprocess.run ([make, '-C', 'aots'], check=True)
	subprocess.run ([make, '-C', 'aots/harfbuzz'], check=True)

shutil.copy ('hb-aots-tester.cpp', 'aots/harfbuzz')
# TODO: remove *nix assumptions
subprocess.run ([cxx, '-std=c++11', '-Wno-narrowing', 'aots/harfbuzz/hb-aots-tester.cpp',
	'../../../../src/harfbuzz.cc', '-DHB_NO_MT', '-fno-exceptions', '-lm',
	'-I../../../../src', '-o', 'aots/harfbuzz/aots'], check=True)
shutil.rmtree ('tests')
os.mkdir ('tests')
subprocess.run (['./aots'], cwd='aots/harfbuzz', check=True)