From 05f2f03a888752c1c5c6f843080e0d6bbe319a22 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sat, 19 Nov 2016 13:37:52 +0100 Subject: [PATCH] Continue FHS-like mode --- linuxdeployqt/main.cpp | 10 +++------- shared/shared.cpp | 13 +++++++++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/linuxdeployqt/main.cpp b/linuxdeployqt/main.cpp index de2f5f9..356c55c 100644 --- a/linuxdeployqt/main.cpp +++ b/linuxdeployqt/main.cpp @@ -120,20 +120,16 @@ int main(int argc, char **argv) } QString appDirPath; - if(fhsLikeMode == false){ - appDirPath = appDir; - } else { - appDirPath = QDir::cleanPath(fhsPrefix + "/../"); - } - qDebug() << "appDirPath:" << appDirPath; - QString relativeBinPath; if(fhsLikeMode == false){ + appDirPath = appDir; relativeBinPath = appName; } else { + appDirPath = QDir::cleanPath(fhsPrefix + "/../"); QString relativePrefix = fhsPrefix.replace(appDirPath+"/", ""); relativeBinPath = relativePrefix + "/bin/" + appName; } + qDebug() << "appDirPath:" << appDirPath; qDebug() << "relativeBinPath:" << relativeBinPath; QFile appRun(appDirPath + "/AppRun"); diff --git a/shared/shared.cpp b/shared/shared.cpp index 6b43b7b..ece28f1 100644 --- a/shared/shared.cpp +++ b/shared/shared.cpp @@ -219,7 +219,12 @@ int containsHowOften(QStringList haystack, QString needle) { LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet &rpaths) { - bundleLibraryDirectory= "lib"; // relative to bundle + if(fhsLikeMode == false){ + bundleLibraryDirectory= "lib"; // relative to bundle + } else { + QString relativePrefix = fhsPrefix.replace(appDirPath+"/", ""); + bundleLibraryDirectory = relativePrefix + "/lib/"; + } LogDebug() << "bundleLibraryDirectory:" << bundleLibraryDirectory; LibraryInfo info; @@ -764,7 +769,11 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a setenv("LD_LIBRARY_PATH",newPath.toUtf8().constData(),1); } - changeIdentification("$ORIGIN/" + bundleLibraryDirectory, applicationBundle.binaryPath); + if(fhsLikeMode == false){ + changeIdentification("$ORIGIN/" + bundleLibraryDirectory, applicationBundle.binaryPath); + } else { + changeIdentification("$ORIGIN/../lib/" + bundleLibraryDirectory, applicationBundle.binaryPath); + } applicationBundle.libraryPaths = findAppLibraries(appDirPath); LogDebug() << "applicationBundle.libraryPaths:" << applicationBundle.libraryPaths;