summaryrefslogtreecommitdiffstats
path: root/src/tools/macdeployqt/shared/shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/macdeployqt/shared/shared.cpp')
-rw-r--r--src/tools/macdeployqt/shared/shared.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index fa22b47067..643fe5390a 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -161,7 +161,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
static const QRegularExpression regexp(QStringLiteral(
"^\\t(.+) \\(compatibility version (\\d+\\.\\d+\\.\\d+), "
- "current version (\\d+\\.\\d+\\.\\d+)(, weak)?\\)$"));
+ "current version (\\d+\\.\\d+\\.\\d+)(, weak|, reexport)?\\)$"));
QString output = otool.readAllStandardOutput();
QStringList outputLines = output.split("\n", Qt::SkipEmptyParts);
@@ -627,7 +627,8 @@ QStringList getBinaryDependencies(const QString executablePath,
}
// copies everything _inside_ sourcePath to destinationPath
-bool recursiveCopy(const QString &sourcePath, const QString &destinationPath)
+bool recursiveCopy(const QString &sourcePath, const QString &destinationPath,
+ const QRegularExpression &ignoreRegExp = QRegularExpression())
{
if (!QDir(sourcePath).exists())
return false;
@@ -636,7 +637,10 @@ bool recursiveCopy(const QString &sourcePath, const QString &destinationPath)
LogNormal() << "copy:" << sourcePath << destinationPath;
QStringList files = QDir(sourcePath).entryList(QStringList() << "*", QDir::Files | QDir::NoDotAndDotDot);
- for (const QString &file : files) {
+ const bool hasValidRegExp = ignoreRegExp.isValid() && ignoreRegExp.pattern().length() > 0;
+ foreach (QString file, files) {
+ if (hasValidRegExp && ignoreRegExp.match(file).hasMatch())
+ continue;
const QString fileSourcePath = sourcePath + "/" + file;
const QString fileDestinationPath = destinationPath + "/" + file;
copyFilePrintStatus(fileSourcePath, fileDestinationPath);
@@ -768,14 +772,16 @@ QString copyFramework(const FrameworkInfo &framework, const QString path)
// Copy Resources/, Libraries/ and Helpers/
const QString resourcesSourcePath = framework.frameworkPath + "/Resources";
- const QString resourcesDestianationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Resources";
- recursiveCopy(resourcesSourcePath, resourcesDestianationPath);
+ const QString resourcesDestinationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Resources";
+ // Ignore *.prl files that are in the Resources directory
+ recursiveCopy(resourcesSourcePath, resourcesDestinationPath,
+ QRegularExpression("\\A(?:[^/]*\\.prl)\\z"));
const QString librariesSourcePath = framework.frameworkPath + "/Libraries";
- const QString librariesDestianationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Libraries";
- bool createdLibraries = recursiveCopy(librariesSourcePath, librariesDestianationPath);
+ const QString librariesDestinationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Libraries";
+ bool createdLibraries = recursiveCopy(librariesSourcePath, librariesDestinationPath);
const QString helpersSourcePath = framework.frameworkPath + "/Helpers";
- const QString helpersDestianationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Helpers";
- bool createdHelpers = recursiveCopy(helpersSourcePath, helpersDestianationPath);
+ const QString helpersDestinationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Helpers";
+ bool createdHelpers = recursiveCopy(helpersSourcePath, helpersDestinationPath);
// Create symlink structure. Links at the framework root point to Versions/Current/
// which again points to the actual version:
@@ -868,7 +874,8 @@ void deployRPaths(const QString &bundlePath, const QList<QString> &rpaths, const
continue;
}
if (rpaths.contains(resolveDyldPrefix(rpath, binaryPath, binaryPath))) {
- args << "-delete_rpath" << rpath;
+ if (!args.contains(rpath))
+ args << "-delete_rpath" << rpath;
}
}
if (!args.length()) {
@@ -1100,8 +1107,10 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
const QString libInfix = getLibInfix(deploymentInfo.deployedFrameworks);
// Network
- if (deploymentInfo.containsModule("Network", libInfix))
+ if (deploymentInfo.containsModule("Network", libInfix)) {
addPlugins(QStringLiteral("tls"));
+ addPlugins(QStringLiteral("networkinformation"));
+ }
// All image formats (svg if QtSvg is used)
const bool usesSvg = deploymentInfo.containsModule("Svg", libInfix);
@@ -1152,7 +1161,7 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
}
static const std::map<QString, std::vector<QString>> map {
- {QStringLiteral("Multimedia"), {QStringLiteral("mediaservice"), QStringLiteral("audio")}},
+ {QStringLiteral("Multimedia"), {QStringLiteral("multimedia")}},
{QStringLiteral("3DRender"), {QStringLiteral("sceneparsers"), QStringLiteral("geometryloaders"), QStringLiteral("renderers")}},
{QStringLiteral("3DQuickRender"), {QStringLiteral("renderplugins")}},
{QStringLiteral("Positioning"), {QStringLiteral("position")}},