Summary: | virtual/opengl doesn't have to depend on media-libs/mesa | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | stshine <pu.stshine> |
Component: | Current packages | Assignee: | Gentoo X packagers <x11> |
Status: | CONFIRMED --- | ||
Severity: | enhancement | CC: | cardoe, chewi, dan, enrico.tagliavini, lu_zero, m.seifert |
Priority: | Low | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/gentoo/gentoo/pull/35556 https://bugs.gentoo.org/show_bug.cgi?id=890334 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
stshine
2010-01-18 06:32:05 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. 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. Its definitely something I would consider doing, the effort involved won't be a small task from a testing perspective. Sorry guys I'm not more the ati-drivers maintainer, I sold my AMD powered laptop 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. (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! :) (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. (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. 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 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. So, what's the approach? Can we just replace mesa with libglvnd in virtual/opengl? (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. 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. Unfortunately some out-of-tree apps wants libgbm.so (Electron for example). The only provider in Gentoo is mesa, while libgbm usually a separate package in other distros. I managed to build mesa with only "gbm" flag enabled and using hack. I also got missing parts with it: $ equery f mesa * Searching for mesa ... * Contents of media-libs/mesa-21.0.0_rc3: /usr /usr/include /usr/include/GL /usr/include/GL/internal /usr/include/GL/internal/dri_interface.h /usr/include/gbm.h /usr/lib /usr/lib/libgbm.so -> libgbm.so.1 /usr/lib/libgbm.so.1 -> libgbm.so.1.0.0 /usr/lib/libgbm.so.1.0.0 /usr/lib/pkgconfig /usr/lib/pkgconfig/dri.pc /usr/lib/pkgconfig/gbm.pc /usr/lib64 /usr/lib64/libgbm.so -> libgbm.so.1 /usr/lib64/libgbm.so.1 -> libgbm.so.1.0.0 /usr/lib64/libgbm.so.1.0.0 /usr/lib64/pkgconfig /usr/lib64/pkgconfig/dri.pc /usr/lib64/pkgconfig/gbm.pc /usr/share /usr/share/doc /usr/share/doc/mesa-21.0.0_rc3 /usr/share/doc/mesa-21.0.0_rc3/README.rst.bz2 /usr/share/drirc.d /usr/share/drirc.d/00-mesa-defaults.conf The hack (because mesa disables dri backend when no drivers asked, and then failing to link): $ cat /etc/portage/patches/media-libs/mesa/build-gbm-only.patch --- a/meson.build +++ b/meson.build @@ -176,6 +176,8 @@ if dri_drivers.contains('auto') error('Unknown OS @0@. Please pass -Ddri-drivers to set driver options. Patches gladly accepted to fix this.'.format( host_machine.system())) endif +else + dri_drivers = ['nvidia'] endif with_dri_i915 = dri_drivers.contains('i915') Similar bug already filed: #760546 Maybe makes sense to provide separate libgbm package and replace all media-libs/mesa[gbm] dependencies with it? Then media-libs/mesa[egl] with media-libs/libglvnd and we'll be fine. > Maybe makes sense to provide separate libgbm package and replace all media-libs/mesa[gbm] dependencies with it? Then media-libs/mesa[egl] with media-libs/libglvnd and we'll be fine.
That sounds like the wrong solution, especially for out-of-tree packages. Just depend on mesa[gbm]. virtual/opengl isn't there to provide libgbm.
|