mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-10 04:27:45 -05:00
This patch generalizes the utmp support, to not only support libutempter, but also ulog (and in the future, even more interfaces). * Rename config option main.utempter to main.utmp-helper * Add meson option -Dutmp-backend=none|libutempter|ulog|auto * Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path * utmp is no longer detected at compile time, but at runtime instead. Meson will configure the following pre-processor macros, based on the selected utmp backend: * UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot) * UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot) * UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY) * UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary The documentation has been updated to mention which arguments are passed to the helper binary. Closes #1314
50 lines
1.5 KiB
Meson
50 lines
1.5 KiB
Meson
sh = find_program('sh', native: true)
|
|
|
|
scdoc_prog = find_program(scdoc.get_variable('scdoc'), native: true)
|
|
|
|
if utmp_backend != 'none'
|
|
utmp_add_args = '@0@ $WAYLAND_DISPLAY'.format(utmp_add)
|
|
utmp_del_args = (utmp_del_have_argument
|
|
? '@0@ $WAYLAND_DISPLAY'.format(utmp_del)
|
|
: '@0@'.format(utmp_del))
|
|
utmp_path = utmp_default_helper_path
|
|
else
|
|
utmp_add_args = '<no utmp support in foot>'
|
|
utmp_del_args = '<no utmp support in foot>'
|
|
utmp_path = 'none'
|
|
endif
|
|
|
|
|
|
conf_data = configuration_data(
|
|
{
|
|
'default_terminfo': get_option('default-terminfo'),
|
|
'utmp_backend': utmp_backend,
|
|
'utmp_add_args': utmp_add_args,
|
|
'utmp_del_args': utmp_del_args,
|
|
'utmp_helper_path': utmp_path,
|
|
}
|
|
)
|
|
|
|
foreach man_src : [{'name': 'foot', 'section' : 1},
|
|
{'name': 'foot.ini', 'section': 5},
|
|
{'name': 'footclient', 'section': 1},
|
|
{'name': 'foot-ctlseqs', 'section': 7}]
|
|
name = man_src['name']
|
|
section = man_src['section']
|
|
out = '@0@.@1@'.format(name, section)
|
|
|
|
preprocessed = configure_file(
|
|
input: '@0@.@1@.scd'.format(name, section),
|
|
output: '@0@.preprocessed'.format(out),
|
|
configuration: conf_data,
|
|
)
|
|
|
|
custom_target(
|
|
out,
|
|
output: out,
|
|
input: preprocessed,
|
|
command: [sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.full_path())],
|
|
capture: true,
|
|
install: true,
|
|
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(section)))
|
|
endforeach
|