Since I've been building mesa from git manually (for that very reason) for a while I can confirm that it builds and runs just fine without any X11-libraries, using the following line (for example): -disable-gles1 --enable-gles2 --disable-dri3 --enable-dri --disable-glx --enable-egl --with-gallium-drivers= --with-dri-drivers=i965 --disable-omx --disable-xa --with-vulkan-drivers=intel --with-egl-platforms=wayland,drm The following dependencies are then superfluous: x11-libs/libXxf86vm x11-libs/libXdamage x11-libs/libXext x11-libs/libxcb x11-libs/libXfixes x11-libs/libX11 x11-proto/glproto x11-libs/libxshmfence x11-proto/xf86driproto x11-proto/dri2proto
For user under wayland, that is (i.e. USE=wayland)
*** This bug has been marked as a duplicate of bug 560096 ***