Skip to contentSkip to conversation

python3-pcpp: Add recipe for https://github.com/ned14/pcpp

PATCH In review Peter Kjellerstedt 3 participants 11 messages Oct 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 python3-pcpp: Add recipe for https://github.com/ned14/pcpp

From: Adam x Nilsson <[email protected]>

It will be needed by lvgl.

---
 .../packagegroups/packagegroup-meta-oe.bb           |  1 +
 .../recipes-devtools/python/python3-pcpp_1.30.bb    | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/python/python3-pcpp_1.30.bb
meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb +1 -0
index eee4e096a9..b331fbebe1 100644
@@ -280,6 +280,7 @@ RDEPENDS:packagegroup-meta-oe-devtools = "\
     protobuf-c \
     pugixml \
     python3-distutils-extra \
+    python3-pcpp \
     python3-pycups \
     rapidjson \
     serialcheck \
meta-oe/recipes-devtools/python/python3-pcpp_1.30.bb new file +13 -0
new file mode 100644
index 0000000000..97891f4250
@@ -0,0 +1,13 @@
+SUMMARY = "A C99 preprocessor written in pure Python"
+HOMEPAGE = "https://github.com/ned14/pcpp"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=d3c12e3df3b040ebb89409b40ff32b3a"
+
+SRC_URI[sha256sum] = "5af9fbce55f136d7931ae915fae03c34030a3b36c496e72d9636cedc8e2543a1"
+
+inherit pypi setuptools3
+
+RDEPENDS:${PN} = "python3-doctest python3-pickle"
+
+BBCLASSEXTEND = "native"
#1 lore raw

PATCH 2/9 python3-kconfiglib: Move to meta-oe

It will be needed by lvgl.

---
 meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb       | 1 +
 .../recipes-devtools/python/python3-kconfiglib_14.1.0.bb         | 0
 .../recipes-core/packagegroups/packagegroup-meta-python.bb       | 1 -
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {meta-python => meta-oe}/recipes-devtools/python/python3-kconfiglib_14.1.0.bb (100%)
meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb +1 -0
index b331fbebe1..0458662f97 100644
@@ -280,6 +280,7 @@ RDEPENDS:packagegroup-meta-oe-devtools = "\
     protobuf-c \
     pugixml \
     python3-distutils-extra \
+    python3-kconfiglib \
     python3-pcpp \
     python3-pycups \
     rapidjson \
meta-oe/recipes-devtools/python/python3-kconfiglib_14.1.0.bb renamed from meta-python/recipes-devtools/python/python3-kconfiglib_14.1.0.bb +0 -0
similarity index 100%
rename from meta-python/recipes-devtools/python/python3-kconfiglib_14.1.0.bb
rename to meta-oe/recipes-devtools/python/python3-kconfiglib_14.1.0.bb
meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb +0 -1
index 21b79b9c50..9b06096d1d 100644
@@ -210,7 +210,6 @@ RDEPENDS:packagegroup-meta-python3 = "\
     python3-jsonref \
     python3-jsonschema \
     python3-jstyleson \
-    python3-kconfiglib \
     python3-keras-applications \
     python3-keras-preprocessing \
     ${@bb.utils.contains("DISTRO_FEATURES", "x11 opengl", "python3-kivy", "", d)} \
#2 lore raw

PATCH 3/9 lvgl: Update to 9.4.0

In reply to Peter Kjellerstedt

Drop manual installation of lv_conf.h. It has not been needed since at least 9.2.2.

License-Update: Copyright year updated to 2025

---
 meta-oe/recipes-graphics/lvgl/lv-conf.inc   | 12 +++++-----
 meta-oe/recipes-graphics/lvgl/lvgl_9.2.2.bb | 25 ---------------------
 meta-oe/recipes-graphics/lvgl/lvgl_9.4.0.bb | 20 +++++++++++++++++
 3 files changed, 26 insertions(+), 31 deletions(-)
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_9.2.2.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_9.4.0.bb
meta-oe/recipes-graphics/lvgl/lv-conf.inc +6 -6
index 69e42af922..d341c8a6da 100644
@@ -7,7 +7,11 @@ PACKAGECONFIG[thorvg] = ",,"
 PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
 
 # Add libdrm include if drm is selected in PACKAGECONFIG
-TARGET_CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'drm', '-I${STAGING_INCDIR}/libdrm', '', d)}"
+LVGL_FLAGS += " \
+    ${@bb.utils.contains('PACKAGECONFIG', 'drm', '-I${STAGING_INCDIR}/libdrm', '', d)} \
+"
+CFLAGS += "${LVGL_FLAGS}"
+CXXFLAGS += "${LVGL_FLAGS}"
 
 LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}"
 
@@ -45,11 +49,7 @@ LVGL_CONFIG_USE_FLOAT = "${@bb.utils.contains('PACKAGECONFIG', 'thorvg', '1', '0
 
 DEBUG_BUILD ??= "0"
 
-ALLOW_EMPTY:${PN} = "1"
-
-EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}"
-
-do_configure:append() {
+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"
 
meta-oe/recipes-graphics/lvgl/lvgl_9.2.2.bb deleted +0 -25
deleted file mode 100644
index 28306a1101..0000000000
@@ -1,25 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: MIT
-
-HOMEPAGE = "https://lvgl.io/"
-DESCRIPTION = "LVGL is an OSS graphics library to create embedded GUI"
-SUMMARY = "Light and Versatile Graphics Library"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
-
-SRC_URI = "\
-	git://github.com/lvgl/lvgl;protocol=https;branch=release/v9.2 \
-    file://0001-thorvg-fix-build-with-gcc-15.patch \
-	"
-SRCREV = "7f07a129e8d77f4984fff8e623fd5be18ff42e74"
-
-inherit cmake
-
-EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
-
-require lv-conf.inc
-
-do_install:append() {
-    install -m 0644 "${S}/lv_conf.h" "${D}${includedir}/${BPN}/lv_conf.h"
-}
meta-oe/recipes-graphics/lvgl/lvgl_9.4.0.bb new file +20 -0
new file mode 100644
index 0000000000..04ee34a61f
@@ -0,0 +1,20 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: MIT
+
+SUMMARY = "Light and Versatile Graphics Library"
+DESCRIPTION = "LVGL is an OSS graphics library to create embedded GUIs."
+HOMEPAGE = "https://lvgl.io/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=4570b6241b4fced1d1d18eb691a0e083"
+
+SRC_URI = "git://github.com/lvgl/lvgl;protocol=https;branch=release/v9.4;tag=v9.4.0"
+
+SRCREV = "c016f72d4c125098287be5e83c0f1abed4706ee5"
+
+inherit cmake
+
+EXTRA_OECMAKE += "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
+
+require lv-conf.inc
#3 lore raw

PATCH 4/9 lvgl-demo-fb: Update to 9.4.0

In reply to Peter Kjellerstedt

* Add +git to PV since there is no v9.4.0 tag for the lv_port_linux_frame_buffer repository.
* Do not run the default do_install() as it will install all of lvgl.
* Remove the hack in do_configure:prepend() for SDL2_image as cmake (with a little help from pkg-config) now finds SDL2_image correctly.

License-Update: Copyright year updated to 2025

---
 .../0001-thorvg-fix-build-with-gcc-15.patch   | 32 ----------------
 meta-oe/recipes-graphics/lvgl/lv-conf.inc     |  4 +-
 .../lvgl/lvgl-demo-fb_9.2.2.bb                | 38 -------------------
 .../lvgl/lvgl-demo-fb_9.4.0.bb                | 33 ++++++++++++++++
 4 files changed, 35 insertions(+), 72 deletions(-)
 delete mode 100644 meta-oe/recipes-graphics/lvgl/files/0001-thorvg-fix-build-with-gcc-15.patch
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.2.2.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.4.0.bb
meta-oe/recipes-graphics/lvgl/files/0001-thorvg-fix-build-with-gcc-15.patch deleted +0 -32
deleted file mode 100644
index e61b5224aa..0000000000
@@ -1,32 +0,0 @@
-From a9e41f7e9590c757e74877cace6442dd676223ff Mon Sep 17 00:00:00 2001
-From: Martin Jansa <[email protected]>
-Date: Fri, 21 Mar 2025 10:25:43 +0000
-Subject: [PATCH] thorvg: fix build with gcc-15
-
-* add missing include to fix:
-  src/libs/thorvg/thorvg.h:357:20: error: 'uint8_t' has not been declared
-  357 |     Result opacity(uint8_t o) noexcept;
-      |                    ^~~~~~~
-
-* not needed with latest master where it was resolved differently in
-  fc5c15638 feat(thorvg): use LVGL's malloc/realloc/zalloc/free (#7772)
-  which includes stdlib/lv_string.h which includes misc/lv_types.h which
-  includes stdint
-
-Upstream-Status: Pending [not needed with latest master where it was resolved differently in fc5c15638 feat(thorvg): use LVGL's malloc/realloc/zalloc/free (#7772)]
-
-Signed-off-by: Martin Jansa <[email protected]>
----
- src/libs/thorvg/thorvg.h | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/src/libs/thorvg/thorvg.h
-+++ b/src/libs/thorvg/thorvg.h
-@@ -12,6 +12,7 @@
- #define TVG_BUILD 1
- 
- 
-+#include <cstdint>
- #include <functional>
- #include <memory>
- #include <string>
meta-oe/recipes-graphics/lvgl/lv-conf.inc +2 -2
index d341c8a6da..7c16eb3936 100644
@@ -1,7 +1,7 @@
 PACKAGECONFIG ??= "drm"
 
-PACKAGECONFIG[drm] = ",,libdrm"
-PACKAGECONFIG[fbdev] = ",,"
+PACKAGECONFIG[drm] = ",,libdrm libevdev"
+PACKAGECONFIG[fbdev] = ",,libevdev"
 PACKAGECONFIG[gridnav] = ",,"
 PACKAGECONFIG[thorvg] = ",,"
 PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.2.2.bb deleted +0 -38
deleted file mode 100644
index ede5c16f3f..0000000000
@@ -1,38 +0,0 @@
-SUMMARY = "LVGL Demo Application for Framebuffer"
-HOMEPAGE = "https://github.com/lvgl/lv_port_linux_frame_buffer"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \
-                    file://lvgl/LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
-
-SRC_URI = "\
-	git://github.com/lvgl/lv_port_linux_frame_buffer.git;protocol=https;branch=release/v9.2;name=demo \
-	git://github.com/lvgl/lvgl;protocol=https;branch=release/v9.2;name=lvgl;subdir=${BB_GIT_DEFAULT_DESTSUFFIX}/lvgl \
-	file://0001-thorvg-fix-build-with-gcc-15.patch;patchdir=lvgl \
-	"
-SRCREV_demo = "c924e24c7aa55317521bcd9dd75ce9337508f5a5"
-SRCREV_lvgl = "7f07a129e8d77f4984fff8e623fd5be18ff42e74"
-SRCREV_FORMAT = "demo_lvgl"
-
-EXTRA_OEMAKE = "DESTDIR=${D}"
-
-LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0"
-LVGL_CONFIG_LV_USE_LOG    = "1"
-LVGL_CONFIG_LV_LOG_PRINTF = "1"
-LVGL_CONFIG_LV_MEM_SIZE = "(256 * 1024U)"
-LVGL_CONFIG_LV_USE_FONT_COMPRESSED = "1"
-require lv-conf.inc
-
-inherit cmake
-
-
-do_configure:prepend() {
-	if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then
-		# Add libsdl build dependency, SDL2_image has no cmake file
-		sed -i '/^target_link_libraries/ s@pthread@& SDL2_image@' "${S}/CMakeLists.txt"
-	fi
-}
-
-do_install:append() {
-	install -d ${D}${bindir}
-	install -m 0755 ${S}/bin/main ${D}${bindir}/lvgl
-}
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.4.0.bb new file +33 -0
new file mode 100644
index 0000000000..3185d37c5c
@@ -0,0 +1,33 @@
+SUMMARY = "LVGL Demo Application for Framebuffer"
+HOMEPAGE = "https://github.com/lvgl/lv_port_linux_frame_buffer"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \
+                    file://lvgl/LICENCE.txt;md5=4570b6241b4fced1d1d18eb691a0e083"
+
+DEPENDS = "python3-pcpp-native"
+
+PV .= "+git"
+
+SRC_URI = "\
+    git://github.com/lvgl/lv_port_linux_frame_buffer.git;protocol=https;branch=release/v9.4;name=demo \
+    git://github.com/lvgl/lvgl;protocol=https;branch=release/v9.4;tag=v9.4.0;name=lvgl;subdir=${BB_GIT_DEFAULT_DESTSUFFIX}/lvgl \
+"
+
+SRCREV_demo = "71050624acd8a52ab7d365d0d12acf9bf5fe41db"
+SRCREV_lvgl = "c016f72d4c125098287be5e83c0f1abed4706ee5"
+SRCREV_FORMAT = "demo_lvgl"
+
+inherit cmake pkgconfig
+
+LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0"
+LVGL_CONFIG_LV_USE_LOG    = "1"
+LVGL_CONFIG_LV_LOG_PRINTF = "1"
+LVGL_CONFIG_LV_MEM_SIZE = "(256 * 1024U)"
+LVGL_CONFIG_LV_USE_FONT_COMPRESSED = "1"
+require lv-conf.inc
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${B}/bin/lvglsim ${D}${bindir}
+}
#4 lore raw

PATCH 5/9 lvgl: Use Kconfig to configure

In reply to Peter Kjellerstedt

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.

---
 meta-oe/recipes-graphics/lvgl/files/debug.cfg |   3 +
 meta-oe/recipes-graphics/lvgl/files/defconfig |   1 +
 meta-oe/recipes-graphics/lvgl/files/drm.cfg   |   2 +
 meta-oe/recipes-graphics/lvgl/files/fbdev.cfg |   2 +
 .../recipes-graphics/lvgl/files/gridnav.cfg   |   1 +
 meta-oe/recipes-graphics/lvgl/files/sdl.cfg   |   3 +
 .../recipes-graphics/lvgl/files/thorvg.cfg    |   3 +
 meta-oe/recipes-graphics/lvgl/lv-conf.inc     | 106 +++++-------------
 8 files changed, 41 insertions(+), 80 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/debug.cfg
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/defconfig
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/drm.cfg
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/fbdev.cfg
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/gridnav.cfg
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/sdl.cfg
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/thorvg.cfg
meta-oe/recipes-graphics/lvgl/files/debug.cfg new file +3 -0
new file mode 100644
index 0000000000..022375d4ae
@@ -0,0 +1,3 @@
+CONFIG_LV_USE_ASSERT_STYLE=y
+CONFIG_LV_USE_ASSERT_MEM_INTEGRITY=y
+CONFIG_LV_USE_ASSERT_OBJ=y
meta-oe/recipes-graphics/lvgl/files/defconfig new file +1 -0
new file mode 100644
index 0000000000..1f42f11f7a
@@ -0,0 +1 @@
+CONFIG_LV_COLOR_DEPTH_32=y
meta-oe/recipes-graphics/lvgl/files/drm.cfg new file +2 -0
new file mode 100644
index 0000000000..c2387087f2
@@ -0,0 +1,2 @@
+CONFIG_LV_USE_LINUX_DRM=y
+CONFIG_LV_USE_EVDEV=y
meta-oe/recipes-graphics/lvgl/files/fbdev.cfg new file +2 -0
new file mode 100644
index 0000000000..4ba7f8f5ad
@@ -0,0 +1,2 @@
+CONFIG_LV_USE_LINUX_FBDEV=y
+CONFIG_LV_USE_EVDEV=y
meta-oe/recipes-graphics/lvgl/files/gridnav.cfg new file +1 -0
new file mode 100644
index 0000000000..02b80c3e57
@@ -0,0 +1 @@
+CONFIG_LV_USE_GRIDNAV=y
meta-oe/recipes-graphics/lvgl/files/sdl.cfg new file +3 -0
new file mode 100644
index 0000000000..3ba28d7b01
@@ -0,0 +1,3 @@
+CONFIG_LV_USE_DRAW_SDL=y
+CONFIG_LV_USE_SDL=y
+CONFIG_LV_SDL_DOUBLE_BUFFER=y
meta-oe/recipes-graphics/lvgl/files/thorvg.cfg new file +3 -0
new file mode 100644
index 0000000000..4dbffdfe09
@@ -0,0 +1,3 @@
+CONFIG_LV_USE_VECTOR_GRAPHIC=y
+CONFIG_LV_USE_LOTTIE=y
+CONFIG_LV_USE_THORVG=y
meta-oe/recipes-graphics/lvgl/lv-conf.inc +26 -80

121 lines not on this page · raw message

#5 lore raw

PATCH 6/9 lvgl-demo-fb: Use Kconfig to configure

In reply to Peter Kjellerstedt

This switches the recipe from manipulating the lv_conf.h file directly, to instead using Kconfig to configure lvgl-demo-fb.

---
 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb/defconfig | 6 ++++++
 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.4.0.bb  | 7 ++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb/defconfig
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb/defconfig new file +6 -0
new file mode 100644
index 0000000000..9d4ffa9b40
@@ -0,0 +1,6 @@
+CONFIG_LV_COLOR_DEPTH_32=y
+CONFIG_LV_MEM_SIZE_KILOBYTES=256
+CONFIG_LV_USE_LOG=y
+CONFIG_LV_LOG_PRINTF=y
+CONFIG_LV_USE_FONT_COMPRESSED=y
+CONFIG_LV_USE_DEMO_WIDGETS=y
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.4.0.bb +2 -5
index 3185d37c5c..660031b68f 100644
@@ -20,13 +20,10 @@ SRCREV_FORMAT = "demo_lvgl"
 
 inherit cmake pkgconfig
 
-LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0"
-LVGL_CONFIG_LV_USE_LOG    = "1"
-LVGL_CONFIG_LV_LOG_PRINTF = "1"
-LVGL_CONFIG_LV_MEM_SIZE = "(256 * 1024U)"
-LVGL_CONFIG_LV_USE_FONT_COMPRESSED = "1"
 require lv-conf.inc
 
+KCONFIG_CONFIG_ROOTDIR = "${S}/lvgl"
+
 do_install() {
     install -d ${D}${bindir}
     install -m 0755 ${B}/bin/lvglsim ${D}${bindir}
#6 lore raw

PATCH 7/9 lvgl: Add support for modifying the configuration using menuconfig

In reply to Peter Kjellerstedt

Generating a configuration fragment for a feature can now be done using:

bitbake lvgl -c menuconfig && bitbake lvgl -c diffconfig

While this uses the standard cml1.bbclass, it expects that "make" is used to run menuconfig etc. This is not true for lvgl, so unfortunately the whole do_menuconfig() function had to be copied to be able to remove the use of "make".

---

I plan on updating cml1.bbclass so that it better supports code that does not use "make" to run menuconfig, maybe even giving it native support for kconfiglib. However, due to the current situation, I do not expect any such changes to be accepted until after Whinlatter is out of the door. Thus, the copied do_menuconfig in this recipe will have to do as an interim solution.

 meta-oe/recipes-graphics/lvgl/lv-conf.inc | 48 ++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)
meta-oe/recipes-graphics/lvgl/lv-conf.inc +47 -1
index ab3ad01a5a..cc8a2a16d9 100644
@@ -21,7 +21,7 @@ PACKAGECONFIG[gridnav] = ",,"
 PACKAGECONFIG[thorvg] = ",,"
 PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
 
-inherit python3native
+inherit cml1 python3native
 
 EXTRA_OECMAKE += "-DLV_BUILD_USE_KCONFIG=ON"
 
@@ -35,6 +35,7 @@ CXXFLAGS += "${LVGL_FLAGS}"
 KCONFIG_CONFIG_ROOTDIR ?= "${S}"
 KCONFIG_FILE ?= "${KCONFIG_CONFIG_ROOTDIR}/Kconfig"
 export KCONFIG_CONFIG ?= "${KCONFIG_CONFIG_ROOTDIR}/.config"
+KCONFIG_CONFIG_COMMAND ?= "menuconfig ${KCONFIG_FILE}"
 
 do_configure() {
     cat ${UNPACKDIR}/defconfig ${@" ".join(find_cfgs(d))} > ${B}/defconfig
@@ -42,3 +43,48 @@ do_configure() {
 
     cmake_do_configure
 }
+
+# Copied from cml1.bbclass. The only modification is that
+# ${KCONFIG_CONFIG_COMMAND} is not prefixed with "make" when called by
+# oe_terminal.
+python do_menuconfig() {
+    import shutil
+
+    if not bb.utils.to_boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG")):
+        bb.fatal("do_menuconfig is disabled, please check KCONFIG_CONFIG_ENABLE_MENUCONFIG variable.")
+        return
+
+    config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config")
+    configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
+
+    try:
+        mtime = os.path.getmtime(config)
+        shutil.copy(config, configorig)
+    except OSError:
+        mtime = 0
+
+    # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
+    d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig")
+    d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig")
+    d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}")
+    d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
+    # ensure that environment variables are overwritten with this tasks 'd' values
+    d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
+
+    oe_terminal("sh -c '%s; if [ $? -ne 0 ]; then echo \"Command failed.\"; printf \"Press any key to continue... \"; read r; fi'" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+                d.getVar('PN') + ' Configuration', d)
+
+    try:
+        newmtime = os.path.getmtime(config)
+    except OSError:
+        newmtime = 0
+
+    if newmtime > mtime:
+        bb.plain("Changed configuration saved at:\n %s\nRecompile will be forced" % config)
+        bb.build.write_taint('do_compile', d)
+}
+
+do_savedefconfig() {
+    bbplain "Saving defconfig to:\n${B}/defconfig"
+    savedefconfig --kconfig ${KCONFIG_FILE} --out ${B}/defconfig
+}
#7 lore raw

Re: [oe] [meta-oe][PATCH 7/9] lvgl: Add support for modifying the configuration using menuconfig

Quoted 45 lines · Peter Kjellerstedt via lists.openembedded.org

Generating a configuration fragment for a feature can now be done using:

bitbake lvgl -c menuconfig && bitbake lvgl -c diffconfig

While this uses the standard cml1.bbclass, it expects that "make" is used to run menuconfig etc. This is not true for lvgl, so unfortunately the whole do_menuconfig() function had to be copied to be able to remove the use of "make".

---

I plan on updating cml1.bbclass so that it better supports code that does not use "make" to run menuconfig, maybe even giving it native support for kconfiglib. However, due to the current situation, I do not expect any such changes to be accepted until after Whinlatter is out of the door. Thus, the copied do_menuconfig in this recipe will have to do as an interim solution.

 meta-oe/recipes-graphics/lvgl/lv-conf.inc | 48 ++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)
meta-oe/recipes-graphics/lvgl/lv-conf.inc +2 -1
index ab3ad01a5a..cc8a2a16d9 100644
@@ -21,7 +21,7 @@ PACKAGECONFIG[gridnav] = ",,"
 PACKAGECONFIG[thorvg] = ",,"
 PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
 
-inherit python3native
+inherit cml1 python3native
 
 EXTRA_OECMAKE += "-DLV_BUILD_USE_KCONFIG=ON"
 
@@ -35,6 +35,7 @@ CXXFLAGS += "${LVGL_FLAGS}"
 KCONFIG_CONFIG_ROOTDIR ?= "${S}"
 KCONFIG_FILE ?= "${KCONFIG_CONFIG_ROOTDIR}/Kconfig"
 export KCONFIG_CONFIG ?= "${KCONFIG_CONFIG_ROOTDIR}/.config"
+KCONFIG_CONFIG_COMMAND ?= "menuconfig ${KCONFIG_FILE}"
 
 do_configure() {
     cat ${UNPACKDIR}/defconfig ${@" ".join(find_cfgs(d))} > ${B}/defconfig

meta-oe/recipes-graphics/lvgl/lv-conf.inc do_configure() { · line 49

Quoted 7 lines
meta-oe/recipes-graphics/lvgl/lv-conf.inc +4 -0
@@ -42,3 +43,48 @@ do_configure() {
 
     cmake_do_configure
 }
+
+# Copied from cml1.bbclass. The only modification is that
+# ${KCONFIG_CONFIG_COMMAND} is not prefixed with "make" when called by
+# oe_terminal.

I wonder if we can add this flexibility to cml1.bbclass and use the class directly then here.

Quoted 50 lines
meta-oe/recipes-graphics/lvgl/lv-conf.inc +41 -1
+python do_menuconfig() {
+    import shutil
+
+    if not bb.utils.to_boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG")):
+        bb.fatal("do_menuconfig is disabled, please check KCONFIG_CONFIG_ENABLE_MENUCONFIG variable.")
+        return
+
+    config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config")
+    configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
+
+    try:
+        mtime = os.path.getmtime(config)
+        shutil.copy(config, configorig)
+    except OSError:
+        mtime = 0
+
+    # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
+    d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig")
+    d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig")
+    d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}")
+    d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
+    # ensure that environment variables are overwritten with this tasks 'd' values
+    d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
+
+    oe_terminal("sh -c '%s; if [ $? -ne 0 ]; then echo \"Command failed.\"; printf \"Press any key to continue... \"; read r; fi'" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+                d.getVar('PN') + ' Configuration', d)
+
+    try:
+        newmtime = os.path.getmtime(config)
+    except OSError:
+        newmtime = 0
+
+    if newmtime > mtime:
+        bb.plain("Changed configuration saved at:\n %s\nRecompile will be forced" % config)
+        bb.build.write_taint('do_compile', d)
+}
+
+do_savedefconfig() {
+    bbplain "Saving defconfig to:\n${B}/defconfig"
+    savedefconfig --kconfig ${KCONFIG_FILE} --out ${B}/defconfig
+}
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#120979): https://lists.openembedded.org/g/openembedded-devel/message/120979
Mute This Topic: https://lists.openembedded.org/mt/115939735/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#8 lore raw

RE: [oe] [meta-oe][PATCH 7/9] lvgl: Add support for modifying the configuration using menuconfig

Quoted 54 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: den 25 oktober 2025 06:51
To: Peter Kjellerstedt <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 7/9] lvgl: Add support for modifying the configuration using menuconfig

