mesa: fix logic error in glvnd selection

Commit 9d2001f14ec7 ("Add Generic-gl device") introduced a subtle error
in the glvnd enablement logic that lead to the Generic-Legacy image
being built without glvnd which breaks nvidia support.

Unlike most programming languages "||" and "&&" have the same precedence
in shell and "A || B && C" get evaluated as "(A || B) && C" instead of
the intended "A || (B && C)".

Fix this by moving the "AND not-X11" check into the "GL" test and
adjust formatting to make the intention clear.

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2025-05-21 17:46:19 +02:00
parent a2ce022e55
commit 3e60f458d4

View File

@ -69,8 +69,7 @@ if listcontains "${GRAPHIC_DRIVERS}" "(iris|panfrost)"; then
fi fi
if listcontains "${GRAPHIC_DRIVERS}" "(nvidia|nvidia-ng)" || if listcontains "${GRAPHIC_DRIVERS}" "(nvidia|nvidia-ng)" ||
[ "${OPENGL_SUPPORT}" = "yes" ] && [ "${OPENGL_SUPPORT}" = "yes" -a "${DISPLAYSERVER}" != "x11" ]; then
[ "${DISPLAYSERVER}" != "x11" ]; then
PKG_DEPENDS_TARGET+=" libglvnd" PKG_DEPENDS_TARGET+=" libglvnd"
PKG_MESON_OPTS_TARGET+=" -Dglvnd=enabled" PKG_MESON_OPTS_TARGET+=" -Dglvnd=enabled"
else else