diff mbox series

[meta-oe,v2] libsdl2-ttf: add PACKAGECONFIG opengl conditionally

Message ID 20250904080217.1602121-1-hongxu.jia@windriver.com
State Under Review
Headers show
Series [meta-oe,v2] libsdl2-ttf: add PACKAGECONFIG opengl conditionally | expand

Commit Message

Hongxu Jia Sept. 4, 2025, 8:02 a.m. UTC
GL is only used for an example binary, add PACKAGECONFIG opengl to enable/disable
it according to 'opengl' in DISTRO_FEATURES or not. Otherwise it fails to build
world if 'opengl' doesn't exist in DISTRO_FEATURES.
...
|ERROR: Nothing PROVIDES 'virtual/egl' (but meta-openembedded/meta-oe/recipes-graphics/
libsdl/libsdl2-ttf_2.24.0.bb DEPENDS on or otherwise requires it). Close matches:
|  virtual/kernel
|  virtual/make
|  virtual/perf
|ERROR: Required build target 'meta-world-pkgdata' has no buildable providers.
|Missing or unbuildable dependency chain was: ['meta-world-pkgdata', 'libsdl2-ttf', 'virtual/egl']
...

Suggested-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.24.0.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.24.0.bb b/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.24.0.bb
index d06f41bd0e..eee22ba703 100644
--- a/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.24.0.bb
+++ b/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.24.0.bb
@@ -1,6 +1,6 @@ 
 SUMMARY = "Simple DirectMedia Layer truetype font library"
 SECTION = "libs"
-DEPENDS = "virtual/libsdl2 freetype virtual/egl"
+DEPENDS = "virtual/libsdl2 freetype"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=fbb0010b2f7cf6e8a13bcac1ef4d2455"
 
@@ -12,3 +12,8 @@  inherit cmake pkgconfig
 S = "${UNPACKDIR}/SDL2_ttf-${PV}"
 
 FILES:${PN} += "${datadir}/licenses"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
+
+# GL is only used for an example binary
+PACKAGECONFIG[opengl] = "-DSDL2TTF_SAMPLES=ON,-DSDL2TTF_SAMPLES=OFF,virtual/egl"