Quoted 46 lines · Peter Kjellerstedt via lists.openembedded.org

Generating a configuration fragment for a feature can now be done using:

bitbake lvgl -c menuconfig && bitbake lvgl -c diffconfig

While this uses the standard cml1.bbclass, it expects that "make" is used to run menuconfig etc. This is not true for lvgl, so unfortunately the whole do_menuconfig() function had to be copied to be able to remove the use of "make".

---

I plan on updating cml1.bbclass so that it better supports code that does not use "make" to run menuconfig, maybe even giving it native support for kconfiglib. However, due to the current situation, I do not expect any such changes to be accepted until after Whinlatter is out of the door. Thus, the copied do_menuconfig in this recipe will have to do as an interim solution.

 meta-oe/recipes-graphics/lvgl/lv-conf.inc | 48 ++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)
meta-oe/recipes-graphics/lvgl/lv-conf.inc +2 -1
index ab3ad01a5a..cc8a2a16d9 100644
@@ -21,7 +21,7 @@ PACKAGECONFIG[gridnav] = ",,"
 PACKAGECONFIG[thorvg] = ",,"
 PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
 
-inherit python3native
+inherit cml1 python3native
 
 EXTRA_OECMAKE += "-DLV_BUILD_USE_KCONFIG=ON"
 
@@ -35,6 +35,7 @@ CXXFLAGS += "${LVGL_FLAGS}"
 KCONFIG_CONFIG_ROOTDIR ?= "${S}"
 KCONFIG_FILE ?= "${KCONFIG_CONFIG_ROOTDIR}/Kconfig"
 export KCONFIG_CONFIG ?= "${KCONFIG_CONFIG_ROOTDIR}/.config"
+KCONFIG_CONFIG_COMMAND ?= "menuconfig ${KCONFIG_FILE}"
 
 do_configure() {
     cat ${UNPACKDIR}/defconfig ${@" ".join(find_cfgs(d))} > ${B}/defconfig
@@ -42,3 +43,48 @@ do_configure() {
 
Quoted 9 lines

meta-oe/recipes-graphics/lvgl/lv-conf.inc do_configure() { · line 49

Quoted 6 lines
meta-oe/recipes-graphics/lvgl/lv-conf.inc +4 -0
     cmake_do_configure
 }
+
+# Copied from cml1.bbclass. The only modification is that
+# ${KCONFIG_CONFIG_COMMAND} is not prefixed with "make" when called by
+# oe_terminal.

I wonder if we can add this flexibility to cml1.bbclass and use the class directly then here.

Yes, that is my plan. See my comment above.

Quoted 33 lines
Quoted 33 lines
meta-oe/recipes-graphics/lvgl/lv-conf.inc +33 -0
+python do_menuconfig() {
+    import shutil
+
+    if not bb.utils.to_boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG")):
+        bb.fatal("do_menuconfig is disabled, please check KCONFIG_CONFIG_ENABLE_MENUCONFIG variable.")
+        return
+
+    config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config")
+    configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
+
+    try:
+        mtime = os.path.getmtime(config)
+        shutil.copy(config, configorig)
+    except OSError:
+        mtime = 0
+
+    # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
+    d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig")
+    d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig")
+    d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}")
+    d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
+    # ensure that environment variables are overwritten with this tasks 'd' values
+    d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
+
+    oe_terminal("sh -c '%s; if [ $? -ne 0 ]; then echo \"Command failed.\"; printf \"Press any key to continue... \"; read r; fi'" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+                d.getVar('PN') + ' Configuration', d)
+
+    try:
+        newmtime = os.path.getmtime(config)
+    except OSError:
+        newmtime = 0
+
+    if newmtime > mtime:
Quoted 8 lines

meta-oe/recipes-graphics/lvgl/lv-conf.inc do_configure() { · line 90

Quoted 8 lines
meta-oe/recipes-graphics/lvgl/lv-conf.inc +8 -0
+        bb.plain("Changed configuration saved at:\n %s\nRecompile will be forced" % config)
+        bb.build.write_taint('do_compile', d)
+}
+
+do_savedefconfig() {
+    bbplain "Saving defconfig to:\n${B}/defconfig"
+    savedefconfig --kconfig ${KCONFIG_FILE} --out ${B}/defconfig
+}

//Peter

#9 lore raw

PATCH 8/9 lvgl: Add freetype support

In reply to Peter Kjellerstedt
---
 meta-oe/recipes-graphics/lvgl/files/freetype.cfg | 1 +
 meta-oe/recipes-graphics/lvgl/lv-conf.inc        | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/freetype.cfg
meta-oe/recipes-graphics/lvgl/files/freetype.cfg new file +1 -0
new file mode 100644
index 0000000000..acc8ef0e7a
@@ -0,0 +1 @@
+CONFIG_LV_USE_FREETYPE=y
meta-oe/recipes-graphics/lvgl/lv-conf.inc +3 -1
index cc8a2a16d9..4264f20895 100644
@@ -8,6 +8,7 @@ SRC_URI += " \
     ${@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', 'freetype', 'file://freetype.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)} \
@@ -17,6 +18,7 @@ PACKAGECONFIG ??= "drm"
 
 PACKAGECONFIG[drm] = ",,libdrm libevdev"
 PACKAGECONFIG[fbdev] = ",,libevdev"
+PACKAGECONFIG[freetype] = ",,freetype"
 PACKAGECONFIG[gridnav] = ",,"
 PACKAGECONFIG[thorvg] = ",,"
 PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
@@ -25,9 +27,9 @@ inherit cml1 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)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'freetype', '-I${STAGING_INCDIR}/freetype2', '', d)} \
 "
 CFLAGS += "${LVGL_FLAGS}"
 CXXFLAGS += "${LVGL_FLAGS}"
#10 lore raw

PATCH 9/9 lvgl: Disable building demos and examples

In reply to Peter Kjellerstedt

There are no reasons to build the demos and examples for the dynamic lvgl library.

---
 meta-oe/recipes-graphics/lvgl/files/defconfig | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-graphics/lvgl/files/defconfig +2 -0
index 1f42f11f7a..088b2369e9 100644
@@ -1 +1,3 @@
 CONFIG_LV_COLOR_DEPTH_32=y
+# CONFIG_LV_BUILD_EXAMPLES is not set
+# CONFIG_LV_BUILD_DEMOS is not set