Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 890334 - virtual/opengl should not depend specifically on mesa[X]
Summary: virtual/opengl should not depend specifically on mesa[X]
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo X packagers
URL: https://wiki.gentoo.org/wiki/User:Man...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-01-10 10:34 UTC by Cedric Sodhi
Modified: 2024-02-27 20:17 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for opengl-7.0-r2.ebuild (opengl.patch,528 bytes, patch)
2023-07-16 11:21 UTC, junkmailnotread
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Sodhi 2023-01-10 10:34:01 UTC
Historically, OpenGL was provided by libGL in Mesa, which in turn only came from GLX. Therefore, if someone wanted (full) OpenGL (as opposed to GLES) from Mesa, they needed USE=X on Mesa.

Since splitting libGlVnd from Mesa, OpenGL is now provided by libOpenGL, which is decoupled from GLX. Therefore, we can have OpenGL without X11 related components.

Bug 560096 added IUSE=X to Mesa to enable/disable GLX, but at the same time introduced the mesa[X] dependency into virtual/opengl with 105caec6052322f095a5ee26ae097798aa9b5a9e to make sure everyone requiring OpenGL would still get it from Mesa.

However, this means effectively a dependency on GLX and thereby X11, which is uneeded in many cases where the consumer works with libOpenGl instead of libGl (e.g. media-gfx/blender).

I suppose that ideally, those consumers of OpenGL which explicitly require GLX (X11 related APIs from OpenGL) would express this besides their dependence on virtual/opengl (by depending on mesa[X]) while virtual/opengl should depend on media-libs/mesa only in a way that guarantees either libGL or libOpenGL (I'm not entirely sure how/if the presence of libOpenGL is controlled in Mesa, currently).

Alternatively (but I think it's the worse alternative), IUSE=X could be reflected on virtual/opengl to control its dependence on mesa[X].
Comment 1 Cedric Sodhi 2023-01-11 14:30:04 UTC
Something between "closely related" and "dupe of" bug 301337.
Comment 2 junkmailnotread 2023-07-16 11:21:42 UTC
Created attachment 865594 [details, diff]
Patch for opengl-7.0-r2.ebuild

Allows virtual/opengl and media-libs/mesa to be built without X USE flag.
Comment 3 Ionen Wolkens gentoo-dev 2023-07-16 11:33:04 UTC
(In reply to junkmailnotread from comment #2)
> Created attachment 865594 [details, diff] [details, diff]
> Patch for opengl-7.0-r2.ebuild
> 
> Allows virtual/opengl and media-libs/mesa to be built without X USE flag.
It's not something that can just be changed on virtual/opengl without extra work. Some revdeps need libglvnd[X] and some others don't -- and then mesa[X] at least guarantee libglvnd is built with USE=X for now preventing anything from breaking. So if add a USE=X, would still need to check all revdeps for which ones need virtual/opengl[X] and which don't.

Given little reason for this virtual nowadays, virtual/opengl is slowly getting replaced by libglvnd or libglvnd[X] (as needed) in ebuilds though.
Comment 4 junkmailnotread 2023-07-16 11:38:10 UTC
Understood. I encountered this bug in my attempt to build a pure Wayland desktop. This patch was my path of least resistance.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-27 14:28:16 UTC
OP did write up a plan at https://wiki.gentoo.org/wiki/User:ManDay/Deprecating_the_virtual_OpenGL_ebuild. Just someone has to start executing it.