diff options
author | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-08-10 15:36:16 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-08-13 09:03:39 +0000 |
commit | 6a86f7026816fa657f070d10f9164d7b7099a71c (patch) | |
tree | 3d152174d79fe833cdd7ea82e3661dfdb891d7bd | |
parent | c2952ff8df1e18fe0120d8b29901b0b794afccc7 (diff) | |
download | qttools-6a86f7026816fa657f070d10f9164d7b7099a71c.tar.gz qttools-6a86f7026816fa657f070d10f9164d7b7099a71c.tar.bz2 qttools-6a86f7026816fa657f070d10f9164d7b7099a71c.zip |
Fix QML imports deployment when using path
During deployment the value of LC_RPATH on the main
executable gets updated with a new value pointing
inside the app bundle. This happens before QML
import deployment, which means reading LC_RPATH
at QML import deployment time will not give the
correct value.
Use the cached value stored in the DeploymentInfo
structure instead, which will point back to the Qt
installation.
Task-number: QTBUG-47390
Change-Id: Ide84240de408d2338c9f7a68a73849263ce69dff
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
-rw-r--r-- | src/macdeployqt/macdeployqt/main.cpp | 2 | ||||
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 13 | ||||
-rw-r--r-- | src/macdeployqt/shared/shared.h | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp index 40fc438a..750316f8 100644 --- a/src/macdeployqt/macdeployqt/main.cpp +++ b/src/macdeployqt/macdeployqt/main.cpp @@ -158,7 +158,7 @@ int main(int argc, char **argv) } if (!qmlDirs.isEmpty()) - deployQmlImports(appBundlePath, qmlDirs); + deployQmlImports(appBundlePath, deploymentInfo, qmlDirs); if (runCodesign) codesign(codesignIdentiy, appBundlePath); diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index e2c4a19b..5ed6c43d 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -553,13 +553,12 @@ bool recursiveCopy(const QString &sourcePath, const QString &destinationPath) return true; } -void recursiveCopyAndDeploy(const QString &appBundlePath, const QString &sourcePath, const QString &destinationPath) +void recursiveCopyAndDeploy(const QString &appBundlePath, const QSet<QString> &rpaths, const QString &sourcePath, const QString &destinationPath) { QDir().mkpath(destinationPath); LogNormal() << "copy:" << sourcePath << destinationPath; - QSet<QString> rpaths = getBinaryRPaths(findAppBinary(appBundlePath), true); QStringList files = QDir(sourcePath).entryList(QStringList() << QStringLiteral("*"), QDir::Files | QDir::NoDotAndDotDot); foreach (QString file, files) { const QString fileSourcePath = sourcePath + QLatin1Char('/') + file; @@ -608,7 +607,7 @@ void recursiveCopyAndDeploy(const QString &appBundlePath, const QString &sourceP QStringList subdirs = QDir(sourcePath).entryList(QStringList() << QStringLiteral("*"), QDir::Dirs | QDir::NoDotAndDotDot); foreach (QString dir, subdirs) { - recursiveCopyAndDeploy(appBundlePath, sourcePath + QLatin1Char('/') + dir, destinationPath + QLatin1Char('/') + dir); + recursiveCopyAndDeploy(appBundlePath, rpaths, sourcePath + QLatin1Char('/') + dir, destinationPath + QLatin1Char('/') + dir); } } @@ -1028,7 +1027,7 @@ void deployPlugins(const QString &appBundlePath, DeploymentInfo deploymentInfo, deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDestinationPath, deploymentInfo, useDebugLibs); } -void deployQmlImport(const QString &appBundlePath, const QString &importSourcePath, const QString &importName) +void deployQmlImport(const QString &appBundlePath, const QSet<QString> &rpaths, const QString &importSourcePath, const QString &importName) { QString importDestinationPath = appBundlePath + "/Contents/Resources/qml/" + importName; @@ -1037,11 +1036,11 @@ void deployQmlImport(const QString &appBundlePath, const QString &importSourcePa if (QDir().exists(importDestinationPath)) return; - recursiveCopyAndDeploy(appBundlePath, importSourcePath, importDestinationPath); + recursiveCopyAndDeploy(appBundlePath, rpaths, importSourcePath, importDestinationPath); } // Scan qml files in qmldirs for import statements, deploy used imports from Qml2ImportsPath to Contents/Resources/qml. -void deployQmlImports(const QString &appBundlePath, QStringList &qmlDirs) +void deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs) { LogNormal() << ""; LogNormal() << "Deploying QML imports "; @@ -1129,7 +1128,7 @@ void deployQmlImports(const QString &appBundlePath, QStringList &qmlDirs) if (version.startsWith(QLatin1Char('.'))) name.append(version); - deployQmlImport(appBundlePath, path, name); + deployQmlImport(appBundlePath, deploymentInfo.rpathsUsed, path, name); LogNormal() << ""; } } diff --git a/src/macdeployqt/shared/shared.h b/src/macdeployqt/shared/shared.h index 43f1c24c..27628b7a 100644 --- a/src/macdeployqt/shared/shared.h +++ b/src/macdeployqt/shared/shared.h @@ -100,7 +100,7 @@ DeploymentInfo deployQtFrameworks(const QString &appBundlePath, const QStringLis DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks,const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath); void createQtConf(const QString &appBundlePath); void deployPlugins(const QString &appBundlePath, DeploymentInfo deploymentInfo, bool useDebugLibs); -void deployQmlImports(const QString &appBundlePath, QStringList &qmlDirs); +void deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs); void changeIdentification(const QString &id, const QString &binaryPath); void changeInstallName(const QString &oldName, const QString &newName, const QString &binaryPath); void runStrip(const QString &binaryPath); |