parent
b19f927f96
commit
4fc6189a32
5 changed files with 92 additions and 11 deletions
@ -0,0 +1,14 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import io, os, re, sys |
||||
|
||||
if len (sys.argv) < 3: |
||||
sys.exit("usage: gen-harfbuzzcc.py harfbuzz.def hb-blob.cc hb-buffer.cc ...") |
||||
|
||||
output_file = sys.argv[1] |
||||
source_paths = sys.argv[2:] |
||||
|
||||
with open (output_file, "wb") as f: |
||||
f.write ("".join ('#include "{}"\n'.format (x) |
||||
for x in source_paths |
||||
if x.endswith (".cc")).encode ()) |
@ -0,0 +1,19 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import io, os, re, sys |
||||
|
||||
if len (sys.argv) < 4: |
||||
sys.exit("usage: gen-hb-version.py 1.0.0 hb-version.h.in hb-version.h") |
||||
|
||||
version = sys.argv[1] |
||||
major, minor, micro = version.split (".") |
||||
input = sys.argv[2] |
||||
output = sys.argv[3] |
||||
|
||||
with open (output, "wb") as output_file, open (input, "r") as input_file: |
||||
output_file.write (input_file.read () |
||||
.replace ("@HB_VERSION_MAJOR@", major) |
||||
.replace ("@HB_VERSION_MINOR@", minor) |
||||
.replace ("@HB_VERSION_MICRO@", micro) |
||||
.replace ("@HB_VERSION@", version) |
||||
.encode ()) |
@ -0,0 +1,22 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import io, os, re, sys, subprocess, shutil |
||||
|
||||
if len (sys.argv) < 3: |
||||
ragel_sources = [x for x in os.listdir ('.') if x.endswith ('.rl')] |
||||
else: |
||||
os.chdir(sys.argv[1]) |
||||
ragel_sources = sys.argv[2:] |
||||
|
||||
ragel = shutil.which ('ragel') |
||||
|
||||
if not ragel: |
||||
print ('You have to install ragel if you are going to develop HarfBuzz itself') |
||||
exit (1) |
||||
|
||||
if not len (ragel_sources): |
||||
exit (77) |
||||
|
||||
for rl in ragel_sources: |
||||
hh = rl.replace ('.rl', '.hh') |
||||
subprocess.Popen ([ragel, '-e', '-F1', '-o', hh, rl]).wait () |
Loading…
Reference in new issue