Skip to content

Commit

Permalink
Attempt to obey pre-existing RPATHs, #52
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd committed Jun 10, 2017
1 parent 6d4c1d9 commit 9a93e03
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions shared/shared.cpp
Expand Up @@ -752,10 +752,12 @@ void changeIdentification(const QString &id, const QString &binaryPath)
// FIXME: Split along ":" characters, check each one, only append to LD_LIBRARY_PATH if not already there
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString oldPath = env.value("LD_LIBRARY_PATH");
QString newPath = oldRpath + ":" + oldPath; // FIXME: If we use a ldd replacement, we still need to observe this path
// FIXME: Directory layout might be different for system Qt; cannot assume lib/ to always be inside the Qt directory
LogDebug() << "Added to LD_LIBRARY_PATH:" << newPath;
setenv("LD_LIBRARY_PATH",newPath.toUtf8().constData(),1);
if (not oldPath.contains(oldRpath)){
QString newPath = oldRpath + ":" + oldPath; // FIXME: If we use a ldd replacement, we still need to observe this path
// FIXME: Directory layout might be different for system Qt; cannot assume lib/ to always be inside the Qt directory
LogDebug() << "Added to LD_LIBRARY_PATH:" << newPath;
setenv("LD_LIBRARY_PATH",newPath.toUtf8().constData(),1);
}
}
LogNormal() << "Changing rpath in" << binaryPath << "to" << id;
runPatchelf(QStringList() << "--set-rpath" << id << binaryPath);
Expand Down

0 comments on commit 9a93e03

Please sign in to comment.