Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301337 - virtual/opengl doesn't have to depend on media-libs/mesa
Summary: virtual/opengl doesn't have to depend on media-libs/mesa
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Low enhancement with 6 votes (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-18 06:32 UTC by stshine
Modified: 2020-12-13 04:17 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stshine 2010-01-18 06:32:05 UTC
When I try to emerge wine with 'opengl' USE flag, the dependency requires media-libs/mesa. But my video card is GT8600, and nvidia-drivers proved opengl toolkit by itself. So I copied /usr/include/GL/* header files from source package of mesa , and then USE="opengl" emerge -O wine, and everything works fine, so I don't have to install those libdrm thing. I hope there would be a ebuild like opengl-headers.

Reproducible: Always
Comment 1 Tomáš Chvátal (RETIRED) gentoo-dev 2010-01-21 17:52:11 UTC
That won't happen easily because those headers are quite fragile.

I am leaving it open if someone in X11 team have free time and will be willing to work on it.
Comment 2 Matt Turner gentoo-dev 2012-08-11 18:06:54 UTC
CC'd nvidia-drivers and ati-drivers maintainers, since this bug would benefit you.

It seems to me like proprietary drivers + OpenGL headers would satisfy this virtual, and would allow you to not have to have Mesa installed at all.

Maybe you guys are interested in working on this.
Comment 3 Doug Goldstein gentoo-dev 2012-08-11 18:39:25 UTC
Its definitely something I would consider doing, the effort involved won't be a small task from a testing perspective.
Comment 4 Enrico Tagliavini 2012-08-14 15:01:06 UTC
Sorry guys I'm not more the ati-drivers maintainer, I sold my AMD powered laptop
Comment 5 Doug Goldstein gentoo-dev 2012-11-19 00:57:59 UTC
So the rough idea is this:

Add media-libs/khronos-headers which has copies of the Khronos headers.
Add virtual/opengl-headers which has: DEPEND="|| ( media-libs/mesa media-libs/khronos-headers )"
Change virtual/opengl to have RDEPEND="|| ( media-libs/mesa media-libs/opengl-apple x11-drivers/nvidia-drivers x11-drivers/ati-drivers )"

Some options are to not add opengl-headers and instead have virtual/opengl:

RDEPEND="|| (
    media-libs/mesa
    media-libs/opengl-apple
    ( media-libs/khronos-headers
      || (
         x11-drivers/nvidia-drivers
         x11-drivers/ati-drivers
      )
    )"


I'd also like to get rid of the headers that eselect-opengl provides, glext.h and glxext.h and let mesa install its own and let khronos-headers install them as well.
Comment 6 Matt Turner gentoo-dev 2013-01-01 19:30:38 UTC
(In reply to comment #5)
> So the rough idea is this:
> 
> Add media-libs/khronos-headers which has copies of the Khronos headers.
> Add virtual/opengl-headers which has: DEPEND="|| ( media-libs/mesa
> media-libs/khronos-headers )"
> Change virtual/opengl to have RDEPEND="|| ( media-libs/mesa
> media-libs/opengl-apple x11-drivers/nvidia-drivers x11-drivers/ati-drivers )"
> 
> Some options are to not add opengl-headers and instead have virtual/opengl:
> 
> RDEPEND="|| (
>     media-libs/mesa
>     media-libs/opengl-apple
>     ( media-libs/khronos-headers
>       || (
>          x11-drivers/nvidia-drivers
>          x11-drivers/ati-drivers
>       )
>     )"
> 
> 
> I'd also like to get rid of the headers that eselect-opengl provides,
> glext.h and glxext.h and let mesa install its own and let khronos-headers
> install them as well.

Sounds good. Go for it! :)
Comment 7 stshine 2013-04-28 09:59:16 UTC
(In reply to comment #5)
> So the rough idea is this:
> 
> Add media-libs/khronos-headers which has copies of the Khronos headers.
> Add virtual/opengl-headers which has: DEPEND="|| ( media-libs/mesa
> media-libs/khronos-headers )"
> Change virtual/opengl to have RDEPEND="|| ( media-libs/mesa
> media-libs/opengl-apple x11-drivers/nvidia-drivers x11-drivers/ati-drivers )"
> 
> Some options are to not add opengl-headers and instead have virtual/opengl:
> 
> RDEPEND="|| (
>     media-libs/mesa
>     media-libs/opengl-apple
>     ( media-libs/khronos-headers
>       || (
>          x11-drivers/nvidia-drivers
>          x11-drivers/ati-drivers
>       )
>     )"
> 
> 
> I'd also like to get rid of the headers that eselect-opengl provides,
> glext.h and glxext.h and let mesa install its own and let khronos-headers
> install them as well.

Hi,I made a little study and found that both NVIDIA's and AMD's offered these opengl headers (gl.h, glext.h, glx.h, glxext.h) by themselves.
Hope If this would be useful.
Comment 8 Michael Seifert 2014-09-22 09:07:03 UTC
(In reply to Doug Goldstein from comment #5)
> So the rough idea is this:
> 
> Add media-libs/khronos-headers which has copies of the Khronos headers.
> Add virtual/opengl-headers which has: DEPEND="|| ( media-libs/mesa
> media-libs/khronos-headers )"
> Change virtual/opengl to have RDEPEND="|| ( media-libs/mesa
> media-libs/opengl-apple x11-drivers/nvidia-drivers x11-drivers/ati-drivers )"
> 
> Some options are to not add opengl-headers and instead have virtual/opengl:
> 
> RDEPEND="|| (
>     media-libs/mesa
>     media-libs/opengl-apple
>     ( media-libs/khronos-headers
>       || (
>          x11-drivers/nvidia-drivers
>          x11-drivers/ati-drivers
>       )
>     )"
> 
> 
> I'd also like to get rid of the headers that eselect-opengl provides,
> glext.h and glxext.h and let mesa install its own and let khronos-headers
> install them as well.

I'd rather go for the separate virtual/opengl-headers ebuild. It is the cleaner solution and more in line with other packages, such as sys-kernel/linux-headers.

Why is it necessary to add media-libs/khronos-headers? Shouldn't virtual/opengl-headers simply depend on all ebuilds that provide the needed headers?

Cross-compile environments would also benefit from this change: Whenever an ebuild depends on virtual/opengl, the package currently tries to pull mesa and x11-libs, which might not be available for the compile target (e.g. Windows).
By the way, dev-util/mingw64-runtime-3.2.0-r1 also provides the OpenGL headers.
Comment 9 xpue 2015-12-04 07:51:58 UTC
If anyone interested, minimum files needed from mesa for opengl on nvidia-drivers:

/usr/include/GL/gl.h
/usr/include/GL/glext.h
/usr/include/GL/glcorearb.h

/usr/include/GL/glx.h
/usr/include/GL/glxext.h

/usr/include/GL/internal/dri_interface.h

/usr/lib64/pkgconfig/dri.pc
/usr/lib64/pkgconfig/gl.pc

/usr/lib64/libGL.so -> /usr/lib64/opengl/nvidia/lib/libGL.so
/usr/lib64/libGL.so.1 -> /usr/lib64/opengl/nvidia/lib/libGL.so.1
Comment 10 Matt Turner gentoo-dev 2020-08-12 04:05:31 UTC
Now that USE=libglvnd is use.force'd, this is probably trivial to accomplish.

The only concern that comes to mind is whether users might need to add media-libs/mesa to @world in order to keep it installed. Not a big issue though.
Comment 11 Maciej Mrozowski gentoo-dev 2020-10-14 00:22:20 UTC
So, what's the approach?
Can we just replace mesa with libglvnd in virtual/opengl?
Comment 12 Matt Turner gentoo-dev 2020-10-14 01:03:51 UTC
(In reply to Maciej Mrozowski from comment #11)
> So, what's the approach?
> Can we just replace mesa with libglvnd in virtual/opengl?

Someone should give it a try and see what breaks. Then after they've fixed the breakage they should make a pull request.
Comment 13 Bug Bugs 2020-12-13 04:17:11 UTC
I guess GL/internal/dri_interface.h includes should be replaced with "local" includes for packages which uses them, e.g. x11-base/xorg-server:
glx/glxdricommon.c
glx/glxdriswrast.c
glx/glxdri2.c

(should be safe to copy dri_interface.h from mesa into include/ )

Also, pkgconfig/dri.pc should be provided by an different package, but I'm not sure should it be media-libs/libglvnd.

AFAIKT pretty much everything else in my system compiles and work fine w/o media-libs/mesa.