Skip to content

Instantly share code, notes, and snippets.

@torarnv
Created July 15, 2020 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torarnv/1ae4f1d2d6e751340840219ec464b573 to your computer and use it in GitHub Desktop.
Save torarnv/1ae4f1d2d6e751340840219ec464b573 to your computer and use it in GitHub Desktop.
diff --git i/src/macdeployqt/macdeployqt/macdeployqt.pro w/src/macdeployqt/macdeployqt/macdeployqt.pro
index bf195f89..19788a57 100644
--- i/src/macdeployqt/macdeployqt/macdeployqt.pro
+++ w/src/macdeployqt/macdeployqt/macdeployqt.pro
@@ -1,5 +1,8 @@
+option(host_build)
+CONFIG += force_bootstrap
+
SOURCES += main.cpp ../shared/shared.cpp
QT = core
LIBS += -framework CoreFoundation
-load(qt_app)
+load(qt_tool)
diff --git i/src/macdeployqt/macdeployqt/main.cpp w/src/macdeployqt/macdeployqt/main.cpp
index 0f916405..93c476b4 100644
--- i/src/macdeployqt/macdeployqt/main.cpp
+++ w/src/macdeployqt/macdeployqt/main.cpp
@@ -232,7 +232,9 @@ int main(int argc, char **argv)
// Update deploymentInfo.deployedFrameworks - the QML imports
// may have brought in extra frameworks as dependencies.
deploymentInfo.deployedFrameworks += findAppFrameworkNames(appBundlePath);
- deploymentInfo.deployedFrameworks = deploymentInfo.deployedFrameworks.toSet().toList();
+ QSet<QString> deployedFrameworks(deploymentInfo.deployedFrameworks.begin(),
+ deploymentInfo.deployedFrameworks.end());
+ deploymentInfo.deployedFrameworks = deployedFrameworks.values();
}
if (plugins && !deploymentInfo.qtPath.isEmpty()) {
diff --git i/src/macdeployqt/shared/shared.cpp w/src/macdeployqt/shared/shared.cpp
index a81a2f0d..d8256687 100644
--- i/src/macdeployqt/shared/shared.cpp
+++ w/src/macdeployqt/shared/shared.cpp
@@ -30,7 +30,6 @@
#include <QStringList>
#include <QDebug>
#include <iostream>
-#include <QProcess>
#include <QDir>
#include <QRegExp>
#include <QSet>
@@ -41,7 +40,6 @@
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
-#include <QRegularExpression>
#include "shared.h"
#ifdef Q_OS_DARWIN
@@ -181,7 +179,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
return info;
}
- static const QRegularExpression regexp(QStringLiteral(
+ static const QRegExp regexp(QStringLiteral(
"^\\t(.+) \\(compatibility version (\\d+\\.\\d+\\.\\d+), "
"current version (\\d+\\.\\d+\\.\\d+)(, weak)?\\)$"));
@@ -938,7 +936,7 @@ bool DeploymentInfo::containsModule(const QString &module, const QString &libInF
return true;
}
// Check for dylib
- const QRegularExpression dylibRegExp(QLatin1String("libQt[0-9]+") + module +
+ const QRegExp dylibRegExp(QLatin1String("libQt[0-9]+") + module +
libInFix + QLatin1String(".[0-9]+.dylib"));
return deployedFrameworks.filter(dylibRegExp).size() > 0;
}
@@ -1498,10 +1496,10 @@ QSet<QString> codesignBundle(const QString &identity,
// Check if there are unsigned dependencies, sign these first.
QStringList dependencies =
- getBinaryDependencies(rootBinariesPath, binary, additionalBinariesContainingRpaths).toSet()
- .subtract(signedBinaries)
- .subtract(pendingBinariesSet)
- .toList();
+ getBinaryDependencies(rootBinariesPath, binary, additionalBinariesContainingRpaths);
+
+ QSet<QString> dependenciesSet(dependencies.begin(), dependencies.end());
+ dependencies = dependenciesSet.subtract(signedBinaries).subtract(pendingBinariesSet).values();
if (!dependencies.isEmpty()) {
pendingBinaries.push(binary);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment