Skip to contentSkip to conversation

lvgl: add PACKAGECONFIG for thorvg

PATCH New [email protected] 1 participant 2 messages Mar 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lvgl: add PACKAGECONFIG for thorvg

From: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/lv-conf.inc | 8 ++++++++
 1 file changed, 8 insertions(+)
meta-oe/recipes-graphics/lvgl/lv-conf.inc +8 -0
index 9186015537..41133f3438 100644
@@ -3,6 +3,7 @@ PACKAGECONFIG ??= "drm"
 PACKAGECONFIG[drm] = ",,libdrm"
 PACKAGECONFIG[fbdev] = ",,"
 PACKAGECONFIG[gridnav] = ",,"
+PACKAGECONFIG[thorvg] = ",,"
 PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
 
 # Add libdrm include if drm is selected in PACKAGECONFIG
@@ -32,6 +33,10 @@ LVGL_CONFIG_LV_USE_GRIDNAV = "${@bb.utils.contains('PACKAGECONFIG', 'gridnav', '
 
 LVGL_CONFIG_LV_THEME_DEFAULT_DARK ?= "0"
 
+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)}"
+
 DEBUG_BUILD ??= "0"
 
 ALLOW_EMPTY:${PN} = "1"
@@ -77,5 +82,8 @@ do_configure:append() {
         -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}|" \
+        \
         -i "${S}/lv_conf.h"
 }
#1 lore raw

PATCH 2/2 lvgl: fix build with gcc-15 when thorvg is enabled

From: Martin Jansa <[email protected]>

* fixes:
http://errors.yoctoproject.org/Errors/Details/848488/
which is triggered only when thorvg PACKAGECONFIG is enabled

---
 .../0001-thorvg-fix-build-with-gcc-15.patch   | 34 +++++++++++++++++++
 meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb   |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0001-thorvg-fix-build-with-gcc-15.patch
meta-oe/recipes-graphics/lvgl/files/0001-thorvg-fix-build-with-gcc-15.patch new file +34 -0
new file mode 100644
index 0000000000..eefcbe5b9c
@@ -0,0 +1,34 @@
+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(+)
+
+diff --git a/src/libs/thorvg/thorvg.h b/src/libs/thorvg/thorvg.h
+index 7f5a84b94..0c84ec66e 100644
+--- a/src/libs/thorvg/thorvg.h
++++ b/src/libs/thorvg/thorvg.h
+@@ -18,6 +18,7 @@
+ #ifndef _THORVG_H_
+ #define _THORVG_H_
+ 
++#include <cstdint>
+ #include <functional>
+ #include <memory>
+ #include <string>
meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb +1 -0
index 63c810d74d..b07cdfc8f6 100644
@@ -13,6 +13,7 @@ SRC_URI = "\
 	file://0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch \
 	file://0007-fix-cmake-generate-versioned-shared-libraries.patch \
 	file://0008-fix-fbdev-set-resolution-prior-to-buffer.patch \
+        file://0001-thorvg-fix-build-with-gcc-15.patch \
 	"
 SRCREV = "e1c0b21b2723d391b885de4b2ee5cc997eccca91"