User:ManDay/Deprecating the virtual OpenGL ebuild

This page discusses the resolution of

Current situation and historical context
Packages which want to use Khronos' OpenGL rendering API also need an API for creating a rendering context in the windowing system. The API for creating a rendering context specifically for X11 is called GLX and another, more generic API for Wayland and other windowing systems is called EGL.

Historically, Mesa provided its implementation of OpenGL and GLX in a single library called libGL. Since the OpenGL functionality was thereby glued to X11 functionality, it was either libGL with OpenGL and GLX - and therefore dependence on X11 libraries - or nothing. There was no support for (full) OpenGL on X11-free systems, such as those running pure Wayland.

Since the emergence of libglvnd, an abstraction to provide OpenGL regardless of which implementation - such as Mesa - runs behind it, this is no longer true. OpenGL and GLX are now provided though libglvnd's abstraction as separate pieces, called libOpenGL and libGLX, respectively.

Resulting problems

 * 1) Currently, many packages which require in any, nonspecific way OpenGL or GLX depend on   without finer distinction. , to satisfy all possible combinations, therefore pulls in   to guarantee the availability of GLX but, on the downside, requires X11, although it is often not needed.
 * 2) Further,  's original purpose to abstract away different OpenGL implementations is deprecated by libglvnd, which also extends to the abstraction of GLX, EGL, and GLES.

Resolution
Both problems can be adressed simultaneously. as a non-configurable middleman will be depreated in favour of depending on, which can be configured through USE-flags according to the depender's need of OpenGL, GLES, GLX, and EGL.

What should I do if my ebuild depends on ?
If your ebuild depends on  it does so because of the historically more correct reasons of needing an OpenGL component such as OpenGL itself or GLX, or because of the historically less correct reasons of needing another component which was coincidentally pulled in through , but not strictly related, such as Mesa's libgbm.

To choose the correct dependencies for your ebuild...


 * 1) Determine against which OpenGL libraries the software in your ebuild is linked and depend on   accordingly. If you do not know this off hand, you can use   (from ) or   (from ).
 * 2) * libGL or possibly libGLX →
 * 3) * libOpenGL →
 * 4) If your ebuild can be configured for with or without support for X, reflect the USE-Flag conditionally, e.g..
 * 5) Determine if there are hidden dependencies on unrelated libraries which were previously coincidentally provided and depend on the correct provider. Plausible candidates include
 * 6) * libgbm →
 * 7) Remove the dependency on