Use AppDir terminology instead of AppBundle (bundle is a macOS term)
This commit is contained in:
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString appBundlePath = appDir;
|
QString appDirPath = appDir;
|
||||||
|
|
||||||
QFile appRun(appDir + "/AppRun");
|
QFile appRun(appDir + "/AppRun");
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DeploymentInfo deploymentInfo = deployQtLibraries(appBundlePath, additionalExecutables, useDebugLibs);
|
DeploymentInfo deploymentInfo = deployQtLibraries(appDirPath, additionalExecutables, useDebugLibs);
|
||||||
|
|
||||||
// Convenience: Look for .qml files in the current directoty if no -qmldir specified.
|
// Convenience: Look for .qml files in the current directoty if no -qmldir specified.
|
||||||
if (qmlDirs.isEmpty()) {
|
if (qmlDirs.isEmpty()) {
|
||||||
@@ -171,29 +171,29 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!qmlDirs.isEmpty()) {
|
if (!qmlDirs.isEmpty()) {
|
||||||
bool ok = deployQmlImports(appBundlePath, deploymentInfo, qmlDirs);
|
bool ok = deployQmlImports(appDirPath, deploymentInfo, qmlDirs);
|
||||||
if (!ok && qmldirArgumentUsed)
|
if (!ok && qmldirArgumentUsed)
|
||||||
return 1; // exit if the user explicitly asked for qml import deployment
|
return 1; // exit if the user explicitly asked for qml import deployment
|
||||||
|
|
||||||
// Update deploymentInfo.deployedLibraries - the QML imports
|
// Update deploymentInfo.deployedLibraries - the QML imports
|
||||||
// may have brought in extra libraries as dependencies.
|
// may have brought in extra libraries as dependencies.
|
||||||
// deploymentInfo.deployedLibraries += findAppLibraryNames(appBundlePath);
|
// deploymentInfo.deployedLibraries += findAppLibraryNames(appDirPath);
|
||||||
deploymentInfo.deployedLibraries += findAppLibraries(appBundlePath);
|
deploymentInfo.deployedLibraries += findAppLibraries(appDirPath);
|
||||||
deploymentInfo.deployedLibraries = deploymentInfo.deployedLibraries.toSet().toList();
|
deploymentInfo.deployedLibraries = deploymentInfo.deployedLibraries.toSet().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugins && !deploymentInfo.qtPath.isEmpty()) {
|
if (plugins && !deploymentInfo.qtPath.isEmpty()) {
|
||||||
deploymentInfo.pluginPath = QDir::cleanPath(deploymentInfo.qtPath + "/../plugins");
|
deploymentInfo.pluginPath = QDir::cleanPath(deploymentInfo.qtPath + "/../plugins");
|
||||||
deployPlugins(appBundlePath, deploymentInfo, useDebugLibs);
|
deployPlugins(appDirPath, deploymentInfo, useDebugLibs);
|
||||||
createQtConf(appBundlePath);
|
createQtConf(appDirPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runStripEnabled)
|
if (runStripEnabled)
|
||||||
stripAppBinary(appBundlePath);
|
stripAppBinary(appDirPath);
|
||||||
|
|
||||||
if (dmg) {
|
if (dmg) {
|
||||||
LogNormal();
|
LogNormal();
|
||||||
createAppImage(appBundlePath);
|
createAppImage(appDirPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+49
-49
@@ -80,7 +80,7 @@ QDebug operator<<(QDebug debug, const LibraryInfo &info)
|
|||||||
|
|
||||||
const QString bundleLibraryDirectory = "lib"; // the same directory as the main executable; could define a relative subdirectory here
|
const QString bundleLibraryDirectory = "lib"; // the same directory as the main executable; could define a relative subdirectory here
|
||||||
|
|
||||||
inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info)
|
inline QDebug operator<<(QDebug debug, const AppDirInfo &info)
|
||||||
{
|
{
|
||||||
debug << "Application bundle path" << info.path << "\n";
|
debug << "Application bundle path" << info.path << "\n";
|
||||||
debug << "Binary path" << info.binaryPath << "\n";
|
debug << "Binary path" << info.binaryPath << "\n";
|
||||||
@@ -209,7 +209,7 @@ LddInfo findDependencyInfo(const QString &binaryPath)
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appBundlePath, const QSet<QString> &rpaths, bool useDebugLibs)
|
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs)
|
||||||
{
|
{
|
||||||
LibraryInfo info;
|
LibraryInfo info;
|
||||||
QString trimmed = line.trimmed();
|
QString trimmed = line.trimmed();
|
||||||
@@ -298,28 +298,28 @@ LibraryInfo parseLddLibraryLine(const QString &line, const QString &appBundlePat
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString findAppBinary(const QString &appBundlePath)
|
QString findAppBinary(const QString &appDirPath)
|
||||||
{
|
{
|
||||||
QString binaryPath;
|
QString binaryPath;
|
||||||
|
|
||||||
// FIXME: Do without the need for an AppRun symlink
|
// FIXME: Do without the need for an AppRun symlink
|
||||||
// by passing appBinaryPath from main.cpp here
|
// by passing appBinaryPath from main.cpp here
|
||||||
QString parentDir = QDir::cleanPath(QFileInfo(appBundlePath).path());
|
QString parentDir = QDir::cleanPath(QFileInfo(appDirPath).path());
|
||||||
QString appDir = QDir::cleanPath(QFileInfo(appBundlePath).baseName());
|
QString appDir = QDir::cleanPath(QFileInfo(appDirPath).baseName());
|
||||||
binaryPath = parentDir + "/" + appDir + "/AppRun";
|
binaryPath = parentDir + "/" + appDir + "/AppRun";
|
||||||
|
|
||||||
if (QFile::exists(binaryPath))
|
if (QFile::exists(binaryPath))
|
||||||
return binaryPath;
|
return binaryPath;
|
||||||
LogError() << "Could not find bundle binary for" << appBundlePath;
|
LogError() << "Could not find bundle binary for" << appDirPath;
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList findAppLibraries(const QString &appBundlePath)
|
QStringList findAppLibraries(const QString &appDirPath)
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
// .so
|
// .so
|
||||||
QDirIterator iter(appBundlePath, QStringList() << QString::fromLatin1("*.so"),
|
QDirIterator iter(appDirPath, QStringList() << QString::fromLatin1("*.so"),
|
||||||
QDir::Files, QDirIterator::Subdirectories);
|
QDir::Files, QDirIterator::Subdirectories);
|
||||||
|
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
@@ -327,7 +327,7 @@ QStringList findAppLibraries(const QString &appBundlePath)
|
|||||||
result << iter.fileInfo().filePath();
|
result << iter.fileInfo().filePath();
|
||||||
}
|
}
|
||||||
// .so.*
|
// .so.*
|
||||||
QDirIterator iter2(appBundlePath, QStringList() << QString::fromLatin1("*.so.*"),
|
QDirIterator iter2(appDirPath, QStringList() << QString::fromLatin1("*.so.*"),
|
||||||
QDir::Files, QDirIterator::Subdirectories);
|
QDir::Files, QDirIterator::Subdirectories);
|
||||||
|
|
||||||
while (iter2.hasNext()) {
|
while (iter2.hasNext()) {
|
||||||
@@ -337,11 +337,11 @@ QStringList findAppLibraries(const QString &appBundlePath)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList findAppBundleFiles(const QString &appBundlePath, bool absolutePath = false)
|
QStringList findAppBundleFiles(const QString &appDirPath, bool absolutePath = false)
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
|
|
||||||
QDirIterator iter(appBundlePath, QStringList() << QString::fromLatin1("*"),
|
QDirIterator iter(appDirPath, QStringList() << QString::fromLatin1("*"),
|
||||||
QDir::Files, QDirIterator::Subdirectories);
|
QDir::Files, QDirIterator::Subdirectories);
|
||||||
|
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
@@ -354,11 +354,11 @@ QStringList findAppBundleFiles(const QString &appBundlePath, bool absolutePath =
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<LibraryInfo> getQtLibraries(const QList<DylibInfo> &dependencies, const QString &appBundlePath, const QSet<QString> &rpaths, bool useDebugLibs)
|
QList<LibraryInfo> getQtLibraries(const QList<DylibInfo> &dependencies, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs)
|
||||||
{
|
{
|
||||||
QList<LibraryInfo> libraries;
|
QList<LibraryInfo> libraries;
|
||||||
for (const DylibInfo &dylibInfo : dependencies) {
|
for (const DylibInfo &dylibInfo : dependencies) {
|
||||||
LibraryInfo info = parseLddLibraryLine(dylibInfo.binaryPath, appBundlePath, rpaths, useDebugLibs);
|
LibraryInfo info = parseLddLibraryLine(dylibInfo.binaryPath, appDirPath, rpaths, useDebugLibs);
|
||||||
if (info.libraryName.isEmpty() == false) {
|
if (info.libraryName.isEmpty() == false) {
|
||||||
LogDebug() << "Adding library:";
|
LogDebug() << "Adding library:";
|
||||||
LogDebug() << info;
|
LogDebug() << info;
|
||||||
@@ -405,19 +405,19 @@ QSet<QString> getBinaryRPaths(const QString &path, bool resolve = true, QString
|
|||||||
return rpaths;
|
return rpaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appBundlePath, const QSet<QString> &rpaths, bool useDebugLibs)
|
QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs)
|
||||||
{
|
{
|
||||||
const LddInfo info = findDependencyInfo(path);
|
const LddInfo info = findDependencyInfo(path);
|
||||||
return getQtLibraries(info.dependencies, appBundlePath, rpaths + getBinaryRPaths(path), useDebugLibs);
|
return getQtLibraries(info.dependencies, appDirPath, rpaths + getBinaryRPaths(path), useDebugLibs);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<LibraryInfo> getQtLibrariesForPaths(const QStringList &paths, const QString &appBundlePath, const QSet<QString> &rpaths, bool useDebugLibs)
|
QList<LibraryInfo> getQtLibrariesForPaths(const QStringList &paths, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs)
|
||||||
{
|
{
|
||||||
QList<LibraryInfo> result;
|
QList<LibraryInfo> result;
|
||||||
QSet<QString> existing;
|
QSet<QString> existing;
|
||||||
|
|
||||||
foreach (const QString &path, paths) {
|
foreach (const QString &path, paths) {
|
||||||
foreach (const LibraryInfo &info, getQtLibraries(path, appBundlePath, rpaths, useDebugLibs)) {
|
foreach (const LibraryInfo &info, getQtLibraries(path, appDirPath, rpaths, useDebugLibs)) {
|
||||||
if (!existing.contains(info.libraryPath)) { // avoid duplicates
|
if (!existing.contains(info.libraryPath)) { // avoid duplicates
|
||||||
existing.insert(info.libraryPath);
|
existing.insert(info.libraryPath);
|
||||||
result << info;
|
result << info;
|
||||||
@@ -497,7 +497,7 @@ bool recursiveCopy(const QString &sourcePath, const QString &destinationPath)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void recursiveCopyAndDeploy(const QString &appBundlePath, const QSet<QString> &rpaths, const QString &sourcePath, const QString &destinationPath)
|
void recursiveCopyAndDeploy(const QString &appDirPath, const QSet<QString> &rpaths, const QString &sourcePath, const QString &destinationPath)
|
||||||
{
|
{
|
||||||
QDir().mkpath(destinationPath);
|
QDir().mkpath(destinationPath);
|
||||||
|
|
||||||
@@ -517,7 +517,7 @@ void recursiveCopyAndDeploy(const QString &appBundlePath, const QSet<QString> &r
|
|||||||
|
|
||||||
QStringList subdirs = QDir(sourcePath).entryList(QStringList() << QStringLiteral("*"), QDir::Dirs | QDir::NoDotAndDotDot);
|
QStringList subdirs = QDir(sourcePath).entryList(QStringList() << QStringLiteral("*"), QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
foreach (QString dir, subdirs) {
|
foreach (QString dir, subdirs) {
|
||||||
recursiveCopyAndDeploy(appBundlePath, rpaths, sourcePath + QLatin1Char('/') + dir, destinationPath + QLatin1Char('/') + dir);
|
recursiveCopyAndDeploy(appDirPath, rpaths, sourcePath + QLatin1Char('/') + dir, destinationPath + QLatin1Char('/') + dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,15 +671,15 @@ DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,
|
|||||||
return deploymentInfo;
|
return deploymentInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeploymentInfo deployQtLibraries(const QString &appBundlePath, const QStringList &additionalExecutables, bool useDebugLibs)
|
DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables, bool useDebugLibs)
|
||||||
{
|
{
|
||||||
ApplicationBundleInfo applicationBundle;
|
AppDirInfo applicationBundle;
|
||||||
applicationBundle.path = appBundlePath;
|
applicationBundle.path = appDirPath;
|
||||||
LogDebug() << "applicationBundle.path:" << applicationBundle.path;
|
LogDebug() << "applicationBundle.path:" << applicationBundle.path;
|
||||||
applicationBundle.binaryPath = findAppBinary(appBundlePath);
|
applicationBundle.binaryPath = findAppBinary(appDirPath);
|
||||||
LogDebug() << "applicationBundle.binaryPath:" << applicationBundle.binaryPath;
|
LogDebug() << "applicationBundle.binaryPath:" << applicationBundle.binaryPath;
|
||||||
changeIdentification("$ORIGIN/" + bundleLibraryDirectory, applicationBundle.binaryPath);
|
changeIdentification("$ORIGIN/" + bundleLibraryDirectory, applicationBundle.binaryPath);
|
||||||
applicationBundle.libraryPaths = findAppLibraries(appBundlePath);
|
applicationBundle.libraryPaths = findAppLibraries(appDirPath);
|
||||||
LogDebug() << "applicationBundle.libraryPaths:" << applicationBundle.libraryPaths;
|
LogDebug() << "applicationBundle.libraryPaths:" << applicationBundle.libraryPaths;
|
||||||
|
|
||||||
LogDebug() << "additionalExecutables:" << additionalExecutables;
|
LogDebug() << "additionalExecutables:" << additionalExecutables;
|
||||||
@@ -693,19 +693,19 @@ DeploymentInfo deployQtLibraries(const QString &appBundlePath, const QStringList
|
|||||||
|
|
||||||
LogDebug() << "allLibraryPaths:" << allLibraryPaths;
|
LogDebug() << "allLibraryPaths:" << allLibraryPaths;
|
||||||
|
|
||||||
QList<LibraryInfo> libraries = getQtLibrariesForPaths(allBinaryPaths, appBundlePath, allLibraryPaths, useDebugLibs);
|
QList<LibraryInfo> libraries = getQtLibrariesForPaths(allBinaryPaths, appDirPath, allLibraryPaths, useDebugLibs);
|
||||||
if (libraries.isEmpty() && !alwaysOwerwriteEnabled) {
|
if (libraries.isEmpty() && !alwaysOwerwriteEnabled) {
|
||||||
LogWarning();
|
LogWarning();
|
||||||
LogWarning() << "Could not find any external Qt libraries to deploy in" << appBundlePath;
|
LogWarning() << "Could not find any external Qt libraries to deploy in" << appDirPath;
|
||||||
LogWarning() << "Perhaps linuxdeployqt was already used on" << appBundlePath << "?";
|
LogWarning() << "Perhaps linuxdeployqt was already used on" << appDirPath << "?";
|
||||||
LogWarning() << "If so, you will need to rebuild" << appBundlePath << "before trying again.";
|
LogWarning() << "If so, you will need to rebuild" << appDirPath << "before trying again.";
|
||||||
return DeploymentInfo();
|
return DeploymentInfo();
|
||||||
} else {
|
} else {
|
||||||
return deployQtLibraries(libraries, applicationBundle.path, allBinaryPaths, useDebugLibs, !additionalExecutables.isEmpty());
|
return deployQtLibraries(libraries, applicationBundle.path, allBinaryPaths, useDebugLibs, !additionalExecutables.isEmpty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pluginSourcePath,
|
void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath,
|
||||||
const QString pluginDestinationPath, DeploymentInfo deploymentInfo, bool useDebugLibs)
|
const QString pluginDestinationPath, DeploymentInfo deploymentInfo, bool useDebugLibs)
|
||||||
{
|
{
|
||||||
LogNormal() << "Deploying plugins from" << pluginSourcePath;
|
LogNormal() << "Deploying plugins from" << pluginSourcePath;
|
||||||
@@ -770,13 +770,13 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
|
|||||||
|
|
||||||
if (copyFilePrintStatus(sourcePath, destinationPath)) {
|
if (copyFilePrintStatus(sourcePath, destinationPath)) {
|
||||||
runStrip(destinationPath);
|
runStrip(destinationPath);
|
||||||
QList<LibraryInfo> libraries = getQtLibraries(destinationPath, appBundleInfo.path, deploymentInfo.rpathsUsed, useDebugLibs);
|
QList<LibraryInfo> libraries = getQtLibraries(destinationPath, appDirInfo.path, deploymentInfo.rpathsUsed, useDebugLibs);
|
||||||
deployQtLibraries(libraries, appBundleInfo.path, QStringList() << destinationPath, useDebugLibs, deploymentInfo.useLoaderPath);
|
deployQtLibraries(libraries, appDirInfo.path, QStringList() << destinationPath, useDebugLibs, deploymentInfo.useLoaderPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void createQtConf(const QString &appBundlePath)
|
void createQtConf(const QString &appDirPath)
|
||||||
{
|
{
|
||||||
// Set Plugins and imports paths. These are relative to App.app/Contents.
|
// Set Plugins and imports paths. These are relative to App.app/Contents.
|
||||||
QByteArray contents = "[Paths]\n"
|
QByteArray contents = "[Paths]\n"
|
||||||
@@ -784,7 +784,7 @@ void createQtConf(const QString &appBundlePath)
|
|||||||
"Imports = qml\n"
|
"Imports = qml\n"
|
||||||
"Qml2Imports = qml\n";
|
"Qml2Imports = qml\n";
|
||||||
|
|
||||||
QString filePath = appBundlePath + "/"; // Is picked up when placed next to the main executable
|
QString filePath = appDirPath + "/"; // Is picked up when placed next to the main executable
|
||||||
QString fileName = filePath + "qt.conf";
|
QString fileName = filePath + "qt.conf";
|
||||||
|
|
||||||
QDir().mkpath(filePath);
|
QDir().mkpath(filePath);
|
||||||
@@ -803,34 +803,34 @@ void createQtConf(const QString &appBundlePath)
|
|||||||
qtconf.open(QIODevice::WriteOnly);
|
qtconf.open(QIODevice::WriteOnly);
|
||||||
if (qtconf.write(contents) != -1) {
|
if (qtconf.write(contents) != -1) {
|
||||||
LogNormal() << "Created configuration file:" << fileName;
|
LogNormal() << "Created configuration file:" << fileName;
|
||||||
LogNormal() << "This file sets the plugin search path to" << appBundlePath + "/plugins";
|
LogNormal() << "This file sets the plugin search path to" << appDirPath + "/plugins";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void deployPlugins(const QString &appBundlePath, DeploymentInfo deploymentInfo, bool useDebugLibs)
|
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo, bool useDebugLibs)
|
||||||
{
|
{
|
||||||
ApplicationBundleInfo applicationBundle;
|
AppDirInfo applicationBundle;
|
||||||
applicationBundle.path = appBundlePath;
|
applicationBundle.path = appDirPath;
|
||||||
applicationBundle.binaryPath = findAppBinary(appBundlePath);
|
applicationBundle.binaryPath = findAppBinary(appDirPath);
|
||||||
|
|
||||||
const QString pluginDestinationPath = appBundlePath + "/" + "plugins";
|
const QString pluginDestinationPath = appDirPath + "/" + "plugins";
|
||||||
deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDestinationPath, deploymentInfo, useDebugLibs);
|
deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDestinationPath, deploymentInfo, useDebugLibs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void deployQmlImport(const QString &appBundlePath, const QSet<QString> &rpaths, const QString &importSourcePath, const QString &importName)
|
void deployQmlImport(const QString &appDirPath, const QSet<QString> &rpaths, const QString &importSourcePath, const QString &importName)
|
||||||
{
|
{
|
||||||
QString importDestinationPath = appBundlePath + "/qml/" + importName;
|
QString importDestinationPath = appDirPath + "/qml/" + importName;
|
||||||
|
|
||||||
// Skip already deployed imports. This can happen in cases like "QtQuick.Controls.Styles",
|
// Skip already deployed imports. This can happen in cases like "QtQuick.Controls.Styles",
|
||||||
// where deploying QtQuick.Controls will also deploy the "Styles" sub-import.
|
// where deploying QtQuick.Controls will also deploy the "Styles" sub-import.
|
||||||
if (QDir().exists(importDestinationPath))
|
if (QDir().exists(importDestinationPath))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
recursiveCopyAndDeploy(appBundlePath, rpaths, importSourcePath, importDestinationPath);
|
recursiveCopyAndDeploy(appDirPath, rpaths, importSourcePath, importDestinationPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan qml files in qmldirs for import statements, deploy used imports from Qml2ImportsPath to ./qml.
|
// Scan qml files in qmldirs for import statements, deploy used imports from Qml2ImportsPath to ./qml.
|
||||||
bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs)
|
bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, QStringList &qmlDirs)
|
||||||
{
|
{
|
||||||
LogNormal() << "";
|
LogNormal() << "";
|
||||||
LogNormal() << "Deploying QML imports ";
|
LogNormal() << "Deploying QML imports ";
|
||||||
@@ -929,7 +929,7 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
|
|||||||
if (version.startsWith(QLatin1Char('.')))
|
if (version.startsWith(QLatin1Char('.')))
|
||||||
name.append(version);
|
name.append(version);
|
||||||
|
|
||||||
deployQmlImport(appBundlePath, deploymentInfo.rpathsUsed, path, name);
|
deployQmlImport(appDirPath, deploymentInfo.rpathsUsed, path, name);
|
||||||
LogNormal() << "";
|
LogNormal() << "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,7 +944,7 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
|
|||||||
LogNormal() << "Deploying QML import QtQuick.PrivateWidgets";
|
LogNormal() << "Deploying QML import QtQuick.PrivateWidgets";
|
||||||
QString name = "QtQuick/PrivateWidgets";
|
QString name = "QtQuick/PrivateWidgets";
|
||||||
QString path = qmlImportsPath + QLatin1Char('/') + name;
|
QString path = qmlImportsPath + QLatin1Char('/') + name;
|
||||||
deployQmlImport(appBundlePath, deploymentInfo.rpathsUsed, path, name);
|
deployQmlImport(appDirPath, deploymentInfo.rpathsUsed, path, name);
|
||||||
LogNormal() << "";
|
LogNormal() << "";
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -980,9 +980,9 @@ void changeQtLibraries(const QString appPath, const QString &qtPath, bool useDeb
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void createAppImage(const QString &appBundlePath)
|
void createAppImage(const QString &appDirPath)
|
||||||
{
|
{
|
||||||
QString appBaseName = appBundlePath;
|
QString appBaseName = appDirPath;
|
||||||
appBaseName.chop(4); // remove ".app" from end
|
appBaseName.chop(4); // remove ".app" from end
|
||||||
|
|
||||||
QString dmgName = appBaseName + ".dmg";
|
QString dmgName = appBaseName + ".dmg";
|
||||||
@@ -995,13 +995,13 @@ void createAppImage(const QString &appBundlePath)
|
|||||||
if (dmg.exists()) {
|
if (dmg.exists()) {
|
||||||
LogNormal() << "Disk image already exists, skipping .dmg creation for" << dmg.fileName();
|
LogNormal() << "Disk image already exists, skipping .dmg creation for" << dmg.fileName();
|
||||||
} else {
|
} else {
|
||||||
LogNormal() << "Creating disk image (.dmg) for" << appBundlePath;
|
LogNormal() << "Creating disk image (.dmg) for" << appDirPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// More dmg options can be found in the hdiutil man page.
|
// More dmg options can be found in the hdiutil man page.
|
||||||
QStringList options = QStringList()
|
QStringList options = QStringList()
|
||||||
<< "create" << dmgName
|
<< "create" << dmgName
|
||||||
<< "-srcfolder" << appBundlePath
|
<< "-srcfolder" << appDirPath
|
||||||
<< "-format" << "UDZO"
|
<< "-format" << "UDZO"
|
||||||
<< "-volname" << appBaseName;
|
<< "-volname" << appBaseName;
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -83,7 +83,7 @@ public:
|
|||||||
bool operator==(const LibraryInfo &a, const LibraryInfo &b);
|
bool operator==(const LibraryInfo &a, const LibraryInfo &b);
|
||||||
QDebug operator<<(QDebug debug, const LibraryInfo &info);
|
QDebug operator<<(QDebug debug, const LibraryInfo &info);
|
||||||
|
|
||||||
class ApplicationBundleInfo
|
class AppDirInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QString path;
|
QString path;
|
||||||
@@ -102,28 +102,28 @@ public:
|
|||||||
bool isLibrary;
|
bool isLibrary;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info);
|
inline QDebug operator<<(QDebug debug, const AppDirInfo &info);
|
||||||
|
|
||||||
void changeQtLibraries(const QString appPath, const QString &qtPath, bool useDebugLibs);
|
void changeQtLibraries(const QString appPath, const QString &qtPath, bool useDebugLibs);
|
||||||
void changeQtLibraries(const QList<LibraryInfo> libraries, const QStringList &binaryPaths, const QString &qtPath);
|
void changeQtLibraries(const QList<LibraryInfo> libraries, const QStringList &binaryPaths, const QString &qtPath);
|
||||||
|
|
||||||
LddInfo findDependencyInfo(const QString &binaryPath);
|
LddInfo findDependencyInfo(const QString &binaryPath);
|
||||||
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appBundlePath, const QSet<QString> &rpaths, bool useDebugLibs);
|
LibraryInfo parseLddLibraryLine(const QString &line, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs);
|
||||||
QString findAppBinary(const QString &appBundlePath);
|
QString findAppBinary(const QString &appDirPath);
|
||||||
QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appBundlePath, const QSet<QString> &rpaths, bool useDebugLibs);
|
QList<LibraryInfo> getQtLibraries(const QString &path, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs);
|
||||||
QList<LibraryInfo> getQtLibraries(const QStringList &lddLines, const QString &appBundlePath, const QSet<QString> &rpaths, bool useDebugLibs);
|
QList<LibraryInfo> getQtLibraries(const QStringList &lddLines, const QString &appDirPath, const QSet<QString> &rpaths, bool useDebugLibs);
|
||||||
QString copyLibrary(const LibraryInfo &library, const QString path);
|
QString copyLibrary(const LibraryInfo &library, const QString path);
|
||||||
DeploymentInfo deployQtLibraries(const QString &appBundlePath, const QStringList &additionalExecutables, bool useDebugLibs);
|
DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables, bool useDebugLibs);
|
||||||
DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath);
|
DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath);
|
||||||
void createQtConf(const QString &appBundlePath);
|
void createQtConf(const QString &appDirPath);
|
||||||
void deployPlugins(const QString &appBundlePath, DeploymentInfo deploymentInfo, bool useDebugLibs);
|
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo, bool useDebugLibs);
|
||||||
bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs);
|
bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, QStringList &qmlDirs);
|
||||||
void changeIdentification(const QString &id, const QString &binaryPath);
|
void changeIdentification(const QString &id, const QString &binaryPath);
|
||||||
void changeInstallName(const QString &oldName, const QString &newName, const QString &binaryPath);
|
void changeInstallName(const QString &oldName, const QString &newName, const QString &binaryPath);
|
||||||
void runStrip(const QString &binaryPath);
|
void runStrip(const QString &binaryPath);
|
||||||
void stripAppBinary(const QString &bundlePath);
|
void stripAppBinary(const QString &bundlePath);
|
||||||
QString findAppBinary(const QString &appBundlePath);
|
QString findAppBinary(const QString &appDirPath);
|
||||||
QStringList findAppLibraries(const QString &appBundlePath);
|
QStringList findAppLibraries(const QString &appDirPath);
|
||||||
void createAppImage(const QString &appBundlePath);
|
void createAppImage(const QString &appBundlePath);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user