When building qtgui-5.0.1 I encountered a few issues: (1) With the kms use flag and all other use flags on (except the always-disabled "test"-flag), the build log gave an error that the QT OpenGL module was not found. I could install qtgui without the kms use flag, though. After also installing qtwidgets and qtopengl, the error disappeared. There is therefore a circular dependency: qtgui[kms] requires qtopengl, which requires qtgui in turn. (2) After installing qtopengl, qtgui still wouldn't compile with the kms use flag on. I got errors in src/plugins/platforms/kms/qkmsbackingstore.cpp that glEnableVertexAttribArray, glVertexAttribPointer, and glDisableVertexAttribArray were not declared in this scope. After adding #include "qkmsscreen.h" to src/plugins/platforms/kms/qkmsbackingstore.cpp it compiled fine.
Created attachment 342714 [details, diff] fix undeclared variables Apply to qtgui-5.0.1.ebuild, by adding PATCHES=${FILESDIR}/kmsinclude.patch
Is this reproducible with 5.1.0_beta or later?
I deleted qtopengl-5.0.1, for ensuring I would see a circular dependency, if it still existed. After that I could emerge the following packages without problems, with the given USE flags: qtcore-5.1.0_beta1: USE="c++11 debug glib icu {-test}" qtgui-5.1.0_beta1: USE="c++11 debug eglfs evdev gif gles2 glib jpeg kms* opengl png udev xcb -accessibility* {-test} (-egl%*)" qtwidgets-5.1.0_beta1: USE="c++11 debug {-test}" qtopengl-5.1.0_beta1: USE="c++11 debug {-test}" 5.1.0_beta1 thus solves both issues :-)