Skip to content

Commit 6340408

Browse files
committed
Also set rpath for -executable=<path>, resolves probonopd#83
1 parent bd459f7 commit 6340408

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

shared/shared.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,10 +1059,14 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a
10591059
/* From now on let ldd exit if it doesn't find something */
10601060
qtDetectionComplete = 1;
10611061

1062+
QString libraryPath;
10621063
if(fhsLikeMode == false){
1063-
changeIdentification("$ORIGIN/lib/" + bundleLibraryDirectory, QFileInfo(applicationBundle.binaryPath).canonicalFilePath());
1064+
libraryPath = QFileInfo(applicationBundle.binaryPath).dir().filePath("lib/" + bundleLibraryDirectory);
10641065
} else {
1065-
changeIdentification("$ORIGIN/../lib/" + bundleLibraryDirectory, QFileInfo(applicationBundle.binaryPath).canonicalFilePath());
1066+
libraryPath = QFileInfo(applicationBundle.binaryPath).dir().filePath("../lib/" + bundleLibraryDirectory);
1067+
}
1068+
foreach (const QString &executable, QStringList() << applicationBundle.binaryPath << additionalExecutables) {
1069+
changeIdentification("$ORIGIN/" + QFileInfo(executable).dir().relativeFilePath(libraryPath) + "/" + bundleLibraryDirectory, QFileInfo(executable).canonicalFilePath());
10661070
}
10671071
applicationBundle.libraryPaths = findAppLibraries(appDirPath);
10681072
LogDebug() << "applicationBundle.libraryPaths:" << applicationBundle.libraryPaths;

0 commit comments

Comments
 (0)