]> code.ossystems Code Review - openembedded-core.git/commitdiff
mesa-gl: Allow mesa-gl to build without X11 enabled.
authorMark Hatle <mark.hatle@kernel.crashing.org>
Thu, 26 Mar 2020 02:15:58 +0000 (21:15 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 30 Mar 2020 11:33:24 +0000 (12:33 +0100)
Trying to build mesa-gl without X11 enabled, results in numerous errors
about being incorrectly configured, such as:

  ERROR: Problem encountered: building dri drivers require at least one windowing system or classic osmesa

A rendering engine must be available, so per the error we enable osmesa
if X11 is not available.  Once 'osmesa' is enabled we also need to make
sure that swrast for DRI is also available.

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-graphics/mesa/mesa-gl_20.0.2.bb

index d4b1c1c454b91d3e60ce0edcc8662ed98fca5fd5..c7897cdaf31e342732e5688a1e57b8f4c2d9c2eb 100644 (file)
@@ -6,5 +6,10 @@ PROVIDES = "virtual/libgl virtual/mesa"
 
 S = "${WORKDIR}/mesa-${PV}"
 
-PACKAGECONFIG ??= "opengl dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
-PACKAGECONFIG_class-target = "opengl dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+# At least one DRI rendering engine is required to build mesa.
+# When no X11 is available, use osmesa for the rendering engine.
+PACKAGECONFIG ??= "opengl dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa', d)}"
+PACKAGECONFIG_class-target = "opengl dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa', d)}"
+
+# When NOT using X11, we need to make sure we have swrast available.
+DRIDRIVERS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', ',swrast', d)}"