From 9434066546a8409117083bd64ad43f97a3a236e2 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 29 Aug 2021 11:06:45 +0200 Subject: meson: terminfo install location now defaults to $datadir/terminfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The meson command line option -Dcustom-terminfo-install-location has been changed in the following ways: * If unset, $datadir/terminfo is used, and TERMINFO is *not* exported * If set, that value (relative to $prefix) is used, and TERMINFO *is* exported. * The special value ‘no’ is removed. -Ddefault-terminfo now also changes the terminfo names generated when -Dterminfo=enabled. Furthermore, the documentation for the TERMINFO environment variable has been removed from the foot.1 and footclient.1 man pages (but as mentioned above, foot *will* still set it if -Dcustom-terminfo-install-location has been used). INSTALL.md has been updated to now recommend using ncurses’ terminfo definitions, if available. But also to document the other alternatives; installing the terminfo definitions in a custom location, or installing them with a diferent name. It also describes the general problem, and the disadvantages of each alternative (but without going into too much depth). --- meson.build | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index d9762f91..81dc9006 100644 --- a/meson.build +++ b/meson.build @@ -35,17 +35,15 @@ add_project_arguments( language: 'c', ) -default_terminfo_install_location = join_paths(get_option('datadir'), 'foot', 'terminfo') terminfo_install_location = get_option('custom-terminfo-install-location') -if terminfo_install_location == '' - terminfo_install_location = default_terminfo_install_location -endif -if terminfo_install_location != 'no' +if terminfo_install_location != '' add_project_arguments( ['-DFOOT_TERMINFO_PATH="@0@"'.format( join_paths(get_option('prefix'), terminfo_install_location))], language: 'c') +else + terminfo_install_location = join_paths(get_option('datadir'), 'terminfo') endif # Compute the relative path used by compiler invocations. @@ -246,15 +244,24 @@ endif tic = find_program('tic', native: true, required: get_option('terminfo')) if tic.found() + conf_data = configuration_data( + { + 'default_terminfo': get_option('default-terminfo'), + } + ) + + preprocessed = configure_file( + input: 'foot.info', + output: 'foot.info.preprocessed', + configuration: conf_data, + ) custom_target( 'terminfo', - output: 'f', - input: 'foot.info', - command: [tic, '-x', '-o', '@OUTDIR@', '-e', 'foot,foot-direct', '@INPUT@'], + output: get_option('default-terminfo')[0], + input: preprocessed, + command: [tic, '-x', '-o', '@OUTDIR@', '-e', '@0@,@0@-direct'.format(get_option('default-terminfo')), '@INPUT@'], install: true, - install_dir: (terminfo_install_location != 'no' - ? terminfo_install_location - : default_terminfo_install_location) + install_dir: terminfo_install_location ) endif @@ -267,8 +274,9 @@ summary( 'IME': get_option('ime'), 'Grapheme clustering': utf8proc.found(), 'Build terminfo': tic.found(), + 'Terminfo install location': terminfo_install_location, 'Default TERM': get_option('default-terminfo'), - 'Terminfo custom install location': terminfo_install_location, + 'Set TERMINFO': get_option('custom-terminfo-install-location') != '', }, bool_yn: true ) -- cgit v1.3