From 8b092256d1cec7f93ac7d0cfec073c31b455a42e Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 19 Jan 2021 14:22:41 +0000 Subject: [PATCH] meson: optionalize terminfo dependency ncurses on FreeBSD still uses termcap(5) while foot works fine with xterm-256color sans status line and visible bell. Having more than one ncurses version installed may break other applications. Document -Dterminfo=false uses --term=xterm-256color by default --- config.c | 4 ++++ doc/foot.ini.5.scd | 3 ++- foot.ini | 2 +- meson.build | 22 ++++++++++++++-------- meson_options.txt | 1 + 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/config.c b/config.c index 883cf27c..54c8e60f 100644 --- a/config.c +++ b/config.c @@ -1956,7 +1956,11 @@ config_load(struct config *conf, const char *conf_path, bool ret = false; *conf = (struct config) { +#ifdef HAVE_TERMINFO .term = xstrdup("foot"), +#else + .term = xstrdup("xterm-256color"), +#endif .shell = get_shell(), .title = xstrdup("foot"), .app_id = xstrdup("foot"), diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 9cabc1d2..94596fdf 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -111,7 +111,8 @@ in this order: by prepending a '-' to argv[0]. Default: _no_. *term* - Value to set the environment variable *TERM* to. Default: _foot_. + Value to set the environment variable *TERM* to. Default: _foot_ + or _xterm-256color_ if built with _-Dterminfo=false_ *title* Initial window title. Default: _foot_. diff --git a/foot.ini b/foot.ini index adaf6088..98e25b93 100644 --- a/foot.ini +++ b/foot.ini @@ -10,7 +10,7 @@ # initial-window-mode=windowed # pad=2x2 # shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) -# term=foot +# term=foot (or xterm-256color if built with -Dterminfo=false) # login-shell=no # workers= # bold-text-in-bright=no diff --git a/meson.build b/meson.build index b57e4f3a..01010162 100644 --- a/meson.build +++ b/meson.build @@ -72,6 +72,11 @@ fontconfig = dependency('fontconfig') tllist = dependency('tllist', version: '>=1.0.4', fallback: 'tllist') fcft = dependency('fcft', version: ['>=2.3.0', '<3.0.0'], fallback: 'fcft') +tic = find_program('tic', native: true, required: get_option('terminfo')) +if tic.found() + add_project_arguments('-DHAVE_TERMINFO', language: 'c') +endif + wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir') wscanner = dependency('wayland-scanner', native: true) @@ -191,14 +196,15 @@ executable( version, install: true) -tic = find_program('tic', native: true) -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')) +if tic.found() + 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')) +endif install_data( 'LICENSE', 'README.md', 'CHANGELOG.md', diff --git a/meson_options.txt b/meson_options.txt index fc3c1b0f..0a5b0a3d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1,2 @@ option('ime', type: 'boolean', value: true, description: 'IME (Input Method Editor) support') +option('terminfo', type: 'boolean', value: true, description: 'Install terminfo')