mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
lvgl: Use Kconfig to configure
This switches the recipe from manipulating the lv_conf.h file directly, to instead using Kconfig to configure lvgl. * Drop configuration of LV_TICK_CUSTOM* as they were removed in 9.0.0. * Drop configuration options that match their defaults. Co-authored-by: Adam x Nilsson <adam.x.nilsson@axis.com> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
9c201b0f85
commit
1c1c5c5633
3
meta-oe/recipes-graphics/lvgl/files/debug.cfg
Normal file
3
meta-oe/recipes-graphics/lvgl/files/debug.cfg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
CONFIG_LV_USE_ASSERT_STYLE=y
|
||||
CONFIG_LV_USE_ASSERT_MEM_INTEGRITY=y
|
||||
CONFIG_LV_USE_ASSERT_OBJ=y
|
||||
1
meta-oe/recipes-graphics/lvgl/files/defconfig
Normal file
1
meta-oe/recipes-graphics/lvgl/files/defconfig
Normal file
|
|
@ -0,0 +1 @@
|
|||
CONFIG_LV_COLOR_DEPTH_32=y
|
||||
2
meta-oe/recipes-graphics/lvgl/files/drm.cfg
Normal file
2
meta-oe/recipes-graphics/lvgl/files/drm.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
CONFIG_LV_USE_LINUX_DRM=y
|
||||
CONFIG_LV_USE_EVDEV=y
|
||||
2
meta-oe/recipes-graphics/lvgl/files/fbdev.cfg
Normal file
2
meta-oe/recipes-graphics/lvgl/files/fbdev.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
CONFIG_LV_USE_LINUX_FBDEV=y
|
||||
CONFIG_LV_USE_EVDEV=y
|
||||
1
meta-oe/recipes-graphics/lvgl/files/gridnav.cfg
Normal file
1
meta-oe/recipes-graphics/lvgl/files/gridnav.cfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
CONFIG_LV_USE_GRIDNAV=y
|
||||
3
meta-oe/recipes-graphics/lvgl/files/sdl.cfg
Normal file
3
meta-oe/recipes-graphics/lvgl/files/sdl.cfg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
CONFIG_LV_USE_DRAW_SDL=y
|
||||
CONFIG_LV_USE_SDL=y
|
||||
CONFIG_LV_SDL_DOUBLE_BUFFER=y
|
||||
3
meta-oe/recipes-graphics/lvgl/files/thorvg.cfg
Normal file
3
meta-oe/recipes-graphics/lvgl/files/thorvg.cfg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
CONFIG_LV_USE_VECTOR_GRAPHIC=y
|
||||
CONFIG_LV_USE_LOTTIE=y
|
||||
CONFIG_LV_USE_THORVG=y
|
||||
|
|
@ -1,3 +1,18 @@
|
|||
# SPDX-FileCopyrightText: Axis Communication AB <https://www.axis.com/>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
DEPENDS += "python3-kconfiglib-native python3-pcpp-native"
|
||||
|
||||
SRC_URI += " \
|
||||
file://defconfig \
|
||||
${@oe.utils.vartrue('DEBUG_BUILD', 'file://debug.cfg', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'drm', 'file://drm.cfg', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'fbdev', 'file://fbdev.cfg', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'gridnav', 'file://gridnav.cfg', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'sdl', 'file://sdl.cfg', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'thorvg', 'file://thorvg.cfg', '', d)} \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ??= "drm"
|
||||
|
||||
PACKAGECONFIG[drm] = ",,libdrm libevdev"
|
||||
|
|
@ -6,6 +21,10 @@ PACKAGECONFIG[gridnav] = ",,"
|
|||
PACKAGECONFIG[thorvg] = ",,"
|
||||
PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
|
||||
|
||||
inherit python3native
|
||||
|
||||
EXTRA_OECMAKE += "-DLV_BUILD_USE_KCONFIG=ON"
|
||||
|
||||
# Add libdrm include if drm is selected in PACKAGECONFIG
|
||||
LVGL_FLAGS += " \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'drm', '-I${STAGING_INCDIR}/libdrm', '', d)} \
|
||||
|
|
@ -13,86 +32,13 @@ LVGL_FLAGS += " \
|
|||
CFLAGS += "${LVGL_FLAGS}"
|
||||
CXXFLAGS += "${LVGL_FLAGS}"
|
||||
|
||||
LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}"
|
||||
KCONFIG_CONFIG_ROOTDIR ?= "${S}"
|
||||
KCONFIG_FILE ?= "${KCONFIG_CONFIG_ROOTDIR}/Kconfig"
|
||||
export KCONFIG_CONFIG ?= "${KCONFIG_CONFIG_ROOTDIR}/.config"
|
||||
|
||||
LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev', '1', '0', d)}"
|
||||
do_configure() {
|
||||
cat ${UNPACKDIR}/defconfig ${@" ".join(find_cfgs(d))} > ${B}/defconfig
|
||||
defconfig --kconfig ${KCONFIG_FILE} ${B}/defconfig
|
||||
|
||||
LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}"
|
||||
|
||||
LVGL_CONFIG_USE_SDL = "${@bb.utils.contains('PACKAGECONFIG', 'sdl', '1', '0', d)}"
|
||||
|
||||
LVGL_CONFIG_SDL_FULLSCREEN ?= "0"
|
||||
|
||||
LVGL_CONFIG_LV_MEM_CUSTOM ?= "0"
|
||||
LVGL_CONFIG_LV_MEM_SIZE ?= "(64 * 1024U)"
|
||||
LVGL_CONFIG_LV_COLOR_DEPTH ?= "32"
|
||||
|
||||
LVGL_CONFIG_LV_USE_LOG ?= "0"
|
||||
LVGL_CONFIG_LV_LOG_LEVEL ?= "LV_LOG_LEVEL_WARN"
|
||||
LVGL_CONFIG_LV_LOG_PRINTF ?= "0"
|
||||
|
||||
LVGL_CONFIG_LV_USE_FONT_COMPRESSED ?= "0"
|
||||
|
||||
LVGL_CONFIG_LV_USE_GRIDNAV = "${@bb.utils.contains('PACKAGECONFIG', 'gridnav', '1', '0', d)}"
|
||||
|
||||
LVGL_CONFIG_LV_THEME_DEFAULT_DARK ?= "0"
|
||||
|
||||
LVGL_CONFIG_USE_LOTTIE = "${@bb.utils.contains('PACKAGECONFIG', 'thorvg', '1', '0', d)}"
|
||||
|
||||
LVGL_CONFIG_USE_VECTOR_GRAPHICS = "${@bb.utils.contains('PACKAGECONFIG', 'thorvg', '1', '0', d)}"
|
||||
|
||||
LVGL_CONFIG_USE_THORVG_INTERNAL = "${@bb.utils.contains('PACKAGECONFIG', 'thorvg', '1', '0', d)}"
|
||||
|
||||
LVGL_CONFIG_USE_MATRIX = "${@bb.utils.contains('PACKAGECONFIG', 'thorvg', '1', '0', d)}"
|
||||
|
||||
LVGL_CONFIG_USE_FLOAT = "${@bb.utils.contains('PACKAGECONFIG', 'thorvg', '1', '0', d)}"
|
||||
|
||||
DEBUG_BUILD ??= "0"
|
||||
|
||||
do_configure:prepend() {
|
||||
# If there is a configuration template, start from that
|
||||
[ -r "${S}/lv_conf_template.h" ] && cp -Lv "${S}/lv_conf_template.h" "${S}/lv_conf.h"
|
||||
|
||||
sed -r -e "s|#if 0 .*Set it to \"1\" to enable content.*|#if 1 // Enabled by ${PN}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_LINUX_DRM[[:space:]]).*|\1${LVGL_CONFIG_USE_DRM}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_LINUX_FBDEV[[:space:]]).*|\1${LVGL_CONFIG_USE_FBDEV}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_SDL[[:space:]]).*|\1${LVGL_CONFIG_USE_SDL}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_DRAW_SDL[[:space:]]).*|\1${LVGL_CONFIG_USE_SDL}|" \
|
||||
-e "s|^([[:space:]]*#define LV_SDL_BUF_COUNT[[:space:]]).*|\1 2|" \
|
||||
-e "s|^([[:space:]]*#define LV_SDL_FULLSCREEN[[:space:]]).*|\1${LVGL_CONFIG_SDL_FULLSCREEN}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_COLOR_DEPTH[[:space:]]).*|\1${LVGL_CONFIG_LV_COLOR_DEPTH}|" \
|
||||
-e "s|^([[:space:]]*#define LV_MEM_CUSTOM[[:space:]]).*|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|" \
|
||||
-e "s|^([[:space:]]*#define LV_MEM_SIZE[[:space:]]).*|\1${LVGL_CONFIG_LV_MEM_SIZE}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_TICK_CUSTOM[[:space:]]).*|\1 1|" \
|
||||
-e "s|^([[:space:]]*#define LV_TICK_CUSTOM_INCLUDE[[:space:]]).*|\1 <stdint.h>|" \
|
||||
-e "s|^([[:space:]]*#define LV_TICK_CUSTOM_SYS_TIME_EXPR[[:space:]]).*|extern uint32_t custom_tick_get(void);\n\1 (custom_tick_get())|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_EVDEV[[:space:]]).*|\1${LVGL_CONFIG_USE_EVDEV}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_ASSERT_NULL[[:space:]]).*|\1${DEBUG_BUILD}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_ASSERT_MALLOC[[:space:]]).*|\1${DEBUG_BUILD}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_ASSERT_STYLE[[:space:]]).*|\1${DEBUG_BUILD}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_ASSERT_MEM_INTEGRITY[[:space:]]).*|\1${DEBUG_BUILD}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_ASSERT_OBJ[[:space:]]).*|\1${DEBUG_BUILD}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_LOG[[:space:]]).*|\1${LVGL_CONFIG_LV_USE_LOG}|" \
|
||||
-e "s|^([[:space:]]*#define LV_LOG_LEVEL[[:space:]]).*|\1${LVGL_CONFIG_LV_LOG_LEVEL}|" \
|
||||
-e "s|^([[:space:]]*#define LV_LOG_PRINTF[[:space:]]).*|\1${LVGL_CONFIG_LV_LOG_PRINTF}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_FONT_COMPRESSED[[:space:]]).*|\1${LVGL_CONFIG_LV_USE_FONT_COMPRESSED}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_GRIDNAV[[:space:]]).*|\1${LVGL_CONFIG_LV_USE_GRIDNAV}|" \
|
||||
-e "s|^([[:space:]]*#define LV_THEME_DEFAULT_DARK[[:space:]]).*|\1${LVGL_CONFIG_LV_THEME_DEFAULT_DARK}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_VECTOR_GRAPHIC[[:space:]]).*|\1${LVGL_CONFIG_USE_VECTOR_GRAPHICS}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_THORVG_INTERNAL[[:space:]]).*|\1${LVGL_CONFIG_USE_THORVG_INTERNAL}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_MATRIX[[:space:]]).*|\1${LVGL_CONFIG_USE_MATRIX}|" \
|
||||
-e "s|^([[:space:]]*#define LV_USE_FLOAT[[:space:]]).*|\1${LVGL_CONFIG_USE_FLOAT}|" \
|
||||
\
|
||||
-e "s|^([[:space:]]*#define LV_USE_LOTTIE[[:space:]]).*|\1${LVGL_CONFIG_USE_LOTTIE}|" \
|
||||
-i "${S}/lv_conf.h"
|
||||
cmake_do_configure
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user