unify build systems of buffyboard and unl0kr

This commit is contained in:
Vladimir Stoiakin 2024-09-25 15:56:19 +03:00
parent 20b084c0b4
commit ec21e5ead9
14 changed files with 120 additions and 147 deletions

View file

@ -9,8 +9,8 @@
#include "lvgl/lvgl.h"
#ifndef BB_VERSION
#define BB_VERSION "?" /* Just to silence IDE warning. Real version injected by meson during build. */
#ifndef PROJECT_VERSION
#define PROJECT_VERSION "?" /* Just to silence IDE warning. Real version injected by meson during build. */
#endif
#endif /* BB_BUFFYBOARD_H */

View file

@ -154,7 +154,7 @@ void bb_cli_parse_opts(int argc, char *argv[], bb_cli_opts *opts) {
opts->verbose = true;
break;
case 'V':
fprintf(stderr, "buffyboard %s\n", BB_VERSION);
fprintf(stderr, "buffyboard %s\n", PROJECT_VERSION);
exit(0);
default:
print_usage();

View file

@ -1,65 +0,0 @@
buffyboard(1) "buffyboard"
# NAME
BUFFYBOARD - Touch-enabled framebuffer keyboard (not only) for vampire slayers.
# SYNOPSIS
buffyboard [OPTION]
# DESCRIPTION
Buffyboard is a touch-enabled on-screen keyboard running on the Linux
framebuffer. It's primarily intended for vampire hunting but you can
also use it as a general purpose keyboard.
Buffyboard uses LVGL for input processing and rendering. Key events are
forwarded directly to the kernel via a uinput device. Since the latter
emulates a hardware keyboard, the terminal keymap must match with
buffyboard's layout or else on-screen keys might not produce the correct
result.
# OPTIONS
## Optional
*-C, --config-override*
Path to a config override file. Can be supplied multiple times. Config
files are merged in the following order:
- /usr/share/buffyboard/buffyboard.conf
- /usr/share/buffyboard/buffyboard.conf.d/\* (alphabetically)
- /etc/buffyboard.conf
- /etc/buffyboard.conf.d/\* (alphabetically)
- Override files (in supplied order)
*-g, --geometry=NxM[@X,Y]*
Force a display size of N horizontal times M vertical pixels, offset
horizontally by X pixels and vertically by Y pixels.
*-d --dpi=N*
Override the display's DPI value.
*-r, --rotate=[0-3]*
Rotate the UI to the given orientation. The
values match the ones provided by the kernel in
/sys/class/graphics/fbcon/rotate.
* 0 - normal orientation (0 degree)
* 1 - clockwise orientation (90 degrees)
* 2 - upside down orientation (180 degrees)
* 3 - counterclockwise orientation (270 degrees)
*-h, --help*
Print this message and exit.
*-v, --verbose*
Enable more detailed logging output on STDERR.
*-V, --version*
Print the unl0kr version and exit.
# EXAMPLES
*Execute Buffyboard using the default config*
buffyboard
# SEE ALSO
*buffyboard.conf*(5)
# AUTHORS
*Undef* <debian@undef.tools>

View file

@ -1,54 +0,0 @@
buffyboard(5) "buffyboard"
# NAME
BUFFYBOARD - configuration file
# DESCRIPTION
BUFFYBOARD expects a configuration file with options in the following format, with
one option/value pair per line:
```
[section]
<option>=<value>
```
On launch, BUFFYBOARD searches for configuration files in various locations and
successively merges all files together into a single configuration. Files are searched
for and, if found, merged in the following order:
- /usr/share/buffyboard/buffyboard.conf
- /usr/share/buffyboard/buffyboard.conf.d/ (alphabetically)
- /etc/buffyboard.conf
- /etc/buffyboard.conf.d/ (alphabetically)
- Override files (in supplied order)
# OPTIONS
## Theme
*default* = <adwaita-light|adwaita-dark|breezy-light|breezy-dark|nord-light|nord-dark|pmos-light|pmos-dark>
Selects the default theme on boot. Can be changed at runtime to the
alternative theme. Default: breezy-dark.
## Input
*pointer* = <true|false>
Enable or disable the use of a hardware mouse or other pointing device.
Default: true.
*touchscreen* = <true|false>
Enable or disable the use of the touchscreen.
Default: true.
## Quirks
*fbdev_force_refresh* = <true|false>
If true and using the framebuffer backend, this triggers a display refresh
after every draw operation. This has a negative performance impact.
Default: false.
# SEE ALSO
*buffyboard*(1)
# AUTHORS
*Undef* <debian@undef.tools>
*Johannes Marbach* <n0-0ne@mailbox.org>

View file

@ -1,68 +1,26 @@
# Copyright 2021 Johannes Marbach
# SPDX-License-Identifier: GPL-3.0-or-later
buffyboard_sources = [
'command_line.c',
'config.c',
'main.c',
'sq2lv_layouts.c',
'terminal.c',
'uinput_device.c',
]
shared_sources = [
'../shared/cursor/cursor.c',
'../shared/fonts/font_32.c',
'../shared/config.c',
'../shared/indev.c',
'../shared/log.c',
'../shared/theme.c',
'../shared/themes.c',
]
squeek2lvgl_sources = [
'../squeek2lvgl/sq2lv.c',
]
man_files = [
'doc/buffyboard.1',
'doc/buffyboard.conf.5',
]
lvgl_sources = run_command('../find-lvgl-sources.sh', '../lvgl', check: true).stdout().strip().split('\n')
install_data(sources: 'buffyboard.conf', install_dir : get_option('sysconfdir'))
executable(
'buffyboard',
sources: buffyboard_sources + shared_sources + squeek2lvgl_sources + lvgl_sources,
include_directories: ['..'],
dependencies: [
dependency('inih'),
dependency('libinput'),
dependency('libudev'),
meson.get_compiler('c').find_library('m', required: false),
],
install: true
buffyboard_sources = files(
'command_line.c',
'config.c',
'main.c',
'sq2lv_layouts.c',
'terminal.c',
'uinput_device.c'
)
scdoc = dependency('scdoc')
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native : true)
sh = find_program('sh', native : true)
foreach file : man_files
filename = file + '.scd'
section = file.split('.')[-1]
topic = file.split('.' + section)[-2].split('/')[-1]
output = '@0@.@1@'.format(topic, section)
buffyboard_dependencies = [
common_dependencies,
meson.get_compiler('c').find_library('m', required: false)
]
executable('buffyboard',
include_directories: common_include_dirs,
sources: buffyboard_sources + shared_sources + squeek2lvgl_sources + lvgl_sources,
dependencies: buffyboard_dependencies,
install: true
)
install_data('buffyboard.conf', install_dir: get_option('sysconfdir'))
custom_target(
output,
input : filename,
output : output,
capture : true,
command : [sh, '-c', scdoc_prog.path() + ' < @INPUT@'],
install : true,
install_dir : get_option('mandir') / 'man' + section
)
endforeach