2019-07-11 20:10:59 +02:00
|
|
|
project('foot', 'c',
|
2025-07-16 08:15:34 +02:00
|
|
|
version: '1.23.0',
|
2019-06-12 20:08:54 +02:00
|
|
|
license: 'MIT',
|
2023-06-14 12:26:19 +00:00
|
|
|
meson_version: '>=0.59.0',
|
2019-06-12 20:08:54 +02:00
|
|
|
default_options: [
|
2020-12-20 16:43:42 +01:00
|
|
|
'c_std=c11',
|
2019-06-12 20:08:54 +02:00
|
|
|
'warning_level=1',
|
|
|
|
|
'werror=true',
|
|
|
|
|
'b_ndebug=if-release'])
|
|
|
|
|
|
|
|
|
|
is_debug_build = get_option('buildtype').startswith('debug')
|
|
|
|
|
|
2020-02-16 14:40:02 +01:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
2024-08-07 14:12:13 +09:00
|
|
|
if cc.has_function('memfd_create',
|
2024-08-09 08:15:13 +02:00
|
|
|
args: ['-D_GNU_SOURCE'],
|
|
|
|
|
prefix: '#include <sys/mman.h>')
|
2021-01-19 14:20:55 +00:00
|
|
|
add_project_arguments('-DMEMFD_CREATE', language: 'c')
|
2024-05-25 14:40:25 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# Missing on DragonFly, FreeBSD < 14.1
|
2024-08-09 08:15:13 +02:00
|
|
|
if cc.has_function('execvpe',
|
|
|
|
|
args: ['-D_GNU_SOURCE'],
|
|
|
|
|
prefix: '#include <unistd.h>')
|
2024-05-25 14:40:25 +02:00
|
|
|
add_project_arguments('-DEXECVPE', language: 'c')
|
2021-01-19 14:20:55 +00:00
|
|
|
endif
|
|
|
|
|
|
2023-05-17 20:51:40 +02:00
|
|
|
utmp_backend = get_option('utmp-backend')
|
|
|
|
|
if utmp_backend == 'auto'
|
|
|
|
|
host_os = host_machine.system()
|
|
|
|
|
if host_os == 'linux'
|
|
|
|
|
utmp_backend = 'libutempter'
|
|
|
|
|
elif host_os == 'freebsd'
|
|
|
|
|
utmp_backend = 'ulog'
|
2022-09-23 20:24:04 +02:00
|
|
|
else
|
2023-05-17 20:51:40 +02:00
|
|
|
utmp_backend = 'none'
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
utmp_default_helper_path = get_option('utmp-default-helper-path')
|
|
|
|
|
|
|
|
|
|
if utmp_backend == 'none'
|
|
|
|
|
utmp_add = ''
|
|
|
|
|
utmp_del = ''
|
|
|
|
|
utmp_del_have_argument = false
|
|
|
|
|
utmp_default_helper_path = ''
|
|
|
|
|
elif utmp_backend == 'libutempter'
|
|
|
|
|
utmp_add = 'add'
|
|
|
|
|
utmp_del = 'del'
|
|
|
|
|
utmp_del_have_argument = true
|
|
|
|
|
if utmp_default_helper_path == 'auto'
|
|
|
|
|
utmp_default_helper_path = join_paths('/usr', get_option('libdir'), 'utempter', 'utempter')
|
|
|
|
|
endif
|
|
|
|
|
elif utmp_backend == 'ulog'
|
|
|
|
|
utmp_add = 'login'
|
|
|
|
|
utmp_del = 'logout'
|
|
|
|
|
utmp_del_have_argument = false
|
|
|
|
|
if utmp_default_helper_path == 'auto'
|
|
|
|
|
utmp_default_helper_path = join_paths('/usr', get_option('libexecdir'), 'ulog-helper')
|
2022-09-23 20:24:04 +02:00
|
|
|
endif
|
2023-05-17 20:51:40 +02:00
|
|
|
else
|
|
|
|
|
error('invalid utmp backend')
|
2022-09-23 20:24:04 +02:00
|
|
|
endif
|
|
|
|
|
|
2019-06-12 20:08:54 +02:00
|
|
|
add_project_arguments(
|
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
2021-08-07 16:42:51 +02:00
|
|
|
['-D_GNU_SOURCE=200809L',
|
2023-05-17 20:51:40 +02:00
|
|
|
'-DFOOT_DEFAULT_TERM="@0@"'.format(get_option('default-terminfo'))] +
|
|
|
|
|
(utmp_backend != 'none'
|
|
|
|
|
? ['-DUTMP_ADD="@0@"'.format(utmp_add),
|
|
|
|
|
'-DUTMP_DEL="@0@"'.format(utmp_del),
|
|
|
|
|
'-DUTMP_DEFAULT_HELPER_PATH="@0@"'.format(utmp_default_helper_path)]
|
|
|
|
|
: []) +
|
|
|
|
|
(utmp_del_have_argument
|
|
|
|
|
? ['-DUTMP_DEL_HAVE_ARGUMENT=1']
|
|
|
|
|
: []) +
|
2020-08-19 17:22:21 +01:00
|
|
|
(is_debug_build
|
|
|
|
|
? ['-D_DEBUG']
|
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
2021-08-07 16:42:51 +02:00
|
|
|
: [cc.get_supported_arguments('-fno-asynchronous-unwind-tables')]) +
|
2020-12-03 18:36:56 +01:00
|
|
|
(get_option('ime')
|
|
|
|
|
? ['-DFOOT_IME_ENABLED=1']
|
|
|
|
|
: []) +
|
2021-03-26 20:30:13 +01:00
|
|
|
(get_option('b_pgo') == 'use'
|
|
|
|
|
? ['-DFOOT_PGO_ENABLED=1']
|
|
|
|
|
: []) +
|
2020-02-16 14:40:15 +01:00
|
|
|
cc.get_supported_arguments(
|
2020-08-23 09:49:15 +02:00
|
|
|
['-pedantic',
|
|
|
|
|
'-fstrict-aliasing',
|
2020-05-25 21:15:17 +02:00
|
|
|
'-Wstrict-aliasing']),
|
2019-06-12 20:08:54 +02:00
|
|
|
language: 'c',
|
|
|
|
|
)
|
2019-06-13 16:24:35 +02: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
2021-08-07 16:42:51 +02:00
|
|
|
terminfo_install_location = get_option('custom-terminfo-install-location')
|
|
|
|
|
|
2021-08-29 11:06:45 +02:00
|
|
|
if terminfo_install_location != ''
|
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
2021-08-07 16:42:51 +02:00
|
|
|
add_project_arguments(
|
|
|
|
|
['-DFOOT_TERMINFO_PATH="@0@"'.format(
|
|
|
|
|
join_paths(get_option('prefix'), terminfo_install_location))],
|
|
|
|
|
language: 'c')
|
2021-08-29 11:06:45 +02:00
|
|
|
else
|
|
|
|
|
terminfo_install_location = join_paths(get_option('datadir'), 'terminfo')
|
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
2021-08-07 16:42:51 +02:00
|
|
|
endif
|
|
|
|
|
|
2020-02-16 14:40:02 +01:00
|
|
|
# Compute the relative path used by compiler invocations.
|
|
|
|
|
source_root = meson.current_source_dir().split('/')
|
2022-02-27 11:26:40 +01:00
|
|
|
build_root = meson.global_build_root().split('/')
|
2020-02-16 14:40:02 +01:00
|
|
|
relative_dir_parts = []
|
|
|
|
|
i = 0
|
|
|
|
|
in_prefix = true
|
|
|
|
|
foreach p : build_root
|
|
|
|
|
if i >= source_root.length() or not in_prefix or p != source_root[i]
|
|
|
|
|
in_prefix = false
|
|
|
|
|
relative_dir_parts += '..'
|
|
|
|
|
endif
|
|
|
|
|
i += 1
|
|
|
|
|
endforeach
|
|
|
|
|
i = 0
|
|
|
|
|
in_prefix = true
|
|
|
|
|
foreach p : source_root
|
|
|
|
|
if i >= build_root.length() or not in_prefix or build_root[i] != p
|
|
|
|
|
in_prefix = false
|
|
|
|
|
relative_dir_parts += p
|
|
|
|
|
endif
|
|
|
|
|
i += 1
|
|
|
|
|
endforeach
|
|
|
|
|
relative_dir = join_paths(relative_dir_parts) + '/'
|
|
|
|
|
|
|
|
|
|
if cc.has_argument('-fmacro-prefix-map=/foo=')
|
|
|
|
|
add_project_arguments('-fmacro-prefix-map=@0@='.format(relative_dir), language: 'c')
|
|
|
|
|
endif
|
|
|
|
|
|
2019-12-05 19:35:54 +01:00
|
|
|
math = cc.find_library('m')
|
2021-01-19 15:48:56 +00:00
|
|
|
threads = [dependency('threads'), cc.find_library('stdthreads', required: false)]
|
2021-01-19 15:54:18 +00:00
|
|
|
libepoll = dependency('epoll-shim', required: false)
|
2019-08-15 21:21:22 +02:00
|
|
|
pixman = dependency('pixman-1')
|
2025-03-12 17:53:04 +01:00
|
|
|
wayland_protocols = dependency('wayland-protocols', version: '>=1.41',
|
2023-08-08 19:32:45 +02:00
|
|
|
fallback: 'wayland-protocols',
|
|
|
|
|
default_options: ['tests=false'])
|
2019-06-12 20:08:54 +02:00
|
|
|
wayland_client = dependency('wayland-client')
|
|
|
|
|
wayland_cursor = dependency('wayland-cursor')
|
2025-05-18 11:29:50 +02:00
|
|
|
xkb = dependency('xkbcommon', version: '>=1.0.0')
|
2020-07-07 10:44:55 +02:00
|
|
|
fontconfig = dependency('fontconfig')
|
2020-08-20 19:25:35 +02:00
|
|
|
utf8proc = dependency('libutf8proc', required: get_option('grapheme-clustering'))
|
|
|
|
|
|
|
|
|
|
if utf8proc.found()
|
|
|
|
|
add_project_arguments('-DFOOT_GRAPHEME_CLUSTERING=1', language: 'c')
|
|
|
|
|
endif
|
2019-06-12 20:08:54 +02:00
|
|
|
|
2025-05-01 09:37:47 +02:00
|
|
|
if pixman.version().version_compare('>=0.46.0')
|
|
|
|
|
add_project_arguments('-DHAVE_PIXMAN_RGBA_16', language: 'c')
|
|
|
|
|
endif
|
|
|
|
|
|
2023-04-08 10:58:27 -04:00
|
|
|
tllist = dependency('tllist', version: '>=1.1.0', fallback: 'tllist')
|
2025-03-13 13:23:25 +01:00
|
|
|
fcft = dependency('fcft', version: ['>=3.3.1', '<4.0.0'], fallback: 'fcft')
|
2019-12-01 16:11:35 +01:00
|
|
|
|
2022-02-27 11:26:40 +01:00
|
|
|
wayland_protocols_datadir = wayland_protocols.get_variable('pkgdatadir')
|
2019-06-12 20:08:54 +02:00
|
|
|
|
|
|
|
|
wscanner = dependency('wayland-scanner', native: true)
|
|
|
|
|
wscanner_prog = find_program(
|
2022-02-27 11:26:40 +01:00
|
|
|
wscanner.get_variable('wayland_scanner'), native: true)
|
2019-06-12 20:08:54 +02:00
|
|
|
|
|
|
|
|
wl_proto_headers = []
|
|
|
|
|
wl_proto_src = []
|
2021-05-11 17:58:40 +02:00
|
|
|
wl_proto_xml = [
|
2023-08-08 19:32:45 +02:00
|
|
|
wayland_protocols_datadir / 'stable/xdg-shell/xdg-shell.xml',
|
|
|
|
|
wayland_protocols_datadir / 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml',
|
|
|
|
|
wayland_protocols_datadir / 'unstable/xdg-output/xdg-output-unstable-v1.xml',
|
|
|
|
|
wayland_protocols_datadir / 'unstable/primary-selection/primary-selection-unstable-v1.xml',
|
|
|
|
|
wayland_protocols_datadir / 'stable/presentation-time/presentation-time.xml',
|
|
|
|
|
wayland_protocols_datadir / 'unstable/text-input/text-input-unstable-v3.xml',
|
|
|
|
|
wayland_protocols_datadir / 'staging/xdg-activation/xdg-activation-v1.xml',
|
|
|
|
|
wayland_protocols_datadir / 'stable/viewporter/viewporter.xml',
|
|
|
|
|
wayland_protocols_datadir / 'staging/fractional-scale/fractional-scale-v1.xml',
|
|
|
|
|
wayland_protocols_datadir / 'unstable/tablet/tablet-unstable-v2.xml', # required by cursor-shape-v1
|
|
|
|
|
wayland_protocols_datadir / 'staging/cursor-shape/cursor-shape-v1.xml',
|
2024-05-21 16:09:34 +02:00
|
|
|
wayland_protocols_datadir / 'staging/single-pixel-buffer/single-pixel-buffer-v1.xml',
|
2025-03-12 17:53:04 +01:00
|
|
|
wayland_protocols_datadir / 'staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml',
|
|
|
|
|
wayland_protocols_datadir / 'staging/xdg-system-bell/xdg-system-bell-v1.xml',
|
|
|
|
|
wayland_protocols_datadir / 'staging/color-management/color-management-v1.xml',
|
2019-06-12 20:08:54 +02:00
|
|
|
]
|
|
|
|
|
|
2021-05-11 17:58:40 +02:00
|
|
|
foreach prot : wl_proto_xml
|
2019-06-12 20:08:54 +02:00
|
|
|
wl_proto_headers += custom_target(
|
|
|
|
|
prot.underscorify() + '-client-header',
|
|
|
|
|
output: '@BASENAME@.h',
|
|
|
|
|
input: prot,
|
|
|
|
|
command: [wscanner_prog, 'client-header', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
|
|
|
|
|
wl_proto_src += custom_target(
|
|
|
|
|
prot.underscorify() + '-private-code',
|
|
|
|
|
output: '@BASENAME@.c',
|
|
|
|
|
input: prot,
|
|
|
|
|
command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
endforeach
|
|
|
|
|
|
2021-08-25 19:12:45 +02:00
|
|
|
env = find_program('env', native: true)
|
2019-10-19 22:09:52 +02:00
|
|
|
generate_version_sh = files('generate-version.sh')
|
|
|
|
|
version = custom_target(
|
|
|
|
|
'generate_version',
|
|
|
|
|
build_always_stale: true,
|
|
|
|
|
output: 'version.h',
|
2021-12-21 13:40:54 +01:00
|
|
|
command: [env, 'LC_ALL=C', generate_version_sh, meson.project_version(), '@CURRENT_SOURCE_DIR@', '@OUTPUT@'])
|
2019-10-19 22:09:52 +02:00
|
|
|
|
2022-01-02 11:06:09 +01:00
|
|
|
python = find_program('python3', native: true)
|
|
|
|
|
generate_builtin_terminfo_py = files('scripts/generate-builtin-terminfo.py')
|
|
|
|
|
foot_terminfo = files('foot.info')
|
|
|
|
|
builtin_terminfo = custom_target(
|
|
|
|
|
'generate_builtin_terminfo',
|
|
|
|
|
output: 'foot-terminfo.h',
|
|
|
|
|
command: [python, generate_builtin_terminfo_py,
|
|
|
|
|
'@default_terminfo@', foot_terminfo, 'foot', '@OUTPUT@']
|
|
|
|
|
)
|
|
|
|
|
|
2024-06-24 21:18:37 +02:00
|
|
|
generate_emoji_variation_sequences = files('scripts/generate-emoji-variation-sequences.py')
|
|
|
|
|
emoji_variation_sequences = custom_target(
|
|
|
|
|
'generate_emoji_variation_sequences',
|
|
|
|
|
input: 'unicode/emoji-variation-sequences.txt',
|
|
|
|
|
output: 'emoji-variation-sequences.h',
|
|
|
|
|
command: [python, generate_emoji_variation_sequences, '@INPUT@', '@OUTPUT@']
|
|
|
|
|
)
|
|
|
|
|
|
render: gamma-correct blending
This implements gamma-correct blending, which mainly affects font
rendering.
The implementation requires compile-time availability of the new
color-management protocol (available in wayland-protocols >= 1.41),
and run-time support for the same in the compositor (specifically, the
EXT_LINEAR TF function and sRGB primaries).
How it works: all colors are decoded from sRGB to linear (using a
lookup table, generated in the exact same way pixman generates it's
internal conversion tables) before being used by pixman. The resulting
image buffer is thus in decoded/linear format. We use the
color-management protocol to inform the compositor of this, by tagging
the wayland surfaces with the 'ext_linear' image attribute.
Sixes: all colors are sRGB internally, and decoded to linear before
being used in any sixels. Thus, the image buffers will contain linear
colors. This is important, since otherwise there would be a
decode/encode penalty every time a sixel is blended to the grid.
Emojis: we require fcft >= 3.2, which adds support for sRGB decoding
color glyphs. Meaning, the emoji pixman surfaces can be blended
directly to the grid, just like sixels.
Gamma-correct blending is enabled by default *when the compositor
supports it*. There's a new option to explicitly enable/disable it:
gamma-correct-blending=no|yes. If set to 'yes', and the compositor
does not implement the required color-management features, warning
logs are emitted.
There's a loss of precision when storing linear pixels in 8-bit
channels. For this reason, this patch also adds supports for 10-bit
surfaces. For now, this is disabled by default since such surfaces
only have 2 bits for alpha. It can be enabled with
tweak.surface-bit-depth=10-bit.
Perhaps, in the future, we can enable it by default if:
* gamma-correct blending is enabled
* the user has not enabled a transparent background
2025-02-21 11:01:29 +01:00
|
|
|
generate_srgb_funcs = files('scripts/srgb.py')
|
|
|
|
|
srgb_funcs = custom_target(
|
|
|
|
|
'generate_srgb_funcs',
|
|
|
|
|
output: ['srgb.c', 'srgb.h'],
|
|
|
|
|
command: [python, generate_srgb_funcs, '@OUTPUT0@', '@OUTPUT1@']
|
|
|
|
|
)
|
|
|
|
|
|
2021-03-27 13:17:43 +01:00
|
|
|
common = static_library(
|
|
|
|
|
'common',
|
|
|
|
|
'log.c', 'log.h',
|
fcft: adapt to API changes in fcft-3.x
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.
Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.
For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).
Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.
These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.
For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.
FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.
Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.
Other fcft API changes:
* fcft_glyph_rasterize() -> fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
2021-08-21 14:50:42 +02:00
|
|
|
'char32.c', 'char32.h',
|
2021-03-27 13:17:43 +01:00
|
|
|
'debug.c', 'debug.h',
|
2024-09-11 20:13:30 +01:00
|
|
|
'macros.h',
|
2021-03-27 13:17:43 +01:00
|
|
|
'xmalloc.c', 'xmalloc.h',
|
2025-01-04 10:06:45 +01:00
|
|
|
'xsnprintf.c', 'xsnprintf.h',
|
|
|
|
|
dependencies: [utf8proc]
|
2021-03-27 13:17:43 +01:00
|
|
|
)
|
2021-03-26 20:31:09 +01:00
|
|
|
|
2020-11-14 11:00:43 +01:00
|
|
|
misc = static_library(
|
|
|
|
|
'misc',
|
|
|
|
|
'hsl.c', 'hsl.h',
|
|
|
|
|
'macros.h',
|
|
|
|
|
'misc.c', 'misc.h',
|
2025-01-04 10:06:45 +01:00
|
|
|
'uri.c', 'uri.h',
|
|
|
|
|
dependencies: [utf8proc],
|
|
|
|
|
link_with: [common]
|
2020-11-14 11:00:43 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
vtlib = static_library(
|
|
|
|
|
'vtlib',
|
|
|
|
|
'base64.c', 'base64.h',
|
composed: store compose chains in a binary search tree
The previous implementation stored compose chains in a dynamically
allocated array. Adding a chain was easy: resize the array and append
the new chain at the end. Looking up a compose chain given a compose
chain key/index was also easy: just index into the array.
However, searching for a pre-existing chain given a codepoint sequence
was very slow. Since the array wasn’t sorted, we typically had to scan
through the entire array, just to realize that there is no
pre-existing chain, and that we need to add a new one.
Since this happens for *each* codepoint in a grapheme cluster, things
quickly became really slow.
Things were ok:ish as long as the compose chain struct was small, as
that made it possible to hold all the chains in the cache. Once the
number of chains reached a certain point, or when we were forced to
bump maximum number of allowed codepoints in a chain, we started
thrashing the cache and things got much much worse.
So what can we do?
We can’t sort the array, because
a) that would invalidate all existing chain keys in the grid (and
iterating the entire scrollback and updating compose keys is *not* an
option).
b) inserting a chain becomes slow as we need to first find _where_ to
insert it, and then memmove() the rest of the array.
This patch uses a binary search tree to store the chains instead of a
simple array.
The tree is sorted on a “key”, which is the XOR of all codepoints,
truncated to the CELL_COMB_CHARS_HI-CELL_COMB_CHARS_LO range.
The grid now stores CELL_COMB_CHARS_LO+key, instead of
CELL_COMB_CHARS_LO+index.
Since the key is truncated, collisions may occur. This is handled by
incrementing the key by 1.
Lookup is of course slower than before, O(log n) instead of
O(1).
Insertion is slightly slower as well: technically it’s O(log n)
instead of O(1). However, we also need to take into account the
re-allocating the array will occasionally force a full copy of the
array when it cannot simply be growed.
But finding a pre-existing chain is now *much* faster: O(log n)
instead of O(n). In most cases, the first lookup will either
succeed (return a true match), or fail (return NULL). However, since
key collisions are possible, it may also return false matches. This
means we need to verify the contents of the chain before deciding to
use it instead of inserting a new chain. But remember that this
comparison was being done for each and every chain in the previous
implementation.
With lookups being much faster, and in particular, no longer requiring
us to check the chain contents for every singlec chain, we can now use
a dynamically allocated ‘chars’ array in the chain. This was
previously a hardcoded array of 10 chars.
Using a dynamic allocated array means looking in the array is slower,
since we now need two loads: one to load the pointer, and a second to
load _from_ the pointer.
As a result, the base size of a compose chain (i.e. an “empty” chain)
has now been reduced from 48 bytes to 32. A chain with two codepoints
is 40 bytes. This means we have up to 4 codepoints while still using
less, or the same amount, of memory as before.
Furthermore, the Unicode random test (i.e. write random “unicode”
chars) is now **faster** than current master (i.e. before text-shaping
support was added), **with** test-shaping enabled. With text-shaping
disabled, we’re _even_ faster.
2021-06-24 13:17:07 +02:00
|
|
|
'composed.c', 'composed.h',
|
2023-07-03 14:42:22 +02:00
|
|
|
'cursor-shape.c', 'cursor-shape.h',
|
2020-11-14 11:00:43 +01:00
|
|
|
'csi.c', 'csi.h',
|
|
|
|
|
'dcs.c', 'dcs.h',
|
2021-10-20 17:05:36 +01:00
|
|
|
'macros.h',
|
2020-11-14 11:00:43 +01:00
|
|
|
'osc.c', 'osc.h',
|
|
|
|
|
'sixel.c', 'sixel.h',
|
|
|
|
|
'vt.c', 'vt.h',
|
2025-04-23 11:44:41 +02:00
|
|
|
builtin_terminfo, srgb_funcs,
|
2024-06-24 21:18:37 +02:00
|
|
|
wl_proto_src + wl_proto_headers,
|
2020-11-14 12:42:08 +01:00
|
|
|
version,
|
2020-08-20 19:25:35 +02:00
|
|
|
dependencies: [libepoll, pixman, fcft, tllist, wayland_client, xkb, utf8proc],
|
2021-03-27 13:17:43 +01:00
|
|
|
link_with: [common, misc],
|
2020-11-14 11:00:43 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pgolib = static_library(
|
|
|
|
|
'pgolib',
|
|
|
|
|
'grid.c', 'grid.h',
|
2020-11-14 22:37:47 +01:00
|
|
|
'selection.c', 'selection.h',
|
2020-11-14 11:00:43 +01:00
|
|
|
'terminal.c', 'terminal.h',
|
2025-04-23 11:44:41 +02:00
|
|
|
emoji_variation_sequences,
|
2020-12-19 22:09:03 +00:00
|
|
|
wl_proto_src + wl_proto_headers,
|
2021-06-24 20:16:58 +02:00
|
|
|
dependencies: [libepoll, pixman, fcft, tllist, wayland_client, xkb, utf8proc],
|
2020-11-14 11:00:43 +01:00
|
|
|
link_with: vtlib,
|
|
|
|
|
)
|
|
|
|
|
|
2024-07-18 09:02:42 +02:00
|
|
|
tokenize = static_library(
|
|
|
|
|
'tokenizelib',
|
|
|
|
|
'tokenize.c',
|
2025-01-04 10:06:45 +01:00
|
|
|
dependencies: [utf8proc],
|
2024-07-18 09:02:42 +02:00
|
|
|
link_with: [common],
|
|
|
|
|
)
|
|
|
|
|
|
2021-03-26 20:34:18 +01:00
|
|
|
if get_option('b_pgo') == 'generate'
|
|
|
|
|
executable(
|
|
|
|
|
'pgo',
|
|
|
|
|
'pgo/pgo.c',
|
|
|
|
|
wl_proto_src + wl_proto_headers,
|
2021-06-24 20:16:58 +02:00
|
|
|
dependencies: [math, threads, libepoll, pixman, wayland_client, xkb, utf8proc, fcft, tllist],
|
2021-03-26 20:34:18 +01:00
|
|
|
link_with: pgolib,
|
|
|
|
|
)
|
|
|
|
|
endif
|
2020-11-14 11:00:43 +01:00
|
|
|
|
2019-06-12 20:08:54 +02:00
|
|
|
executable(
|
2019-07-11 20:10:59 +02:00
|
|
|
'foot',
|
2019-11-04 13:45:38 +01:00
|
|
|
'async.c', 'async.h',
|
2020-12-26 16:24:16 +01:00
|
|
|
'box-drawing.c', 'box-drawing.h',
|
2019-07-16 11:52:22 +02:00
|
|
|
'config.c', 'config.h',
|
2019-07-09 16:26:36 +02:00
|
|
|
'commands.c', 'commands.h',
|
2020-07-15 11:19:18 +02:00
|
|
|
'extract.c', 'extract.h',
|
2019-10-27 11:46:18 +01:00
|
|
|
'fdm.c', 'fdm.h',
|
2025-03-14 20:15:11 +00:00
|
|
|
'foot-features.c', 'foot-features.h',
|
2020-10-10 22:14:35 +02:00
|
|
|
'ime.c', 'ime.h',
|
2019-06-19 10:04:47 +02:00
|
|
|
'input.c', 'input.h',
|
key-binding: new API, for handling sets of key bindings
Up until now, our Wayland seats have been tracking key bindings. This
makes sense, since the seat’s keymap determines how the key bindings
are resolved.
However, tying bindings to the seat/keymap alone isn’t enough, since
we also depend on the current configuration (i.e. user settings) when
resolving a key binding.
This means configurations that doesn’t match the wayland object’s
configuration, currently don’t resolve key bindings correctly. This
applies to footclients where the user has overridden key bindings on
the command line (e.g. --override key-bindings.foo=bar).
Thus, to correctly resolve key bindings, each set of key bindings must
be tied *both* to a seat/keymap, *and* a configuration.
This patch introduces a key-binding manager, with an API to
add/remove/lookup, and load/unload keymaps from sets of key bindings.
In the API, sets are tied to a seat and terminal instance, since this
makes the most sense (we need to instantiate, or incref a set whenever
a new terminal instance is created). Internally, the set is tied to a
seat and the terminal’s configuration.
Sets are *added* when a new seat is added, and when a new terminal
instance is created. Since there can only be one instance of each
seat, sets are always removed when a seat is removed.
Terminals on the other hand can re-use the same configuration (and
typically do). Thus, sets ref-count the configuration. In other words,
when instantiating a new terminal, we may not have to instantiate a
new set of key bindings, but can often be incref:ed instead.
Whenever the keymap changes on a seat, all key bindings sets
associated with that seat reloads (re-resolves) their key bindings.
Closes #931
2022-04-17 15:39:51 +02:00
|
|
|
'key-binding.c', 'key-binding.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
'main.c',
|
2020-12-10 18:06:24 +01:00
|
|
|
'notify.c', 'notify.h',
|
2020-03-01 13:06:00 +01:00
|
|
|
'quirks.c', 'quirks.h',
|
2020-05-21 20:15:10 +02:00
|
|
|
'reaper.c', 'reaper.h',
|
2019-07-05 10:16:56 +02:00
|
|
|
'render.c', 'render.h',
|
2019-08-27 17:23:28 +02:00
|
|
|
'search.c', 'search.h',
|
2020-11-21 20:21:18 +01:00
|
|
|
'server.c', 'server.h', 'client-protocol.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
'shm.c', 'shm.h',
|
2019-06-13 15:19:10 +02:00
|
|
|
'slave.c', 'slave.h',
|
2020-07-15 12:39:10 +02:00
|
|
|
'spawn.c', 'spawn.h',
|
2019-07-17 09:46:45 +02:00
|
|
|
'tokenize.c', 'tokenize.h',
|
2022-07-28 18:09:16 +02:00
|
|
|
'unicode-mode.c', 'unicode-mode.h',
|
2021-01-31 11:12:07 +01:00
|
|
|
'url-mode.c', 'url-mode.h',
|
2021-02-12 09:25:29 +01:00
|
|
|
'user-notification.c', 'user-notification.h',
|
2022-06-16 18:30:43 +02:00
|
|
|
'wayland.c', 'wayland.h', 'shm-formats.h',
|
2025-05-18 11:35:27 +02:00
|
|
|
'xkbcommon-vmod.h',
|
2025-03-17 16:51:53 -04:00
|
|
|
srgb_funcs, wl_proto_src + wl_proto_headers, version,
|
2021-06-24 20:16:58 +02:00
|
|
|
dependencies: [math, threads, libepoll, pixman, wayland_client, wayland_cursor, xkb, fontconfig, utf8proc,
|
2020-07-07 10:44:55 +02:00
|
|
|
tllist, fcft],
|
2020-11-14 11:00:43 +01:00
|
|
|
link_with: pgolib,
|
2019-06-12 20:08:54 +02:00
|
|
|
install: true)
|
2019-07-15 15:47:45 +02:00
|
|
|
|
2019-11-01 20:39:34 +01:00
|
|
|
executable(
|
|
|
|
|
'footclient',
|
2020-11-21 20:21:18 +01:00
|
|
|
'client.c', 'client-protocol.h',
|
2025-03-14 20:15:11 +00:00
|
|
|
'foot-features.c', 'foot-features.h',
|
2020-08-08 20:34:30 +01:00
|
|
|
'macros.h',
|
2021-02-11 11:08:18 +00:00
|
|
|
'util.h',
|
2020-08-08 20:34:30 +01:00
|
|
|
version,
|
2025-01-04 10:06:45 +01:00
|
|
|
dependencies: [tllist, utf8proc],
|
2021-03-27 13:17:43 +01:00
|
|
|
link_with: common,
|
2019-11-01 20:39:34 +01:00
|
|
|
install: true)
|
|
|
|
|
|
2020-07-25 09:05:11 +02:00
|
|
|
install_data(
|
desktop: rename to foot{,client,-server}.desktop
That is, skip the reverse DNS naming scheme suggested by the .desktop
specification, and directly match our app-ids ("foot", and
"footclient").
This simplifies .desktop -> window instance mapping, allowing DEs to
match the filenames directly, without having to look at the
StartupWMClass key in the .desktop files.
These are the original names of the .desktop files. There were
renamed (to use the reverse DNS syntax) to please the flathub people,
who *required* this scheme to accept the foot package.
But, since:
* We don't package foot ourselves
* We don't go out of our way to support non-distro packaging schemes
* Flathub still hasn't merged the foot PR (it's now 2 years old)
* There are no know issues in any known DE that prevents a non-reverse
DNS .desktop filename from working
* There are plenty of other applications that doesn't use reverse DNS
names (a very clear majority, in my case)
Let's just revert back to the simpler naming scheme.
Closes #1607
2024-09-08 10:23:26 +02:00
|
|
|
'foot.desktop', 'foot-server.desktop', 'footclient.desktop',
|
2020-07-25 09:05:11 +02:00
|
|
|
install_dir: join_paths(get_option('datadir'), 'applications'))
|
2021-07-24 13:09:25 +02:00
|
|
|
|
2022-01-15 17:25:59 +01:00
|
|
|
systemd = dependency('systemd', required: false)
|
2022-05-11 20:58:07 +02:00
|
|
|
custom_systemd_units_dir = get_option('systemd-units-dir')
|
2022-01-15 17:25:59 +01:00
|
|
|
|
2022-05-11 20:58:07 +02:00
|
|
|
if systemd.found() or custom_systemd_units_dir != ''
|
2022-01-15 17:25:59 +01:00
|
|
|
configuration = configuration_data()
|
|
|
|
|
configuration.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
|
|
|
|
|
|
2022-05-11 20:58:07 +02:00
|
|
|
if (custom_systemd_units_dir == '')
|
2022-05-04 17:33:34 +02:00
|
|
|
systemd_units_dir = systemd.get_variable('systemduserunitdir')
|
|
|
|
|
else
|
2022-05-11 20:58:07 +02:00
|
|
|
systemd_units_dir = custom_systemd_units_dir
|
2022-05-04 17:33:34 +02:00
|
|
|
endif
|
|
|
|
|
|
2022-01-15 17:25:59 +01:00
|
|
|
configure_file(
|
|
|
|
|
configuration: configuration,
|
2023-02-14 09:49:32 +01:00
|
|
|
input: 'foot-server.service.in',
|
2022-01-15 17:25:59 +01:00
|
|
|
output: '@BASENAME@',
|
|
|
|
|
install_dir: systemd_units_dir
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
install_data(
|
2023-02-14 09:49:32 +01:00
|
|
|
'foot-server.socket',
|
2022-01-15 17:25:59 +01:00
|
|
|
install_dir: systemd_units_dir)
|
|
|
|
|
endif
|
|
|
|
|
|
2021-07-24 13:09:25 +02:00
|
|
|
scdoc = dependency('scdoc', native: true, required: get_option('docs'))
|
2022-04-21 10:04:11 +02:00
|
|
|
install_data('foot.ini', install_dir: join_paths(get_option('sysconfdir'), 'xdg', 'foot'))
|
2021-07-24 13:09:25 +02:00
|
|
|
if scdoc.found()
|
|
|
|
|
install_data(
|
|
|
|
|
'LICENSE', 'README.md', 'CHANGELOG.md',
|
|
|
|
|
install_dir: join_paths(get_option('datadir'), 'doc', 'foot'))
|
|
|
|
|
subdir('doc')
|
|
|
|
|
endif
|
2019-08-11 20:54:28 +02:00
|
|
|
|
2021-11-14 23:12:18 +01:00
|
|
|
if get_option('themes')
|
|
|
|
|
install_subdir('themes', install_dir: join_paths(get_option('datadir'), 'foot'))
|
|
|
|
|
endif
|
|
|
|
|
|
2023-07-26 16:14:38 +02:00
|
|
|
terminfo_base_name = get_option('terminfo-base-name')
|
|
|
|
|
if terminfo_base_name == ''
|
|
|
|
|
terminfo_base_name = get_option('default-terminfo')
|
|
|
|
|
endif
|
|
|
|
|
|
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
2021-08-07 16:42:51 +02:00
|
|
|
tic = find_program('tic', native: true, required: get_option('terminfo'))
|
|
|
|
|
if tic.found()
|
2021-08-29 11:06:45 +02:00
|
|
|
conf_data = configuration_data(
|
|
|
|
|
{
|
2023-07-26 16:14:38 +02:00
|
|
|
'default_terminfo': terminfo_base_name
|
2021-08-29 11:06:45 +02:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
preprocessed = configure_file(
|
|
|
|
|
input: 'foot.info',
|
|
|
|
|
output: 'foot.info.preprocessed',
|
|
|
|
|
configuration: conf_data,
|
|
|
|
|
)
|
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
2021-08-07 16:42:51 +02:00
|
|
|
custom_target(
|
|
|
|
|
'terminfo',
|
2023-07-26 16:14:38 +02:00
|
|
|
output: terminfo_base_name[0],
|
2021-08-29 11:06:45 +02:00
|
|
|
input: preprocessed,
|
2023-07-26 16:14:38 +02:00
|
|
|
command: [tic, '-x', '-o', '@OUTDIR@', '-e', '@0@,@0@-direct'.format(terminfo_base_name), '@INPUT@'],
|
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
2021-08-07 16:42:51 +02:00
|
|
|
install: true,
|
2021-08-29 11:06:45 +02:00
|
|
|
install_dir: terminfo_install_location
|
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
2021-08-07 16:42:51 +02:00
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
2019-10-20 11:54:58 +02:00
|
|
|
subdir('completions')
|
2020-06-25 21:33:09 +02:00
|
|
|
subdir('icons')
|
2022-10-07 14:40:22 +02:00
|
|
|
subdir('utils')
|
2022-02-06 12:51:54 +01:00
|
|
|
|
|
|
|
|
if (get_option('tests'))
|
|
|
|
|
subdir('tests')
|
|
|
|
|
endif
|
2020-05-01 12:32:10 +02:00
|
|
|
|
2020-12-03 18:36:56 +01:00
|
|
|
summary(
|
|
|
|
|
{
|
2021-07-24 13:09:25 +02:00
|
|
|
'Documentation': scdoc.found(),
|
2021-11-14 23:12:18 +01:00
|
|
|
'Themes': get_option('themes'),
|
2020-12-03 18:36:56 +01:00
|
|
|
'IME': get_option('ime'),
|
2020-08-20 19:25:35 +02:00
|
|
|
'Grapheme clustering': utf8proc.found(),
|
2023-05-17 20:51:40 +02:00
|
|
|
'utmp backend': utmp_backend,
|
|
|
|
|
'utmp helper default path': utmp_default_helper_path,
|
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
2021-08-07 16:42:51 +02:00
|
|
|
'Build terminfo': tic.found(),
|
2023-07-26 16:14:38 +02:00
|
|
|
'Terminfo base name': terminfo_base_name,
|
2021-08-29 11:06:45 +02:00
|
|
|
'Terminfo install location': terminfo_install_location,
|
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
2021-08-07 16:42:51 +02:00
|
|
|
'Default TERM': get_option('default-terminfo'),
|
2021-08-29 11:06:45 +02:00
|
|
|
'Set TERMINFO': get_option('custom-terminfo-install-location') != '',
|
2022-02-06 12:51:54 +01:00
|
|
|
'Build tests': get_option('tests'),
|
2020-12-03 18:36:56 +01:00
|
|
|
},
|
|
|
|
|
bool_yn: true
|
|
|
|
|
)
|