diff --git a/README.md b/README.md index 8fe3ab2..da3d587 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ On distributions based on systemd, `unl0kr` can be used as a [password agent](ht # systemd-ask-password --no-tty # Unl0kr is started ``` -**Note**: SDL2 can be used as display backend for development purposes by setting the Meson option `developer` and use `backend=sdl` in the configuration file. +**Note**: SDL can be used as a display backend for development purposes by setting the Meson option `lvgl_backends=sdl` and using `backend=sdl` in the configuration file. Other uses besides development are not supported by Buffybox. ## Packaging @@ -121,3 +121,4 @@ For the license of bundled images and fonts, see [shared/cursor] and [shared/fon [shared/fonts]: ./shared/fonts [unl0kr]: ./unl0kr [unl0kr#42]: https://gitlab.com/cherrypicker/unl0kr/-/issues/42 +[f0rmz]: ./f0rmz diff --git a/buffyboard/meson.build b/buffyboard/meson.build index 258ebff..ffe347d 100644 --- a/buffyboard/meson.build +++ b/buffyboard/meson.build @@ -11,8 +11,7 @@ buffyboard_sources = files( ) buffyboard_dependencies = [ - common_dependencies, - meson.get_compiler('c').find_library('m', required: false) + common_dependencies ] buffyboard_args = [ diff --git a/f0rmz/lv_conf.defaults b/f0rmz/lv_conf.defaults index b759e56..1e23d80 100644 --- a/f0rmz/lv_conf.defaults +++ b/f0rmz/lv_conf.defaults @@ -1,9 +1,11 @@ # SPDX-License-Identifier: GPL-3.0-or-later # Manual post-processing steps for the generated lv_conf.h -# 1. Comment LV_USE_LINUX_DRM (handled by meson.build) -# 2. Comment LV_BIG_ENDIAN_SYSTEM (handled by meson.build) -# 3. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py) +# 1. Comment LV_USE_SDL +# LV_USE_LINUX_FBDEV +# LV_USE_LINUX_DRM +# LV_BIG_ENDIAN_SYSTEM (handled by meson.build) +# 2. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py) LV_COLOR_DEPTH 32 LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB @@ -106,7 +108,9 @@ LV_USE_GRID 0 LV_USE_OBSERVER 0 -LV_USE_LINUX_FBDEV 1 +LV_USE_SDL 0 + +LV_USE_LINUX_FBDEV 0 LV_LINUX_FBDEV_BSD 0 LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT diff --git a/f0rmz/lv_conf.h b/f0rmz/lv_conf.h index 45f0993..156d953 100644 --- a/f0rmz/lv_conf.h +++ b/f0rmz/lv_conf.h @@ -1251,7 +1251,7 @@ *==================*/ /** Use SDL to open window on PC and handle mouse and keyboard. */ -#define LV_USE_SDL 0 +//#define LV_USE_SDL 0 #if LV_USE_SDL #define LV_SDL_INCLUDE_PATH #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /**< LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance */ @@ -1280,7 +1280,7 @@ #endif /** Driver for /dev/fb */ -#define LV_USE_LINUX_FBDEV 1 +//#define LV_USE_LINUX_FBDEV 0 #if LV_USE_LINUX_FBDEV #define LV_LINUX_FBDEV_BSD 0 #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT diff --git a/f0rmz/meson.build b/f0rmz/meson.build index fb266f1..b29c0e1 100644 --- a/f0rmz/meson.build +++ b/f0rmz/meson.build @@ -15,16 +15,21 @@ f0rmz_dependencies = [ f0rmz_args = [] -deplibdrm = dependency('libdrm', required: get_option('with-drm')) -if deplibdrm.found() - f0rmz_dependencies += deplibdrm +if get_option('lvgl_backends').contains('framebuffer') + f0rmz_args += '-DLV_USE_LINUX_FBDEV=1' +else + f0rmz_args += '-DLV_USE_LINUX_FBDEV=0' +endif + +if get_option('lvgl_backends').contains('drm') + f0rmz_dependencies += dependency('libdrm') f0rmz_args += '-DLV_USE_LINUX_DRM=1' else f0rmz_args += '-DLV_USE_LINUX_DRM=0' endif -if deplibsdl.found() - f0rmz_dependencies += deplibsdl +if get_option('lvgl_backends').contains('sdl') + f0rmz_dependencies += dependency('sdl2') f0rmz_args += '-DLV_USE_SDL=1' else f0rmz_args += '-DLV_USE_SDL=0' diff --git a/man/unl0kr.conf.5.scd b/man/unl0kr.conf.5.scd index e202bfc..5471f5f 100644 --- a/man/unl0kr.conf.5.scd +++ b/man/unl0kr.conf.5.scd @@ -29,8 +29,8 @@ for and, if found, merged in the following order: *animations* = Enable or disable animations. Useful for slower devices. Default: false. -*backend* = - The rendering backend to use. Default: fbdev. +*backend* = + The rendering backend to use. Default: the first compiled backend from the list above. *timeout* = The time in seconds before unl0kr will consider the entry a failure diff --git a/meson.build b/meson.build index b803483..4d2e6e7 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,6 @@ depinih = dependency('inih') deplibinput = dependency('libinput') deplibudev = dependency('libudev') depxkbcommon = dependency('xkbcommon') # For unl0kr and f0rmz only -deplibsdl = dependency('sdl2', required: get_option('developer')) if get_option('man') depscdoc = dependency('scdoc', native: true) diff --git a/meson_options.txt b/meson_options.txt index 915beb0..7c6db77 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,7 @@ -option('with-drm', type: 'feature', value: 'auto', description: 'Enable DRM backend') -option('developer', type: 'feature', value: 'auto', description: 'Enable developer features') +option('lvgl_backends', type: 'array', choices: ['framebuffer', 'drm', 'sdl'], value: ['framebuffer', 'drm']) + option('man', type: 'boolean', value: true, description: 'Install manual pages') + option('systemd-buffyboard-service', type: 'feature', value: 'auto', description: 'Install systemd service file for buffyboard') + option('systemd-password-agent', type: 'feature', value: 'auto', description: 'Build a systemd password agent for touchscreens') diff --git a/test/build-with-drm.sh b/test/build-with-drm.sh index 114a085..4ed6c26 100755 --- a/test/build-with-drm.sh +++ b/test/build-with-drm.sh @@ -1,5 +1,5 @@ #!/bin/bash rm -rf _build -meson _build +meson setup _build -Dlvgl_backends=framebuffer,drm meson compile -C _build diff --git a/test/build-without-drm.sh b/test/build-without-drm.sh index 7e4a17c..bc019c7 100755 --- a/test/build-without-drm.sh +++ b/test/build-without-drm.sh @@ -1,5 +1,5 @@ #!/bin/bash rm -rf _build -meson _build -Dwith-drm=disabled +meson setup _build -Dlvgl_backends=framebuffer meson compile -C _build diff --git a/unl0kr/lv_conf.defaults b/unl0kr/lv_conf.defaults index b759e56..1e23d80 100644 --- a/unl0kr/lv_conf.defaults +++ b/unl0kr/lv_conf.defaults @@ -1,9 +1,11 @@ # SPDX-License-Identifier: GPL-3.0-or-later # Manual post-processing steps for the generated lv_conf.h -# 1. Comment LV_USE_LINUX_DRM (handled by meson.build) -# 2. Comment LV_BIG_ENDIAN_SYSTEM (handled by meson.build) -# 3. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py) +# 1. Comment LV_USE_SDL +# LV_USE_LINUX_FBDEV +# LV_USE_LINUX_DRM +# LV_BIG_ENDIAN_SYSTEM (handled by meson.build) +# 2. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py) LV_COLOR_DEPTH 32 LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB @@ -106,7 +108,9 @@ LV_USE_GRID 0 LV_USE_OBSERVER 0 -LV_USE_LINUX_FBDEV 1 +LV_USE_SDL 0 + +LV_USE_LINUX_FBDEV 0 LV_LINUX_FBDEV_BSD 0 LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT diff --git a/unl0kr/lv_conf.h b/unl0kr/lv_conf.h index 45f0993..156d953 100644 --- a/unl0kr/lv_conf.h +++ b/unl0kr/lv_conf.h @@ -1251,7 +1251,7 @@ *==================*/ /** Use SDL to open window on PC and handle mouse and keyboard. */ -#define LV_USE_SDL 0 +//#define LV_USE_SDL 0 #if LV_USE_SDL #define LV_SDL_INCLUDE_PATH #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /**< LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance */ @@ -1280,7 +1280,7 @@ #endif /** Driver for /dev/fb */ -#define LV_USE_LINUX_FBDEV 1 +//#define LV_USE_LINUX_FBDEV 0 #if LV_USE_LINUX_FBDEV #define LV_LINUX_FBDEV_BSD 0 #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT diff --git a/unl0kr/meson.build b/unl0kr/meson.build index 1b70b34..f25d902 100644 --- a/unl0kr/meson.build +++ b/unl0kr/meson.build @@ -15,16 +15,21 @@ unl0kr_dependencies = [ unl0kr_args = [] -deplibdrm = dependency('libdrm', required: get_option('with-drm')) -if deplibdrm.found() - unl0kr_dependencies += deplibdrm +if get_option('lvgl_backends').contains('framebuffer') + unl0kr_args += '-DLV_USE_LINUX_FBDEV=1' +else + unl0kr_args += '-DLV_USE_LINUX_FBDEV=0' +endif + +if get_option('lvgl_backends').contains('drm') + unl0kr_dependencies += dependency('libdrm') unl0kr_args += '-DLV_USE_LINUX_DRM=1' else unl0kr_args += '-DLV_USE_LINUX_DRM=0' endif -if deplibsdl.found() - unl0kr_dependencies += deplibsdl +if get_option('lvgl_backends').contains('sdl') + unl0kr_dependencies += dependency('sdl2') unl0kr_args += '-DLV_USE_SDL=1' else unl0kr_args += '-DLV_USE_SDL=0'