script: add generate-builtin-terminfo.py

This script parses a terminfo source file and generates a C header
file with a static struct containing terminfo names and their values.

The table is sorted on the capability names
This commit is contained in:
Daniel Eklöf 2022-01-02 11:06:09 +01:00
parent 467e4f2ef8
commit b8fc56ecb4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 213 additions and 1 deletions

View file

@ -136,6 +136,16 @@ version = custom_target(
output: 'version.h',
command: [env, 'LC_ALL=C', generate_version_sh, meson.project_version(), '@CURRENT_SOURCE_DIR@', '@OUTPUT@'])
python = find_program('python3', native: true)
generate_builtin_terminfo_py = files('scripts/generate-builtin-terminfo.py')
foot_terminfo = files('foot.info')
builtin_terminfo = custom_target(
'generate_builtin_terminfo',
output: 'foot-terminfo.h',
command: [python, generate_builtin_terminfo_py,
'@default_terminfo@', foot_terminfo, 'foot', '@OUTPUT@']
)
common = static_library(
'common',
'log.c', 'log.h',
@ -213,7 +223,7 @@ executable(
'url-mode.c', 'url-mode.h',
'user-notification.c', 'user-notification.h',
'wayland.c', 'wayland.h',
wl_proto_src + wl_proto_headers, version,
builtin_terminfo, wl_proto_src + wl_proto_headers, version,
dependencies: [math, threads, libepoll, pixman, wayland_client, wayland_cursor, xkb, fontconfig, utf8proc,
tllist, fcft],
link_with: pgolib,