mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
This patch adds support for creating utmp records using the ‘utempter’ helper binary from the ‘libutempter’ package. * New config option ‘main.utempter’ * New meson command line option, -Ddefault-utempter-path. Defaults to auto-detecting the path. The default value of the new ‘main.utempter’ config option depends on the meson command line option ‘-Ddefault-utempter-path’. If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute the utempter helper binary to create utmp records when a new terminal is instantiated. The record is removed when the terminal instance is destroyed.
40 lines
1.1 KiB
Meson
40 lines
1.1 KiB
Meson
sh = find_program('sh', native: true)
|
|
|
|
scdoc_prog = find_program(scdoc.get_variable('scdoc'), native: true)
|
|
|
|
if utempter_path == ''
|
|
default_utempter_value = 'not set'
|
|
else
|
|
default_utempter_value = utempter_path
|
|
endif
|
|
|
|
conf_data = configuration_data(
|
|
{
|
|
'default_terminfo': get_option('default-terminfo'),
|
|
'utempter': default_utempter_value,
|
|
}
|
|
)
|
|
|
|
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
|