User:MGorny/New eselect-opengl design

The problem
Proprietary graphic drivers provided by NVidia and AMD (ATi) tend to require non-standard system libraries (libGL, ...) and Xorg modules. Driver providers also include their own versions of system headers. All those files collide with the implementations provided by Xorg components.

Since we can't get all the three implementations to interoperate properly, we aim to support installing them side-by-side and switching between them easily.

The current solution
Currently the colliding files from the three providers are installed in subdirectories of /usr/lib*/eselect/opengl. The files for currently selected implementation are symlinked into the system directories. The symlinks are created and updated by eselect-opengl.

This solution has a few disadvantages:
 * the currently selected implementation affects both libraries used at build and run time, which makes the builds inconsistent in case of different implementation is used,
 * some packages build correctly only against xorg-x11 implementation of the interfaces — they currently need to use extra hacks to enforce that,
 * the relevant files in /usr are unowned and modified outside the package manager.