Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/harfbuzz/src/gen-ragel-artifacts.py @ 3:2c135c81b16c
MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:44:09 +0200 |
| parents | b50eed0cc0ef |
| children |
comparison
equal
deleted
inserted
replaced
| 0:6015a75abc2d | 3:2c135c81b16c |
|---|---|
| 1 #!/usr/bin/env python3 | |
| 2 | |
| 3 "This tool is intended to be used from meson" | |
| 4 | |
| 5 import os, os.path, sys, subprocess, shutil | |
| 6 | |
| 7 ragel = sys.argv[1] | |
| 8 if not ragel: | |
| 9 sys.exit ('You have to install ragel if you are going to develop HarfBuzz itself') | |
| 10 | |
| 11 if len (sys.argv) < 4: | |
| 12 sys.exit (__doc__) | |
| 13 | |
| 14 OUTPUT = sys.argv[2] | |
| 15 CURRENT_SOURCE_DIR = sys.argv[3] | |
| 16 INPUT = sys.argv[4] | |
| 17 | |
| 18 outdir = os.path.dirname (OUTPUT) | |
| 19 shutil.copy (INPUT, outdir) | |
| 20 rl = os.path.basename (INPUT) | |
| 21 hh = rl.replace ('.rl', '.hh') | |
| 22 subprocess.Popen (ragel.split() + ['-e', '-F1', '-o', hh, rl], cwd=outdir).wait () | |
| 23 | |
| 24 # copy it also to src/ | |
| 25 shutil.copyfile (os.path.join (outdir, hh), os.path.join (CURRENT_SOURCE_DIR, hh)) |
