Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 515080

Summary: [qt overlay] dev-qt/qtgui-5.3.0 not defining QT_OPENGL
Product: Gentoo Linux Reporter: JY <jy454>
Component: [OLD] LibraryAssignee: Qt Bug Alias <qt>
Severity: normal CC: josef64
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Attachments: qconfig.h with fix

Description JY 2014-06-25 09:21:05 UTC
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 :

$(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
Comment 1 JY 2014-06-25 10:02:45 UTC
Fix available here :
Comment 2 Davide Pesavento gentoo-dev 2014-06-26 00:08:42 UTC
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
    QT_CONFIG="$QT_CONFIG opengl"

Can you attach your entire qconfig.h please?
Comment 3 JY 2014-06-26 07:43:02 UTC
Created attachment 379704 [details]
qconfig.h with fix
Comment 4 Davide Pesavento gentoo-dev 2014-06-28 02:25:11 UTC
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).
Comment 5 Davide Pesavento gentoo-dev 2014-06-28 02:38:28 UTC