qtgui ebuild adds QT_NO_OPENGL macro in QCONFIG_DEFINE if there is not use flag, but do not add QT_OPENGL if there is one. Reproducible: Always Steps to Reproduce: 1. Install qtgui-5.3.0 with opengl use 2. Try to compile a program including QOpenGLShader Actual Results: error telling that class QOpenGLShader is not defined Expected Results: program compiling code in qtgui-5.3.0.ebuild : QCONFIG_DEFINE=( $(use accessibility && echo QT_ACCESSIBILITY_ATSPI_BRIDGE || echo QT_NO_ACCESSIBILITY_ATSPI_BRIDGE) $(use egl || echo QT_NO_EGL QT_NO_EGL_X11) $(use eglfs || echo QT_NO_EGLFS) $(use evdev || echo QT_NO_EVDEV) $(use gles2 && echo QT_OPENGL_ES QT_OPENGL_ES_2) $(use jpeg || echo QT_NO_IMAGEFORMAT_JPEG) $(use opengl || echo QT_NO_OPENGL) $(use png || echo QT_NO_IMAGEFORMAT_PNG) ) QtCore/qconfig.h : #if defined(QT_NO_OPENGL) && defined(QT_OPENGL) # undef QT_NO_OPENGL #elif !defined(QT_NO_OPENGL) && !defined(QT_OPENGL) # define QT_NO_OPENGL #endif
Fix available here : https://github.com/gentoo/qt/pull/57
The fix looks good, but I'm not sure if I understand what's really going on. We don't add QT_OPENGL because the configure script doesn't... # enable opengl if [ "$CFG_OPENGL" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL" else QT_CONFIG="$QT_CONFIG opengl" fi Can you attach your entire qconfig.h please?
Created attachment 379704 [details] qconfig.h with fix
Ok I see what's going on... QtCore/qconfig.h is generated when qtcore is built, i.e. when the opengl deps may or may not be installed. If they're not, CFG_OPENGL is set to "no", QT_NO_OPENGL ends up in QCONFIG_FLAGS, and the preprocessor stuff is generated. Later, when qtgui is built, it's too late to change qconfig.h. The patch is therefore correct, however this is just one symptom of a more general problem that has to be fixed for good at the eclass level (see also bug 510556).
Merged https://github.com/gentoo/qt/pull/59