lvgl: Support both fbdev and wayland backends

The LVGL can be operated on top of fbdev as well as on WL compositor.
Support both, which is a matter of configuring lv-drivers package per
required backend. Determine the backend from DISTRO_FEATURES, since
both 'wayland' and 'fbdev' are valid DISTRO_FEATURES. Add a bit more
sed hacking of the configuration, which enables either FBDEV or WL
backend. One notable item here is the enablement of EVDEV support,
which is required for FBDEV backend, so in case FBDEV is enabled, so
is EVDEV.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Marek Vasut
2023-05-09 04:43:52 +02:00
committed by Khem Raj
parent 1278e8cfca
commit dbf8086926
2 changed files with 11 additions and 7 deletions
@@ -11,12 +11,15 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2"
SRC_URI = "git://github.com/lvgl/lv_drivers;protocol=https;branch=release/v8.3"
SRCREV = "71830257710f430b6d8d1c324f89f2eab52488f1"
DEPENDS = "libxkbcommon lvgl wayland"
DEPENDS = "lvgl"
REQUIRED_DISTRO_FEATURES = "wayland"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland fbdev', d)}"
PACKAGECONFIG[fbdev] = ",,"
PACKAGECONFIG[wayland] = ",,libxkbcommon wayland"
LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}"
LVGL_CONFIG_USE_WAYLAND = "${@bb.utils.contains('PACKAGECONFIG', 'wayland', '1', '0', d)}"
inherit cmake
inherit features_check
S = "${WORKDIR}/git"
@@ -34,7 +37,11 @@ TARGET_CFLAGS += "-I${STAGING_INCDIR}/lvgl"
do_configure:append() {
[ -r "${S}/lv_drv_conf.h" ] \
|| sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \
-e "s|# define USE_WAYLAND 0|# define USE_WAYLAND 1|g" \
\
-e "s|\(^# define USE_FBDEV \).*|# define USE_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
-e "s|\(^# define USE_EVDEV \).*|# define USE_EVDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
\
-e "s|\(^# define USE_WAYLAND \).*|# define USE_WAYLAND ${LVGL_CONFIG_USE_WAYLAND}|g" \
-e "s|\(^ *# *define *WAYLAND_HOR_RES *\).*|\1${LVGL_CONFIG_WAYLAND_HOR_RES}|g" \
-e "s|\(^ *# *define *WAYLAND_VER_RES *\).*|\1${LVGL_CONFIG_WAYLAND_VER_RES}|g" \
< "${S}/lv_drv_conf_template.h" > "${S}/lv_drv_conf.h"
@@ -11,10 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
SRC_URI = "git://github.com/lvgl/lvgl;protocol=https;branch=release/v8.3"
SRCREV = "2b56e04205481daa6575bd5f7ab5df59d11676eb"
REQUIRED_DISTRO_FEATURES = "wayland"
inherit cmake
inherit features_check
EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib}"
S = "${WORKDIR}/git"