mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
terminfo: install to $datadir/foot/terminfo by default, append to TERMINFO_DIRS
As of 2021-07-31, ncurses ships its own version of foot’s terminfo. Since: * It doesn’t have the non-standard Sync,Tc,setrgbf,setrgbb capabilities. * It doesn’t set hs,fsl,dsl (statusbar). * We want to be able to update our termminfo without waiting for an ncurses release. * Foot should be installable and usable on Linux systems that doesn’t have the latest ncurses. we still want to ship our own version. We can however not install it to the default terminfo location (e.g. /usr/share/terminfo), since it will collide with the ncurses provided files. Our options are to either rename our terminfo to something else, or to keep the name, but install our terminfo files somewhere else. The first option would be the easy one. However, I think it makes sense to use the same name. For example, a user that SSH’s into a remote system that does *not* have our own version installed, but *does* have the ncurses one, will gracefully fall back to that one, which is better than manually having to set e.g. TERM=xterm-256color. Now, if we want to use the same name, we need to install it somewhere else. But where? And how do we ensure our version is preferred over the ncurses one? I opted to $datadir/foot/terminfo (e.g. /usr/share/foot/terminfo) by default. It makes it namespaced to foot (i.e. we’re not introducing a new “standard” terminfo location), thus guaranteeing it wont collide with ncurses. To enable applications to find it, we export TERMINFO_DIRS. This is a list of *additional* directories to search for terminfo files. If it’s already defined, we *append* to it. The nice thing with this is, if there’s no terminfo in that location (e.g. when you SSH into a remote), the default terminfo location is *also* searched. But only *after* having searched through TERMINFO_DIRS. In short: our version is preferred, but the ncurses one (or an older version of our terminfo package!) will be used if ours cannot be found. To enable packagers full control over the new behavior, the existing meson command line options have been modified, and a new option added: -Dterminfo=disabled|enabled|auto: *build* and *install* the terminfo files. -Dcustom-terminfo-install-location=<path>: *where* the terminfo files are expected to be found. This *needs* to be set *even* if -Dterminfo=disabled. For example, if the packaging script builds and packages the terminfo files separate from the regular foot build. The path is *relative to $prefix*, and defaults to $datadir/foot/terminfo. This is the value that will be appended to TERMINFO_DIRS. Note that you can set it to ‘no’, in which case foot will *not* set/modify TERMINFO_DIRS. Only do this if you don’t intend to package foot’s terminfo files at all (i.e. you plan on using the ncurses ones only). -Ddefault-terminfo=foot. Allows overriding the default TERM value. This should only be changed if the target platform doesn’t support terminfo files. Closes #671
This commit is contained in:
parent
b4402a6aa5
commit
7639186865
14 changed files with 191 additions and 81 deletions
|
|
@ -57,7 +57,7 @@ the foot command line
|
|||
|
||||
*-t*,*--term*=_TERM_
|
||||
Value to set the environment variable *TERM* to (see *TERMINFO*
|
||||
and *ENVIRONMENT*). Default: _foot_.
|
||||
and *ENVIRONMENT*). Default: _@default_terminfo@_.
|
||||
|
||||
*-T*,*--title*=_TITLE_
|
||||
Initial window title. Default: _foot_.
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ in this order:
|
|||
by prepending a '-' to argv[0]. Default: _no_.
|
||||
|
||||
*term*
|
||||
Value to set the environment variable *TERM* to. Default: _foot_
|
||||
or _xterm-256color_ if built with _-Dterminfo=disabled_
|
||||
Value to set the environment variable *TERM* to. Default:
|
||||
_@default_terminfo@_
|
||||
|
||||
*font*, *font-bold*, *font-italic*, *font-bold-italic*
|
||||
Comma separated list of fonts to use, in fontconfig format. That
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ terminal has terminated.
|
|||
|
||||
*-t*,*--term*=_TERM_
|
||||
Value to set the environment variable *TERM* to (see *TERMINFO*
|
||||
and *ENVIRONMENT*). Default: _foot_.
|
||||
and *ENVIRONMENT*). Default: _@default_terminfo@_.
|
||||
|
||||
*-T*,*--title*=_TITLE_
|
||||
Initial window title. Default: _foot_.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@ sh = find_program('sh', native: true)
|
|||
|
||||
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
||||
|
||||
conf_data = configuration_data(
|
||||
{
|
||||
'default_terminfo': get_option('default-terminfo'),
|
||||
}
|
||||
)
|
||||
|
||||
foreach man_src : [{'name': 'foot', 'section' : 1},
|
||||
{'name': 'foot.ini', 'section': 5},
|
||||
{'name': 'footclient', 'section': 1},
|
||||
|
|
@ -10,10 +16,16 @@ foreach man_src : [{'name': 'foot', 'section' : 1},
|
|||
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: '@0@.@1@.scd'.format(name, section),
|
||||
input: preprocessed,
|
||||
command: [sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.path())],
|
||||
capture: true,
|
||||
install: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue