summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorVincent Davis Jr <vince@underview.tech>2022-11-25 17:19:52 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-29 13:30:41 +0000
commita0dcf93bc919757b23a52597eacb1777df4adf24 (patch)
treef1de55f01c0f5a461fd20e7a9fdcebcd46d77871 /meta
parent4543d20213e630437685e9ff4964c2e8e1a29216 (diff)
downloadpoky-a0dcf93bc919757b23a52597eacb1777df4adf24.tar.gz
mesa: enable glvnd support
Allows mesa to be built with glvnd support. Thus, creates libEGL_mesa.so* and libGLX_mesa.so* mesa(vendor) libraries meant to coexist with vendor neutral dispatch libraries from libglvnd. (From OE-Core rev: 1c0577d66b5c26b9b248797f17d652daf6d9dfd1) Signed-off-by: Vincent Davis Jr <vince@underview.tech> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/conf/distro/include/default-providers.inc1
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc20
2 files changed, 15 insertions, 6 deletions
diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index 6defdca12d..3a4e989c1f 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -5,6 +5,7 @@ PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
5PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg" 5PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
6PREFERRED_PROVIDER_virtual/egl ?= "mesa" 6PREFERRED_PROVIDER_virtual/egl ?= "mesa"
7PREFERRED_PROVIDER_virtual/libgl ?= "mesa" 7PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
8PREFERRED_PROVIDER_virtual/libglx ?= "mesa"
8PREFERRED_PROVIDER_virtual/libgl-native ?= "mesa-native" 9PREFERRED_PROVIDER_virtual/libgl-native ?= "mesa-native"
9PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "nativesdk-mesa" 10PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "nativesdk-mesa"
10PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa" 11PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 1949fc15a9..115621228a 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -32,15 +32,18 @@ UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
32#because we cannot rely on the fact that all apps will use pkgconfig, 32#because we cannot rely on the fact that all apps will use pkgconfig,
33#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER 33#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
34do_install:append() { 34do_install:append() {
35 if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then 35 # sed can't find EGL/eglplatform.h as it doesn't get installed when glvnd enabled.
36 sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h 36 # So, check if EGL/eglplatform.h exists before running sed.
37 fi 37 if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)} && [ -f ${D}${includedir}/EGL/eglplatform.h ]; then
38 sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
39 fi
38} 40}
39 41
40DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" 42DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"
41EXTRANATIVEPATH += "chrpath-native" 43EXTRANATIVEPATH += "chrpath-native"
42PROVIDES = " \ 44PROVIDES = " \
43 ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ 45 ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
46 ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', 'virtual/libglx', '', d)} \
44 ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \ 47 ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \
45 ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ 48 ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
46 ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ 49 ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
@@ -109,6 +112,7 @@ VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broa
109PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" 112PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers"
110 113
111PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false" 114PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
115PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd"
112 116
113# "gles" requires "opengl" 117# "gles" requires "opengl"
114PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled" 118PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled"
@@ -199,6 +203,7 @@ RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'lib
199PACKAGES =+ "libegl-mesa libegl-mesa-dev \ 203PACKAGES =+ "libegl-mesa libegl-mesa-dev \
200 libosmesa libosmesa-dev \ 204 libosmesa libosmesa-dev \
201 libgl-mesa libgl-mesa-dev \ 205 libgl-mesa libgl-mesa-dev \
206 libglx-mesa libglx-mesa-dev \
202 libglapi libglapi-dev \ 207 libglapi libglapi-dev \
203 libgbm libgbm-dev \ 208 libgbm libgbm-dev \
204 libgles1-mesa libgles1-mesa-dev \ 209 libgles1-mesa libgles1-mesa-dev \
@@ -217,7 +222,7 @@ do_install:append () {
217 rm -f ${D}${libdir}/gallium-pipe/*.la 222 rm -f ${D}${libdir}/gallium-pipe/*.la
218 rm -f ${D}${libdir}/gbm/*.la 223 rm -f ${D}${libdir}/gbm/*.la
219 224
220 # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used 225 # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used
221 chrpath --delete ${D}${libdir}/dri/*_dri.so || true 226 chrpath --delete ${D}${libdir}/dri/*_dri.so || true
222 227
223 # libwayland-egl has been moved to wayland 1.15+ 228 # libwayland-egl has been moved to wayland 1.15+
@@ -235,6 +240,7 @@ python __anonymous() {
235 suffix = "-native" 240 suffix = "-native"
236 for p in (("egl", "libegl", "libegl1"), 241 for p in (("egl", "libegl", "libegl1"),
237 ("opengl", "libgl", "libgl1"), 242 ("opengl", "libgl", "libgl1"),
243 ("glvnd", "libglx",),
238 ("gles", "libgles1", "libglesv1-cm1"), 244 ("gles", "libgles1", "libglesv1-cm1"),
239 ("gles", "libgles2", "libglesv2-2"), 245 ("gles", "libgles2", "libglesv2-2"),
240 ("gles", "libgles3",), 246 ("gles", "libgles3",),
@@ -293,20 +299,22 @@ PACKAGES_DYNAMIC:class-native = "^mesa-driver-.*-native"
293FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d" 299FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d"
294FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan" 300FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
295FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*" 301FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
296FILES:libegl-mesa = "${libdir}/libEGL.so.*" 302FILES:libegl-mesa = "${libdir}/libEGL*.so.* ${datadir}/glvnd/egl_vendor.d"
297FILES:libgbm = "${libdir}/libgbm.so.*" 303FILES:libgbm = "${libdir}/libgbm.so.*"
298FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*" 304FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
299FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*" 305FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
300FILES:libgl-mesa = "${libdir}/libGL.so.*" 306FILES:libgl-mesa = "${libdir}/libGL.so.*"
307FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
301FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd" 308FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
302FILES:libglapi = "${libdir}/libglapi.so.*" 309FILES:libglapi = "${libdir}/libglapi.so.*"
303FILES:libosmesa = "${libdir}/libOSMesa.so.*" 310FILES:libosmesa = "${libdir}/libOSMesa.so.*"
304FILES:libxatracker = "${libdir}/libxatracker.so.*" 311FILES:libxatracker = "${libdir}/libxatracker.so.*"
305 312
306FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so" 313FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so"
307FILES:libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" 314FILES:libegl-mesa-dev = "${libdir}/libEGL*.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
308FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" 315FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
309FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc" 316FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
317FILES:libglx-mesa-dev = "${libdir}/libGLX*.*"
310FILES:libglapi-dev = "${libdir}/libglapi.*" 318FILES:libglapi-dev = "${libdir}/libglapi.*"
311FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc" 319FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
312FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" 320FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"