The included patch from upstream fixes the issue described here:
https://bugreports.qt.io/browse/QTBUG-48321
The backing store of certain widgets was being improperly invalidated,
leading to display bugs in, e.g. VLC.
This patch is included in Qt 5.6, so we should remove it when we
upgrade.
Without this, configure will say:
Checking for openal... no
/tmp/nix-build-qtmultimedia-5.5.0.drv-0/qtmultimedia-opensource-src-5.5.0/qtmultimedia.pro:28:
Variable GST_VERSION is not defined.
Checking for resourcepolicy... no
And there may be application runtime errors like
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
After this fix, configure will say:
Checking for openal... no
Checking for gstreamer... yes
Checking for gstreamer_photography... no
Checking for gstreamer_encodingprofiles... yes
Checking for gstreamer_appsrc... yes
Checking for linux_v4l... yes
Checking for resourcepolicy... no
And the above runtime error will not appear.
This fix is similar to 449b6028 ("qt5.multimedia: fix gstreamer
support."), except with Qt 5.5 we also need to set GST_VERSION.
The runtime paths QT_PLUGIN_PATH, QML_IMPORT_PATH, QML2_IMPORT_PATH, and
XDG_DATA_DIRS did not include the appropriate paths from the current
package being built because addToSearchPath does not add directories
which don't exist.
Try to build e.g. the Qt5 Camera Example[1] and see that qmake fails to
find <GL/gl.h>. This fixes it.
[1] http://doc.qt.io/qt-5/qtmultimediawidgets-camera-example.html
(Although since nixpkgs qtcreator still lacks 'examples', we have to
download the sources manually and use "qmake && make".)
This seems to have been confusing people, using both xlibs and xorg, etc.
- Avoided renaming local (and different) xlibs binding in gcc*.
- Fixed cases where both xorg and xlibs were used.
Hopefully everything still works as before.
Fixes this problem, when building apps in QtCreator:
...(compile output window)
g++ -Wl,-rpath,/nix/store/1w7h7p6s2srfw2ady90k7072991lrnpp-qtbase-5.4.2/lib \
-o qt-test3 main.o mainwindow.o moc_mainwindow.o \
-L/nix/store/1w7h7p6s2srfw2ady90k7072991lrnpp-qtbase-5.4.2/lib \
-lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
/nix/store/b8qhjrwf8sf9ggkjxqqav7f1m6w83bh0-binutils-2.23.1/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
mesa is already in the closure of Qt, so there is no size increase.
The patch is copied into both qt-5.3 and qt-5.4 directories, like other
patches are.
Note that programs still can _run_ against a different libGL (e.g. one
provided by nvidia) by configuring the dynamic linker. For instance,
NixOS sets the LD_LIBRARY_PATH environment variable to
/run/opengl-driver/lib/, meaning that whatever libGL is found there
will be used instead of the default (mesa).
Set QT_PLUGIN_PATH, QML_IMPORT_PATH, and QML2_IMPORT_PATH during build
so that Qt programs may easily be wrapped for use outside NixOS. The
paths are set appropriately for the dependencies of the package.
Due to a bug somewhere, the qt documentation is by default placed in
$out/share/doc although "qmake -query" reports $out/doc. That
discrepancy causes qtcreator withDocumentation builds to fail. This
fixes it.