Merge branch 'custom-terminfo-install-location'

Closes #569
This commit is contained in:
Daniel Eklöf 2021-06-24 09:53:09 +02:00
commit ba26d63829
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 45 additions and 7 deletions

View file

@ -69,6 +69,8 @@
* `underline-offset` option to `foot.ini`
(https://codeberg.org/dnkl/foot/issues/490).
* `csd.button-color` option to `foot.ini`.
* `-Dterminfo-install-location=disabled|<custom-path>` meson command
line option (https://codeberg.org/dnkl/foot/issues/569).
### Changed

View file

@ -128,10 +128,34 @@ mkdir -p bld/release && cd bld/release
Available compile-time options:
| Option | Type | Default | Description | Extra dependencies |
|--------------|---------|---------|---------------------|--------------------|
| `-Dime` | bool | `true` | Enables IME support | None |
| `-Dterminfo` | feature | `auto` | Build terminfo | `tic` (ncurses) |
| Option | Type | Default | Description | Extra dependencies |
|-------------------------------|---------|-----------------------|---------------------------------------|--------------------|
| `-Dime` | bool | `true` | Enables IME support | None |
| `-Dterminfo` | feature | `auto` | Build terminfo files | `tic` (ncurses) |
| `-Dterminfo-install-location` | string | `${datadir}/terminfo` | Where to install the terminfo files | None |
The two `terminfo` options are related, but control different aspects
of how the terminfo files are built, installed and used.
`-Dterminfo` controls if the terminfo files should be generated _at
all_. If disabled, foots hardcoded default terminfo is
`xterm-256color` instead of `foot`.
`-Dterminfo-install-location` controls _where_ the terminfo files are
installed, relative to the installation prefix. The default is
`${datadir}/terminfo`.
It also recognizes the special value `disabled`, that prevents the
terminfo files from being _installed_. They are still _built_, and
foots hardcoded default terminfo is still `foot`. It is intended to
be used when the terminfo files are packaged in a separate package
(something I **highly** recommend distros do).
To build the terminfo files manually, run
```sh
tic -x -o <output-directory> -e foot,foot-direct foot.info
```
### Release build

View file

@ -216,13 +216,20 @@ executable(
install: true)
if tic.found()
terminfo_install_location = get_option('terminfo-install-location')
if terminfo_install_location == ''
terminfo_install_location = join_paths(get_option('datadir'), 'terminfo')
endif
custom_target(
'terminfo',
output: 'f',
input: 'foot.info',
command: [tic, '-x', '-o', '@OUTDIR@', '-e', 'foot,foot-direct', '@INPUT@'],
install: true,
install_dir: join_paths(get_option('datadir'), 'terminfo'))
install: terminfo_install_location != 'disabled',
install_dir: terminfo_install_location)
else
terminfo_install_location = 'disabled'
endif
install_data(
@ -240,6 +247,8 @@ subdir('icons')
summary(
{
'IME': get_option('ime'),
'Terminfo': tic.found(),
'Terminfo install location': terminfo_install_location,
},
bool_yn: true
)

View file

@ -1,2 +1,5 @@
option('ime', type: 'boolean', value: true, description: 'IME (Input Method Editor) support')
option('terminfo', type: 'feature', description: 'Install terminfo')
option('terminfo', type: 'feature', description: 'Build terminfo. When disabled, foot\'s terminfo will not be built, and foot will default to \'xterm-256color\' instead of \'foot\'.')
option('terminfo-install-location', type: 'string', description: 'Where to install the foot terminfo files, relative to the installation prefix. If set to \'disabled\', the terminfo files are not installed at all (useful when packaging the terminfo files in a separate package). Defaults to $datadir/terminfo.')