qt55: set QML import paths from NIX_PROFILES

+39 -1
+1 -1
pkgs/development/libraries/qt-5/5.5/default.nix
··· 73 73 /* qtandroidextras = not packaged */ 74 74 /* qtcanvas3d = not packaged */ 75 75 qtconnectivity = callPackage ./qtconnectivity.nix {}; 76 - qtdeclarative = callPackage ./qtdeclarative.nix {}; 76 + qtdeclarative = callPackage ./qtdeclarative {}; 77 77 qtdoc = callPackage ./qtdoc.nix {}; 78 78 qtenginio = callPackage ./qtenginio.nix {}; 79 79 qtgraphicaleffects = callPackage ./qtgraphicaleffects.nix {};
+1
pkgs/development/libraries/qt-5/5.5/qtdeclarative.nix pkgs/development/libraries/qt-5/5.5/qtdeclarative/default.nix
··· 2 2 3 3 qtSubmodule { 4 4 name = "qtdeclarative"; 5 + patches = [ ./0001-nix-profiles-import-paths.patch ]; 5 6 qtInputs = [ qtbase qtsvg qtxmlpatterns ]; 6 7 nativeBuildInputs = [ python ]; 7 8 }
+37
pkgs/development/libraries/qt-5/5.5/qtdeclarative/0001-nix-profiles-import-paths.patch
··· 1 + From 3f6fa74067aacd0e595e45b4ef7ce754514cb205 Mon Sep 17 00:00:00 2001 2 + From: Thomas Tuegel <ttuegel@gmail.com> 3 + Date: Sat, 17 Oct 2015 09:28:18 -0500 4 + Subject: [PATCH] nix profiles import paths 5 + 6 + --- 7 + src/qml/qml/qqmlimport.cpp | 14 ++++++++++++++ 8 + 1 file changed, 14 insertions(+) 9 + 10 + diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp 11 + index 5a54609..f33c2f9 100644 12 + --- a/src/qml/qml/qqmlimport.cpp 13 + +++ b/src/qml/qml/qqmlimport.cpp 14 + @@ -1549,6 +1549,20 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) 15 + QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); 16 + addImportPath(installImportsPath); 17 + 18 + + // Add import paths derived from NIX_PROFILES. 19 + + const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES"); 20 + + if (!nixProfilesEnv.isEmpty()) { 21 + + QLatin1Char pathSep(' '); 22 + + QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts); 23 + + for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) { 24 + + it->append("/lib/qt5/qml"); 25 + + QString canonicalPath = QDir(*it).canonicalPath(); 26 + + if (!canonicalPath.isEmpty()) { 27 + + addImportPath(canonicalPath); 28 + + } 29 + + } 30 + + } 31 + + 32 + // env import paths 33 + QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH"); 34 + if (!envImportPath.isEmpty()) { 35 + -- 36 + 2.5.2 37 +