From e40579d91e1de6cf920bbea52732b2317e0ea2ef Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 23 Aug 2015 10:16:21 -0500 Subject: [PATCH] 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. --- pkgs/development/libraries/qt-5/5.4/qt-submodule.nix | 6 ------ pkgs/development/libraries/qt-5/5.4/setup-hook.sh | 12 ++++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix b/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix index b242661270d..4012b637e28 100644 --- a/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix +++ b/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix @@ -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" diff --git a/pkgs/development/libraries/qt-5/5.4/setup-hook.sh b/pkgs/development/libraries/qt-5/5.4/setup-hook.sh index 940b9d4e7a1..6866e4c57bd 100644 --- a/pkgs/development/libraries/qt-5/5.4/setup-hook.sh +++ b/pkgs/development/libraries/qt-5/5.4/setup-hook.sh @@ -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 }