From 6268fc536b99d8594c3d48ad5473e9a411e75b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 23 Jun 2021 16:43:36 +0200 Subject: [PATCH 1/3] meson: add -Dterminfo-install-location=disabled|custom-path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new meson option, ‘terminfo-install-location’, that allows you to customize _where_ the terminfo files are installed, relative to the installation prefix. It also recognizes the special value ‘disabled’, in which case the terminfo files are not installed at all. The terminfo files _are_ however built (allowing us to catch build errors), and foot still defaults to the ‘foot’ terminfo. It defaults to $datadir/terminfo If (the other option) ‘terminfo’ is set to disabled (or tic cannot be found), terminfo-install-location is automatically set to ‘disabled’. --- meson.build | 13 +++++++++++-- meson_options.txt | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 479f5747..14d23975 100644 --- a/meson.build +++ b/meson.build @@ -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 ) diff --git a/meson_options.txt b/meson_options.txt index b21bc7a4..52625b8d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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.') From 501548080d4752b22b650ac9ec82ac5e9d6d9610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 23 Jun 2021 16:55:26 +0200 Subject: [PATCH 2/3] =?UTF-8?q?install:=20add=20the=20new=20=E2=80=98termi?= =?UTF-8?q?nfo-install-location=E2=80=99=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And flesh out the description of the ‘terminfo’ option, and how it relates to the new ‘terminfo-install-location’. Also add instructions on how to manually generate the terminfo files. --- INSTALL.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 1f0abf6a..8ef3cac1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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, foot’s 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 +foot’s 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 -e foot,foot-direct foot.info +``` ### Release build From 07bb67130a5661640d07475684beed28ceda984f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 23 Jun 2021 16:58:10 +0200 Subject: [PATCH 3/3] changelog: -Dterminfo-install-location meson command line option --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 208f0f04..b8e7f333 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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|` meson command + line option (https://codeberg.org/dnkl/foot/issues/569). ### Changed