diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/harfbuzz/src/gen-def.py | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/harfbuzz/src/gen-def.py')
-rwxr-xr-x | gfx/harfbuzz/src/gen-def.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gfx/harfbuzz/src/gen-def.py b/gfx/harfbuzz/src/gen-def.py new file mode 100755 index 0000000000..aa6dcd95fb --- /dev/null +++ b/gfx/harfbuzz/src/gen-def.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +"usage: gen-def.py harfbuzz.def hb.h [hb-blob.h hb-buffer.h ...]" + +import os, re, sys + +if len (sys.argv) < 3: + sys.exit(__doc__) + +output_file = sys.argv[1] +header_paths = sys.argv[2:] + +headers_content = [] +for h in header_paths: + if h.endswith (".h"): + with open (h, encoding='utf-8') as f: headers_content.append (f.read ()) + +symbols = sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M)) +if '--experimental-api' not in sys.argv: + # Move these to harfbuzz-sections.txt when got stable + experimental_symbols = \ +"""hb_font_draw_glyph +hb_draw_funcs_t +hb_draw_close_path_func_t +hb_draw_cubic_to_func_t +hb_draw_line_to_func_t +hb_draw_move_to_func_t +hb_draw_quadratic_to_func_t +hb_draw_funcs_create +hb_draw_funcs_destroy +hb_draw_funcs_is_immutable +hb_draw_funcs_make_immutable +hb_draw_funcs_reference +hb_draw_funcs_set_close_path_func +hb_draw_funcs_set_cubic_to_func +hb_draw_funcs_set_line_to_func +hb_draw_funcs_set_move_to_func +hb_draw_funcs_set_quadratic_to_func +hb_style_get_value +hb_font_get_var_coords_design""".splitlines () + symbols = [x for x in symbols if x not in experimental_symbols] +symbols = "\n".join (symbols) + +result = symbols if os.getenv ('PLAIN_LIST', '') else """EXPORTS +%s +LIBRARY lib%s-0.dll""" % (symbols, output_file.replace ('src/', '').replace ('.def', '')) + +with open (output_file, "w") as f: f.write (result) |