2019-07-11 20:10:59 +02:00
|
|
|
project('foot', 'c',
|
2020-03-15 11:28:01 +01:00
|
|
|
version: '1.2.3',
|
2019-06-12 20:08:54 +02:00
|
|
|
license: 'MIT',
|
2020-04-24 20:32:37 +02:00
|
|
|
meson_version: '>=0.53.0',
|
2019-06-12 20:08:54 +02:00
|
|
|
default_options: [
|
2020-04-26 19:39:08 +02:00
|
|
|
'c_std=c18',
|
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')
|
|
|
|
|
|
2019-06-12 20:08:54 +02:00
|
|
|
add_project_arguments(
|
2020-02-16 14:40:15 +01:00
|
|
|
['-D_GNU_SOURCE=200809L'] + (is_debug_build ? ['-D_DEBUG'] : []) +
|
|
|
|
|
cc.get_supported_arguments(
|
2020-04-04 14:41:43 +02:00
|
|
|
['-fstrict-aliasing',
|
2020-02-16 14:40:15 +01:00
|
|
|
'-Wstrict-aliasing',
|
|
|
|
|
'-Wno-missing-profile']),
|
2019-06-12 20:08:54 +02:00
|
|
|
language: 'c',
|
|
|
|
|
)
|
2019-06-13 16:24:35 +02:00
|
|
|
|
2020-02-16 14:40:02 +01:00
|
|
|
# Compute the relative path used by compiler invocations.
|
|
|
|
|
source_root = meson.current_source_dir().split('/')
|
|
|
|
|
build_root = meson.build_root().split('/')
|
|
|
|
|
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')
|
2019-06-19 10:04:47 +02:00
|
|
|
threads = dependency('threads')
|
2019-08-15 21:21:22 +02:00
|
|
|
pixman = dependency('pixman-1')
|
2019-06-12 20:08:54 +02:00
|
|
|
wayland_protocols = dependency('wayland-protocols')
|
|
|
|
|
wayland_client = dependency('wayland-client')
|
|
|
|
|
wayland_cursor = dependency('wayland-cursor')
|
|
|
|
|
xkb = dependency('xkbcommon')
|
|
|
|
|
|
2020-05-02 17:29:00 +02:00
|
|
|
add_project_arguments('-DFOOT_UNICODE_PRECOMPOSE=@0@'.format(
|
unicode-combining: store seen combining chains "globally" in the term struct
Instead of storing combining data per cell, realize that most
combinations are re-occurring and that there's lots of available space
left in the unicode range, and store seen base+combining combinations
chains in a per-terminal array.
When we encounter a combining character, we first try to pre-compose,
like before. If that fails, we then search for the current
base+combining combo in the list of previously seen combinations. If
not found there either, we allocate a new combo and add it to the
list. Regardless, the result is an index into this array. We store
this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell.
When rendering, we need to check if the cell character is a plain
character, or if it's a composed character (identified by checking if
the cell character is >= COMB_CHARS_LO).
Then we render the grapheme pretty much like before.
2020-05-03 11:03:22 +02:00
|
|
|
get_option('unicode-precompose')), language: 'c')
|
utf8: add support for unicode combining characters
This feature lets foot combine e.g. "a\u0301" to "á".
We first check if the current character (that we're about to print) is
a combining character, by checking if it's in one of the following
ranges:
* Combining Diacritical Marks (0300–036F), since version 1.0, with
modifications in subsequent versions down to 4.1
* Combining Diacritical Marks Extended (1AB0–1AFF), version 7.0
* Combining Diacritical Marks Supplement (1DC0–1DFF), versions 4.1 to 5.2
* Combining Diacritical Marks for Symbols (20D0–20FF), since version
1.0, with modifications in subsequent versions down to 5.1
* Combining Half Marks (FE20–FE2F), versions 1.0, with modifications
in subsequent versions down to 8.0
If it is, we check if the last cell appears to contain a valid symbol,
and if so, we attempt to compose (combine) the last cell with the
current character, using utf8proc.
If the result is a combined character, we replace the content in the
previous cell with the new, combined character.
Thus, if you select and copy the printed character, you would get
e.g. "\u00e1" instead of "a\u0301".
This feature can be disabled. By default, it is enabled if the
utf8proc library is found, but can be explicitly disabled, or enabled,
with 'meson -Dunicode-combining=disabled|enabled'.
2020-04-27 12:13:30 +02:00
|
|
|
|
2020-04-24 20:32:37 +02:00
|
|
|
tllist = dependency('tllist', version: '>=1.0.1', fallback: 'tllist')
|
|
|
|
|
fcft = dependency('fcft', version: ['>=2.0.0', '<2.1.0'], fallback: 'fcft')
|
2019-12-01 16:11:35 +01:00
|
|
|
|
2019-06-12 20:08:54 +02:00
|
|
|
wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')
|
|
|
|
|
|
|
|
|
|
wscanner = dependency('wayland-scanner', native: true)
|
|
|
|
|
wscanner_prog = find_program(
|
|
|
|
|
wscanner.get_pkgconfig_variable('wayland_scanner'), native: true)
|
|
|
|
|
|
|
|
|
|
wl_proto_headers = []
|
|
|
|
|
wl_proto_src = []
|
|
|
|
|
foreach prot : [
|
|
|
|
|
wayland_protocols_datadir + '/stable/xdg-shell/xdg-shell.xml',
|
2019-08-30 17:55:45 +02:00
|
|
|
wayland_protocols_datadir + '/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml',
|
2019-08-12 21:22:38 +02:00
|
|
|
wayland_protocols_datadir + '/unstable/xdg-output/xdg-output-unstable-v1.xml',
|
2019-07-11 17:02:21 +02:00
|
|
|
wayland_protocols_datadir + '/unstable/primary-selection/primary-selection-unstable-v1.xml',
|
2019-12-31 15:39:40 +01:00
|
|
|
wayland_protocols_datadir + '/stable/presentation-time/presentation-time.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
|
|
|
|
|
|
unicode-combining: store seen combining chains "globally" in the term struct
Instead of storing combining data per cell, realize that most
combinations are re-occurring and that there's lots of available space
left in the unicode range, and store seen base+combining combinations
chains in a per-terminal array.
When we encounter a combining character, we first try to pre-compose,
like before. If that fails, we then search for the current
base+combining combo in the list of previously seen combinations. If
not found there either, we allocate a new combo and add it to the
list. Regardless, the result is an index into this array. We store
this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell.
When rendering, we need to check if the cell character is a plain
character, or if it's a composed character (identified by checking if
the cell character is >= COMB_CHARS_LO).
Then we render the grapheme pretty much like before.
2020-05-03 11:03:22 +02:00
|
|
|
if get_option('unicode-precompose')
|
2020-05-02 18:43:13 +02:00
|
|
|
generate_unicode_precompose_sh = files('scripts/generate-unicode-precompose.sh')
|
|
|
|
|
unicode_data = custom_target(
|
|
|
|
|
'unicode-data',
|
|
|
|
|
input: 'UnicodeData.txt',
|
|
|
|
|
output: 'unicode-compose-table.h',
|
|
|
|
|
command: [generate_unicode_precompose_sh, '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
else
|
|
|
|
|
unicode_data = []
|
|
|
|
|
endif
|
2020-05-02 18:29:39 +02:00
|
|
|
|
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',
|
|
|
|
|
command: [generate_version_sh, meson.project_version(), '@SOURCE_DIR@', '@OUTPUT@'])
|
|
|
|
|
|
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',
|
2019-07-19 11:11:25 +02:00
|
|
|
'base64.c', 'base64.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',
|
2019-06-15 22:22:44 +02:00
|
|
|
'csi.c', 'csi.h',
|
2020-01-12 11:55:22 +01:00
|
|
|
'dcs.c', 'dcs.h',
|
2019-10-27 11:46:18 +01:00
|
|
|
'fdm.c', 'fdm.h',
|
2019-06-17 19:33:10 +02:00
|
|
|
'grid.c', 'grid.h',
|
2019-06-19 10:04:47 +02:00
|
|
|
'input.c', 'input.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
'log.c', 'log.h',
|
|
|
|
|
'main.c',
|
2019-12-03 19:16:05 +01:00
|
|
|
'misc.c', 'misc.h',
|
2019-06-15 22:22:44 +02:00
|
|
|
'osc.c', 'osc.h',
|
2020-03-01 13:06:00 +01:00
|
|
|
'quirks.c', 'quirks.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',
|
2019-07-11 09:51:51 +02:00
|
|
|
'selection.c', 'selection.h',
|
2019-11-01 20:37:22 +01:00
|
|
|
'server.c', 'server.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
'shm.c', 'shm.h',
|
2020-02-21 21:53:23 +01:00
|
|
|
'sixel.c', 'sixel.h',
|
2020-02-22 21:18:55 +01:00
|
|
|
'sixel-hls.c', 'sixel-hls.h',
|
2019-06-13 15:19:10 +02:00
|
|
|
'slave.c', 'slave.h',
|
2019-06-29 21:03:28 +02:00
|
|
|
'terminal.c', 'terminal.h',
|
2019-07-17 09:46:45 +02:00
|
|
|
'tokenize.c', 'tokenize.h',
|
2019-06-15 22:22:44 +02:00
|
|
|
'vt.c', 'vt.h',
|
2019-10-27 15:57:23 +01:00
|
|
|
'wayland.c', 'wayland.h',
|
2020-05-02 18:29:39 +02:00
|
|
|
wl_proto_src + wl_proto_headers, version, unicode_data,
|
2020-05-02 17:29:00 +02:00
|
|
|
dependencies: [math, threads, pixman, wayland_client, wayland_cursor, xkb, tllist, fcft],
|
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',
|
|
|
|
|
'client.c',
|
2019-11-18 17:01:34 +01:00
|
|
|
'log.c', 'log.h', version,
|
2019-11-01 20:39:34 +01:00
|
|
|
install: true)
|
|
|
|
|
|
2019-07-18 14:00:33 +02:00
|
|
|
custom_target(
|
|
|
|
|
'terminfo',
|
|
|
|
|
output: 'f',
|
|
|
|
|
input: 'foot.info',
|
2019-07-21 20:46:17 +02:00
|
|
|
command: ['tic', '-x', '-o', '@OUTDIR@', '-e', 'foot,foot-direct', '@INPUT@'],
|
2019-07-18 14:00:33 +02:00
|
|
|
install: true,
|
|
|
|
|
install_dir: join_paths(get_option('datadir'), 'terminfo'))
|
|
|
|
|
|
2020-01-24 22:27:11 +01:00
|
|
|
install_data('foot.desktop', 'foot-server.desktop', install_dir: join_paths(get_option('datadir'), 'applications'))
|
2019-09-20 18:06:54 +02:00
|
|
|
install_data('footrc', install_dir: join_paths(get_option('datadir'), 'foot'))
|
2019-08-11 20:54:28 +02:00
|
|
|
|
2019-10-20 11:54:58 +02:00
|
|
|
subdir('completions')
|
2019-08-11 20:54:28 +02:00
|
|
|
subdir('doc')
|
2020-05-01 12:32:10 +02:00
|
|
|
|
|
|
|
|
summary(
|
|
|
|
|
{
|
unicode-combining: store seen combining chains "globally" in the term struct
Instead of storing combining data per cell, realize that most
combinations are re-occurring and that there's lots of available space
left in the unicode range, and store seen base+combining combinations
chains in a per-terminal array.
When we encounter a combining character, we first try to pre-compose,
like before. If that fails, we then search for the current
base+combining combo in the list of previously seen combinations. If
not found there either, we allocate a new combo and add it to the
list. Regardless, the result is an index into this array. We store
this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell.
When rendering, we need to check if the cell character is a plain
character, or if it's a composed character (identified by checking if
the cell character is >= COMB_CHARS_LO).
Then we render the grapheme pretty much like before.
2020-05-03 11:03:22 +02:00
|
|
|
'Unicode precompose': get_option('unicode-precompose'),
|
2020-05-01 12:32:10 +02:00
|
|
|
},
|
|
|
|
|
bool_yn: true
|
|
|
|
|
)
|