diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-05-25 01:23:40 -0700 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-05-26 09:49:43 +0000 |
commit | e0edc350632e6f311548cac2831a60f3b9e4dbda (patch) | |
tree | 9983cdd96b94473e8e4fc22b31a7c2135cd1f302 /src/macdeployqt | |
parent | 043abc9c8aace5225cbc2ca152246a20070d8657 (diff) | |
download | qttools-e0edc350632e6f311548cac2831a60f3b9e4dbda.tar.gz |
Fix macdeployqt with certain library paths.
macdeployqt assumed that relative library paths referred to a Qt
library or framework that was not contained in any specific directory.
This was broken in the case of paths like somedir/libfoo.dylib.
macdeployqt now takes the additional path components into account.
There was also a trailing space after ".dylib " which snuck in after
refactoring to centralize otool output parsing which caused failures
in Qt Creator deployment.
Task-number: QTBUG-53533
Task-number: QTBUG-53563
Change-Id: I4296b7dd805d4866d3bf0db486366c30dece7add
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/macdeployqt')
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index c0396ab7f..b2af604e9 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -280,7 +280,7 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundl if (state == QtPath) { // Check for library name part - if (part < parts.count() && parts.at(part).contains(".dylib ")) { + if (part < parts.count() && parts.at(part).contains(".dylib")) { info.frameworkDirectory += "/" + (qtPath + currentPart + "/").simplified(); state = DylibName; continue; @@ -289,16 +289,23 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundl state = FrameworkName; continue; } else if (trimmed.startsWith("/") == false) { // If the line does not contain a full path, the app is using a binary Qt package. + QStringList partsCopy = parts; + partsCopy.removeLast(); if (currentPart.contains(".framework")) { - info.frameworkDirectory = "/Library/Frameworks/"; + info.frameworkDirectory = "/Library/Frameworks/" + partsCopy.join("/"); + if (!info.frameworkDirectory.endsWith("/")) + info.frameworkDirectory += "/"; state = FrameworkName; - } else { - info.frameworkDirectory = "/usr/lib/"; + --part; + continue; + } else if (currentPart.contains(".dylib")) { + info.frameworkDirectory = "/usr/lib/" + partsCopy.join("/"); + if (!info.frameworkDirectory.endsWith("/")) + info.frameworkDirectory += "/"; state = DylibName; + --part; + continue; } - - --part; - continue; } qtPath += (currentPart + "/"); @@ -342,9 +349,12 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundl } } - info.installName = findDependencyInfo(info.sourceFilePath).installName; - if (info.installName.startsWith("@rpath/")) - info.deployedInstallName = info.installName; + if (!info.sourceFilePath.isEmpty() && QFile::exists(info.sourceFilePath)) { + info.installName = findDependencyInfo(info.sourceFilePath).installName; + if (info.installName.startsWith("@rpath/")) + info.deployedInstallName = info.installName; + } + return info; } |