diff options
author | Adrien Nader <adrien@notk.org> | 2015-01-14 23:18:37 +0100 |
---|---|---|
committer | Adrien Nader <adrien@notk.org> | 2015-01-14 23:18:37 +0100 |
commit | 2a643dfe65f2309f7c7ee353a6a189ec7fcc108e (patch) | |
tree | 29c1f03acee95b2da773c5d3ecb1c16aa2919071 | |
parent | 0b8570ef9f7c4169d08d228f5fa3849faeb024e8 (diff) |
qt: make "plugins" relocatable relative to Qt5Core.dll.
-rw-r--r-- | l/qt/0001-QCoreApplication-ibraryPaths-discovers-plugpath-rela.patch | 38 | ||||
-rwxr-xr-x | l/qt/qt.SlackBuild | 4 |
2 files changed, 42 insertions, 0 deletions
diff --git a/l/qt/0001-QCoreApplication-ibraryPaths-discovers-plugpath-rela.patch b/l/qt/0001-QCoreApplication-ibraryPaths-discovers-plugpath-rela.patch new file mode 100644 index 0000000..cef9b8f --- /dev/null +++ b/l/qt/0001-QCoreApplication-ibraryPaths-discovers-plugpath-rela.patch @@ -0,0 +1,38 @@ +From 62403408303a6055a9563b34c973d4fd20994d37 Mon Sep 17 00:00:00 2001 +From: Adrien Nader <adrien@notk.org> +Date: Wed, 14 Jan 2015 23:16:55 +0100 +Subject: [PATCH] QCoreApplication: ibraryPaths() discovers plugpath relative + to Qt5Core.dll. + +--- + qtbase/src/corelib/kernel/qcoreapplication.cpp | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/qtbase/src/corelib/kernel/qcoreapplication.cpp b/qtbase/src/corelib/kernel/qcoreapplication.cpp +index 6868eb6..952c6ab 100644 +--- a/qtbase/src/corelib/kernel/qcoreapplication.cpp ++++ b/qtbase/src/corelib/kernel/qcoreapplication.cpp +@@ -2408,6 +2408,20 @@ QStringList QCoreApplication::libraryPaths() + if (!app_libpaths->contains(installPathPlugins)) + app_libpaths->append(installPathPlugins); + } ++#ifdef _WIN32 ++ HMODULE phModule; ++ QString installPathQtCoreDll; ++ if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR) QCoreApplication::libraryPaths, &phModule)) { ++ char qt_core_path[512]; ++ DWORD ret = GetModuleFileNameA(phModule, qt_core_path, sizeof(qt_core_path)); ++ if (ret > 0 && ret < sizeof(qt_core_path)) { ++ QString p = QString(qt_core_path); ++ QString pp = QFileInfo(p).dir().filePath(QString("../plugins")); ++ QString ppp = QDir(pp).canonicalPath(); ++ app_libpaths->append(ppp); ++ } ++ } ++#endif + + // If QCoreApplication is not yet instantiated, + // make sure we add the application path when we construct the QCoreApplication +-- +1.8.4 + diff --git a/l/qt/qt.SlackBuild b/l/qt/qt.SlackBuild index 63b9191..69d676b 100755 --- a/l/qt/qt.SlackBuild +++ b/l/qt/qt.SlackBuild @@ -75,6 +75,7 @@ find . \ #! PATCH sed -i 's/Shlwapi.h/shlwapi.h/' qttools/src/windeployqt/utils.cpp +#! PATCH case "${HOST_TRIPLET}" in *-*-mingw*) cat $CWD/0001-configure-use-pkg-config-for-libpng.patch \ @@ -89,6 +90,9 @@ case "${HOST_TRIPLET}" in sed -i '/option.host_build./ d' qtactiveqt/src/tools/idc/idc.pro + cat $CWD/0001-QCoreApplication-ibraryPaths-discovers-plugpath-rela.patch \ + | patch -p1 --verbose + EXEEXT=".exe" ;; *) |