comparison mupdf-source/thirdparty/harfbuzz/src/gen-ragel-artifacts.py @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
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))