Correctly handle libraries in subdirectories (#328)
Leave libs that are already in the AppDir in their current location
This commit is contained in:
@@ -520,6 +520,10 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath,
|
||||
info.deployedInstallName = "$ORIGIN"; // + info.binaryName;
|
||||
info.libraryPath = info.libraryDirectory + info.binaryName;
|
||||
info.sourceFilePath = info.libraryPath;
|
||||
if (info.libraryPath.contains(appDirPath))
|
||||
// leave libs that are already in the appdir in their current location
|
||||
info.libraryDestinationDirectory = QDir(appDirPath).relativeFilePath(info.libraryDirectory);
|
||||
else
|
||||
info.libraryDestinationDirectory = bundleLibraryDirectory + "/";
|
||||
info.binaryDestinationDirectory = info.libraryDestinationDirectory;
|
||||
info.binaryDirectory = info.libraryDirectory;
|
||||
@@ -841,8 +845,21 @@ void changeIdentification(const QString &id, const QString &binaryPath)
|
||||
setenv("LD_LIBRARY_PATH",newPath.toUtf8().constData(),1);
|
||||
}
|
||||
}
|
||||
LogNormal() << "Changing rpath in" << binaryPath << "to" << id;
|
||||
runPatchelf(QStringList() << "--set-rpath" << id << binaryPath);
|
||||
|
||||
QStringList rpath = oldRpath.split(":", QString::SkipEmptyParts);
|
||||
rpath.prepend(id);
|
||||
rpath.removeDuplicates();
|
||||
foreach(QString path, QStringList(rpath)) {
|
||||
// remove any non-relative path that would point outside the package
|
||||
if (!path.startsWith("$ORIGIN"))
|
||||
{
|
||||
LogWarning() << "Removing absolute rpath of " << path << " in " << binaryPath;
|
||||
rpath.removeAll(path);
|
||||
}
|
||||
}
|
||||
|
||||
LogNormal() << "Changing rpath in" << binaryPath << "to" << rpath.join(":");
|
||||
runPatchelf(QStringList() << "--set-rpath" << rpath.join(":") << binaryPath);
|
||||
|
||||
// qt_prfxpath:
|
||||
if (binaryPath.contains("libQt5Core")) {
|
||||
|
||||
Reference in New Issue
Block a user