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.
If not explicitly disabled, Qt tries to detect support for the various
instruction sets. As a result, binaries built on Hydra may use
instruction sets unsupported by clients.
This disables propagated of Qt 5 build inputs at the request of
@edolstra. If this breaks your build, you need to add the missing
dependencies yourself. If this breaks your package at runtime, you need
to wrap your package to set either the plugin path or the QML import
path.