All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC PATCH] package: {libgl, libglvnd, mesa3d}: Propagate libglvnd GL provider to libgl dependencies
@ 2026-10-18 16:06 John Ernberg
  2026-10-18 20:41 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: John Ernberg @ 2026-10-18 16:06 UTC (permalink / raw)
  To: buildroot
  Cc: John Ernberg, Adam Ford, Thomas Petazzoni, Bernd Kuhls,
	Joseph Kogut, Romain Naour

A package depending on libgl doesn't obtain all the provided features
of the package that libglvnd uses as a GL provider.

When building xorg-server with this configuration appended to the
x86_64_efi_defconfig:

    +BR2_PER_PACKAGE_DIRECTORIES=y
    +BR2_PACKAGE_LIBGLVND=y
    +BR2_PACKAGE_MESA3D=y
    +BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU=y
    +BR2_PACKAGE_MESA3D_OPENGL_GLX=y
    +BR2_PACKAGE_XORG7=y
    +BR2_PACKAGE_XSERVER_XORG_SERVER=y

The build will fail with the following error:

    configure: error: Package requirements (fixesproto >= 6.0
    damageproto >= 1.1 xcmiscproto >= 1.2.0 xtrans >= 1.3.5 bigreqsproto
    >= 1.1.0 xproto >= 7.0.31 randrproto >= 1.6.0 renderproto >= 0.11
    xextproto >= 7.2.99.901 inputproto >= 2.3.99.1 kbproto >= 1.0.3
    fontsproto >= 2.1.3 pixman-1 >= 0.27.2 videoproto recordproto >=
    1.13.99.1 resourceproto >= 1.2.0 xf86driproto >= 2.1.0 glproto >=
    1.4.17 dri >= 7.8.0 dri3proto presentproto >= 1.2 xineramaproto
    xkbfile  pixman-1 >= 0.27.2 xfont2 >= 2.0.0 xau xshmfence >= 1.1
    xdmcp) were not met:

    Package 'dri' not found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

xwayland will fail with a similar error, not finding dri.

This is because dri.pc is in this configuration is provided by mesa3d,
but libgl is provided by libglvnd, which does not depend on mesa3d
(because mesa3d depends on libglvnd to build the interface used by
libglvnd).

If libglvnd is extended to cover the nvidia-driver, dri.pc would be
provided by mesa3d-headers.

It seems that only libgl usually needs this extra bit, so EGL and GLES
are left untouched.

Cc: Adam Ford <aford173@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Bernd Kuhls <bernd@kuhls.net>
Cc: Joseph Kogut <joseph.kogut@gmail.com>
Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: John Ernberg <j@j-ernberg.se>

---

Previous approach adding mesa3d and mesa3d-headers conditionally to
xorg-server and xwayland was deemed incorrect [1].

RFC: Does this make sense, or should dri.pc providers be virtual
instead?

[1]: https://lore.kernel.org/buildroot/20260927204842.1113860-1-j@j-ernberg.se/
---
 package/libglvnd/Config.in    | 6 ++++++
 package/mesa3d/Config.in      | 3 +++
 package/opengl/libgl/libgl.mk | 9 +++++++++
 3 files changed, 18 insertions(+)

diff --git a/package/libglvnd/Config.in b/package/libglvnd/Config.in
index f471e289bd..b0d8a4efcb 100644
--- a/package/libglvnd/Config.in
+++ b/package/libglvnd/Config.in
@@ -27,6 +27,12 @@ config BR2_PACKAGE_LIBGLVND_DISPATCH_GL
 	select BR2_PACKAGE_XORGPROTO
 	select BR2_PACKAGE_HAS_LIBGL
 
+# So far only GL dependant packages are known to need other parts of
+# the dispatch GL providers components (e.g. xorg-xserver)
+config BR2_PACKAGE_LIBGLVND_DISPATCH_GL_PROVIDER
+	string
+	depends on BR2_PACKAGE_LIBGLVND_DISPATCH_GL
+
 config BR2_PACKAGE_LIBGLVND_DISPATCH_EGL
 	bool
 	select BR2_PACKAGE_HAS_LIBEGL
diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index e184039150..fc99345e32 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -488,6 +488,9 @@ config BR2_PACKAGE_MESA3D_OPENGL_GLX
 	help
 	  Enable GLX graphic acceleration (OpenGL + X11).
 
+config BR2_PACKAGE_LIBGLVND_DISPATCH_GL_PROVIDER
+	default "mesa3d" if BR2_PACKAGE_LIBGLVND && BR2_PACKAGE_LIBGLVND_DISPATCH_GL
+
 comment "OpenGL GLX support needs X11"
 	depends on !BR2_PACKAGE_XORG7
 
diff --git a/package/opengl/libgl/libgl.mk b/package/opengl/libgl/libgl.mk
index 7abc13d637..c747297ec0 100644
--- a/package/opengl/libgl/libgl.mk
+++ b/package/opengl/libgl/libgl.mk
@@ -4,4 +4,13 @@
 #
 ################################################################################
 
+# The dependency is for libgl consumers, not for the libglvnd package
+# as that creates a circular dependency since some providers need
+# libglvnd to build their compatible interfaces (e.g. mesa3d).
+ifeq ($(BR2_PACKAGE_LIBGLVND),y)
+ifneq ($(call qstrip,$(BR2_PACKAGE_LIBGLVND_DISPATCH_GL_PROVIDER)),)
+LIBGL_DEPENDENCIES += $(call qstrip,$(BR2_PACKAGE_LIBGLVND_DISPATCH_GL_PROVIDER))
+endif
+endif
+
 $(eval $(virtual-package))
-- 
2.54.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-10-19 12:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18 16:06 [Buildroot] [RFC PATCH] package: {libgl, libglvnd, mesa3d}: Propagate libglvnd GL provider to libgl dependencies John Ernberg
2026-10-18 20:41 ` Thomas Petazzoni via buildroot
2026-10-18 20:57   ` John Ernberg
2026-10-19  7:42     ` Thomas Petazzoni via buildroot
2026-10-19  5:53   ` Yann E. MORIN via buildroot
2026-10-19  7:40     ` Thomas Petazzoni via buildroot
2026-10-19  9:54       ` Yann E. MORIN via buildroot
2026-10-19 12:23         ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.