2015-06-13 17:11:01 +02:00
|
|
|
From 723c9b1268a04127647a1c20eebe9804150566dd Mon Sep 17 00:00:00 2001
|
|
|
|
From: Thomas Tuegel <ttuegel@gmail.com>
|
|
|
|
Date: Sat, 13 Jun 2015 08:57:55 -0500
|
|
|
|
Subject: [PATCH] kinit libpath
|
|
|
|
|
|
|
|
---
|
|
|
|
src/kdeinit/kinit.cpp | 18 ++++++++++--------
|
|
|
|
1 file changed, 10 insertions(+), 8 deletions(-)
|
|
|
|
|
2015-03-13 22:27:49 +01:00
|
|
|
diff --git a/src/kdeinit/kinit.cpp b/src/kdeinit/kinit.cpp
|
2015-06-13 17:11:01 +02:00
|
|
|
index 9e775b6..0ac5646 100644
|
2015-03-13 22:27:49 +01:00
|
|
|
--- a/src/kdeinit/kinit.cpp
|
|
|
|
+++ b/src/kdeinit/kinit.cpp
|
2015-06-13 17:11:01 +02:00
|
|
|
@@ -660,15 +660,17 @@ static pid_t launch(int argc, const char *_name, const char *args,
|
2015-03-13 22:27:49 +01:00
|
|
|
if (!libpath.isEmpty()) {
|
|
|
|
if (!l.load()) {
|
|
|
|
if (libpath_relative) {
|
|
|
|
- // NB: Because Qt makes the actual dlopen() call, the
|
|
|
|
- // RUNPATH of kdeinit is *not* respected - see
|
|
|
|
- // https://sourceware.org/bugzilla/show_bug.cgi?id=13945
|
|
|
|
- // - so we try hacking it in ourselves
|
|
|
|
- QString install_lib_dir = QFile::decodeName(
|
|
|
|
- CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/");
|
|
|
|
- libpath = install_lib_dir + libpath;
|
|
|
|
- l.setFileName(libpath);
|
|
|
|
+ // Use QT_PLUGIN_PATH to find shared library directories
|
2015-06-13 17:11:01 +02:00
|
|
|
+ // For KF5, the plugin path is /lib/qt5/plugins/, so kdeinit5
|
|
|
|
+ // shared libraries should be in /lib/qt5/plugins/../../
|
2015-03-13 22:27:49 +01:00
|
|
|
+ const QRegExp pathSepRegExp(QString::fromLatin1("[:\b]"));
|
2015-06-13 17:11:01 +02:00
|
|
|
+ const QString up = QString::fromLocal8Bit("/../../");
|
2015-03-13 22:27:49 +01:00
|
|
|
+ const QStringList paths = QString::fromLocal8Bit(qgetenv("QT_PLUGIN_PATH")).split(pathSepRegExp, QString::KeepEmptyParts);
|
|
|
|
+ Q_FOREACH (const QString &path, paths) {
|
|
|
|
+ l.setFileName(path + up + libpath);
|
|
|
|
l.load();
|
|
|
|
+ if (l.isLoaded()) break;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!l.isLoaded()) {
|
2015-06-13 17:11:01 +02:00
|
|
|
--
|
|
|
|
2.4.2
|
|
|
|
|