public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+yocto@0leil.net>
To: openembedded-core@lists.openembedded.org
Cc: Quentin Schulz <quentin.schulz@cherry.de>
Subject: [PATCH 4/7] mesa: make zlib dependency a PACKAGECONFIG
Date: Fri, 06 Feb 2026 18:23:56 +0100	[thread overview]
Message-ID: <20260206-mesa-tools-native-v1-4-166935b0e379@cherry.de> (raw)
In-Reply-To: <20260206-mesa-tools-native-v1-0-166935b0e379@cherry.de>

From: Quentin Schulz <quentin.schulz@cherry.de>

zlib is a mesa meson feature which can be disabled so let's make it a
PACKAGECONFIG.

The motivation actually isn't about disabling it (though we now could as
it's only required for a few things) but rather that this dependency is
a non-native one.

The issue is when a native-only (-native recipe name suffix + inherit
native) recipe includes mesa.inc, it'll include the DEPENDS as well but
will then depend on a non-native recipe because BitBake doesn't add a
suffix to dependencies listed in DEPENDS for native-only recipes like it
does for recipes with BBCLASSEXTEND = native. This is a way to
circumvent the issue by making the dependency a PACKAGECONFIG dependency
such that the listed DEPENDS (third parameter) will be properly modified
by BitBake to have the native variant of the recipe pulled in. See[1]
for more info on why this is needed.

This is in preparation for the addition of a mesa-tools-native
native-only package which will include mesa.inc.

[1] https://lore.kernel.org/openembedded-core/07cd1d3c-4d67-4e60-b3d3-75953784f70f@cherry.de/
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 meta/recipes-graphics/mesa/mesa-gl.bb | 2 +-
 meta/recipes-graphics/mesa/mesa.bb    | 1 +
 meta/recipes-graphics/mesa/mesa.inc   | 4 +++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-graphics/mesa/mesa-gl.bb b/meta/recipes-graphics/mesa/mesa-gl.bb
index fe32e74744..eb0ee53af5 100644
--- a/meta/recipes-graphics/mesa/mesa-gl.bb
+++ b/meta/recipes-graphics/mesa/mesa-gl.bb
@@ -7,7 +7,7 @@ PROVIDES = "virtual/libgl virtual/mesa"
 TARGET_CFLAGS = "-I${STAGING_INCDIR}/drm"
 
 # At least one DRI rendering engine is required to build mesa.
-PACKAGECONFIG = "expat opengl gallium ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} xmlconfig"
+PACKAGECONFIG = "expat opengl gallium ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} xmlconfig zlib"
 
 PACKAGECONFIG:append:x86 = " libclc gallium-llvm intel amd nouveau svga"
 PACKAGECONFIG:append:x86-64 = " libclc gallium-llvm intel amd nouveau svga"
diff --git a/meta/recipes-graphics/mesa/mesa.bb b/meta/recipes-graphics/mesa/mesa.bb
index 2db08727fe..66c8f9c372 100644
--- a/meta/recipes-graphics/mesa/mesa.bb
+++ b/meta/recipes-graphics/mesa/mesa.bb
@@ -10,6 +10,7 @@ PACKAGECONFIG = " \
 	${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'zink', '', d)} \
 	${@bb.utils.contains_any('DISTRO_FEATURES', 'opengl vulkan', 'virtio', '', d)} \
 	xmlconfig \
+	zlib \
 "
 
 PACKAGECONFIG:append:x86 = " libclc gallium-llvm intel amd nouveau svga"
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 35b7e5a09a..b2dfc6130d 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -43,7 +43,8 @@ do_install:append() {
   fi
 }
 
-DEPENDS = "makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native python3-pyyaml-native"
+# All dependencies **MUST** be -native. If not, then add a PACKAGECONFIG for it.
+DEPENDS = "makedepend-native flex-native bison-native libxml2-native chrpath-replacement-native python3-mako-native gettext-native python3-pyyaml-native"
 EXTRANATIVEPATH += "chrpath-native"
 
 inherit meson pkgconfig python3native gettext features_check rust
@@ -166,6 +167,7 @@ PACKAGECONFIG[expat] = "-Dexpat=enabled, -Dexpat=disabled, expat"
 PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}"
 # Depends on expat PACKAGECONFIG!
 PACKAGECONFIG[xmlconfig] = "-Dxmlconfig=enabled, -Dxmlconfig=disabled"
+PACKAGECONFIG[zlib] = "-Dzlib=enabled, -Dzlib=disabled, zlib"
 
 GALLIUMDRIVERS_LLVMPIPE = ",llvmpipe"
 GALLIUMDRIVERS_SOFTPIPE = ",softpipe"

-- 
2.53.0



  parent reply	other threads:[~2026-02-06 17:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 17:23 [PATCH 0/7] mesa: bump + lighten mesa libclc dependency Quentin Schulz
2026-02-06 17:23 ` [PATCH 1/7] mesa: upgrade 25.3.3 -> 25.3.4 Quentin Schulz
2026-02-06 17:23 ` [PATCH 2/7] mesa: update patch status Quentin Schulz
2026-02-06 17:23 ` [PATCH 3/7] mesa: make expat dependency a PACKAGECONFIG Quentin Schulz
2026-02-06 17:23 ` Quentin Schulz [this message]
2026-02-06 17:23 ` [PATCH 5/7] mesa: remove libxml2-native dependency Quentin Schulz
2026-02-06 17:23 ` [PATCH 6/7] add mesa-tools native-only recipe Quentin Schulz
2026-02-06 17:31   ` Patchtest results for " patchtest
2026-02-06 17:23 ` [PATCH 7/7] mesa: depend on mesa-tools-native for less expensive libclc dependency Quentin Schulz
2026-03-20 15:26   ` ernestvanhoecke
2026-03-20 15:57     ` Quentin Schulz
2026-03-26 11:10       ` [OE-core] " Quentin Schulz
2026-03-26 17:34         ` Ernest Van Hoecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260206-mesa-tools-native-v1-4-166935b0e379@cherry.de \
    --to=foss+yocto@0leil.net \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=quentin.schulz@cherry.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox