qt54: set runtime env vars during build for makeWrapper

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.
This commit is contained in:
Thomas Tuegel 2015-08-23 10:16:21 -05:00
parent 39c76445b9
commit e40579d91e
2 changed files with 12 additions and 6 deletions

View File

@ -20,12 +20,6 @@ mkDerivation (args // {
dontFixLibtool = args.dontFixLibtool or true;
configureScript = args.configureScript or "qmake";
/*
preConfigure = ''
export PATH="$out/bin:$PATH"
'';
*/
postInstall = ''
rm "$out/bin/qmake" "$out/bin/qt.conf"

View File

@ -25,6 +25,18 @@ addQtModule() {
if [[ -n $qtSubmodule ]]; then
find "$1/lib" -printf 'lib/%P\n' >> "$qtOut/nix-support/qt-inputs"
fi
if [[ -d "$1/lib/qt5/plugins" ]]; then
QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}$1/lib/qt5/plugins";
fi
if [[ -d "$1/lib/qt5/imports" ]]; then
QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}$1/lib/qt5/imports";
fi
if [[ -d "$1/lib/qt5/qml" ]]; then
QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}$1/lib/qt5/qml";
fi
fi
fi
}