|
@ -44,9 +44,11 @@ |
|
|
#include <QRegularExpression> |
|
|
#include <QRegularExpression> |
|
|
#include "shared.h" |
|
|
#include "shared.h" |
|
|
|
|
|
|
|
|
|
|
|
QString appBinaryPath; |
|
|
bool runStripEnabled = true; |
|
|
bool runStripEnabled = true; |
|
|
bool bundleAllButCoreLibs = false; |
|
|
bool bundleAllButCoreLibs = false; |
|
|
|
|
|
bool fhsLikeMode = false; |
|
|
|
|
|
QString fhsPrefix; |
|
|
bool alwaysOwerwriteEnabled = false; |
|
|
bool alwaysOwerwriteEnabled = false; |
|
|
QStringList librarySearchPath; |
|
|
QStringList librarySearchPath; |
|
|
bool appstoreCompliant = false; |
|
|
bool appstoreCompliant = false; |
|
@ -81,7 +83,7 @@ QDebug operator<<(QDebug debug, const LibraryInfo &info) |
|
|
return debug; |
|
|
return debug; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const QString bundleLibraryDirectory = "lib"; // the same directory as the main executable; could define a relative subdirectory here
|
|
|
QString bundleLibraryDirectory; |
|
|
|
|
|
|
|
|
inline QDebug operator<<(QDebug debug, const AppDirInfo &info) |
|
|
inline QDebug operator<<(QDebug debug, const AppDirInfo &info) |
|
|
{ |
|
|
{ |
|
@ -217,6 +219,9 @@ int containsHowOften(QStringList haystack, QString needle) { |
|
|
|
|
|
|
|
|
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths) |
|
|
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths) |
|
|
{ |
|
|
{ |
|
|
|
|
|
bundleLibraryDirectory= "lib"; // relative to bundle
|
|
|
|
|
|
LogDebug() << "bundleLibraryDirectory:" << bundleLibraryDirectory; |
|
|
|
|
|
|
|
|
LibraryInfo info; |
|
|
LibraryInfo info; |
|
|
QString trimmed = line.trimmed(); |
|
|
QString trimmed = line.trimmed(); |
|
|
|
|
|
|
|
@ -338,21 +343,6 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, |
|
|
return info; |
|
|
return info; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
QString findAppBinary(const QString &appDirPath) |
|
|
|
|
|
{ |
|
|
|
|
|
QString binaryPath; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Do without the need for an AppRun symlink
|
|
|
|
|
|
// by passing appBinaryPath from main.cpp here
|
|
|
|
|
|
binaryPath = appDirPath + "/" + "AppRun"; |
|
|
|
|
|
|
|
|
|
|
|
if (QFile::exists(binaryPath)) |
|
|
|
|
|
return binaryPath; |
|
|
|
|
|
|
|
|
|
|
|
LogError() << "Could not find bundle binary for" << appDirPath << "at" << binaryPath; |
|
|
|
|
|
exit(1); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QStringList findAppLibraries(const QString &appDirPath) |
|
|
QStringList findAppLibraries(const QString &appDirPath) |
|
|
{ |
|
|
{ |
|
|
QStringList result; |
|
|
QStringList result; |
|
@ -648,7 +638,7 @@ void runStrip(const QString &binaryPath) |
|
|
|
|
|
|
|
|
void stripAppBinary(const QString &bundlePath) |
|
|
void stripAppBinary(const QString &bundlePath) |
|
|
{ |
|
|
{ |
|
|
runStrip(findAppBinary(bundlePath)); |
|
|
runStrip(appBinaryPath); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*
|
|
|
/*
|
|
@ -742,7 +732,7 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a |
|
|
|
|
|
|
|
|
applicationBundle.path = appDirPath; |
|
|
applicationBundle.path = appDirPath; |
|
|
LogDebug() << "applicationBundle.path:" << applicationBundle.path; |
|
|
LogDebug() << "applicationBundle.path:" << applicationBundle.path; |
|
|
applicationBundle.binaryPath = findAppBinary(appDirPath); |
|
|
applicationBundle.binaryPath = appBinaryPath; |
|
|
LogDebug() << "applicationBundle.binaryPath:" << applicationBundle.binaryPath; |
|
|
LogDebug() << "applicationBundle.binaryPath:" << applicationBundle.binaryPath; |
|
|
|
|
|
|
|
|
// Determine the location of the Qt to be bundled
|
|
|
// Determine the location of the Qt to be bundled
|
|
@ -967,7 +957,7 @@ void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo) |
|
|
{ |
|
|
{ |
|
|
AppDirInfo applicationBundle; |
|
|
AppDirInfo applicationBundle; |
|
|
applicationBundle.path = appDirPath; |
|
|
applicationBundle.path = appDirPath; |
|
|
applicationBundle.binaryPath = findAppBinary(appDirPath); |
|
|
applicationBundle.binaryPath = appBinaryPath; |
|
|
|
|
|
|
|
|
const QString pluginDestinationPath = appDirPath + "/" + "plugins"; |
|
|
const QString pluginDestinationPath = appDirPath + "/" + "plugins"; |
|
|
deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDestinationPath, deploymentInfo); |
|
|
deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDestinationPath, deploymentInfo); |
|
@ -1139,7 +1129,6 @@ void changeQtLibraries(const QList<LibraryInfo> libraries, const QStringList &bi |
|
|
|
|
|
|
|
|
void changeQtLibraries(const QString appPath, const QString &qtPath) |
|
|
void changeQtLibraries(const QString appPath, const QString &qtPath) |
|
|
{ |
|
|
{ |
|
|
const QString appBinaryPath = findAppBinary(appPath); |
|
|
|
|
|
const QStringList libraryPaths = findAppLibraries(appPath); |
|
|
const QStringList libraryPaths = findAppLibraries(appPath); |
|
|
const QList<LibraryInfo> libraries = getQtLibrariesForPaths(QStringList() << appBinaryPath << libraryPaths, appPath, getBinaryRPaths(appBinaryPath, true)); |
|
|
const QList<LibraryInfo> libraries = getQtLibrariesForPaths(QStringList() << appBinaryPath << libraryPaths, appPath, getBinaryRPaths(appBinaryPath, true)); |
|
|
if (libraries.isEmpty()) { |
|
|
if (libraries.isEmpty()) { |
|
|