Skip to content

Commit d6b9ee7

Browse files
authored
Merge pull request probonopd#133 from J5lx/executable-rpath
Also set rpath for -executable=<path>
2 parents bd459f7 + 6340408 commit d6b9ee7

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)