From 7ea9a6f3ad09ff058a1c117dab11f65632f248c9 Mon Sep 17 00:00:00 2001 From: Guineng Ni Date: Sun, 10 Apr 2022 15:11:37 +0800 Subject: [PATCH] macdeployqt: macdeployqt process some libraries(e.g. ffmpeg) incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ffmpeg and nettle are different from other libraries, they use symbol link as their inner module dependencies. Calling one more install_name_tool can handle this case. Fixes: QTBUG-100093 Change-Id: I12cdd53bd5aa3120910070ba283178686deb3eb0 Reviewed-by: Morten Johan Sørvig (cherry picked from commit 6dbe45c96a6b807cfc19c34cf2833504148d019f) Reviewed-by: Qt Cherry-pick Bot --- src/tools/macdeployqt/shared/shared.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp index 5abc0281c69..fa22b47067c 100644 --- a/src/tools/macdeployqt/shared/shared.cpp +++ b/src/tools/macdeployqt/shared/shared.cpp @@ -834,9 +834,15 @@ void changeInstallName(const QString &bundlePath, const FrameworkInfo &framework changeInstallName(framework.installName, deployedInstallName, binary); // Workaround for the case when the library ID name is a symlink, while the dependencies // specified using the canonical path to the library (QTBUG-56814) - QString canonicalInstallName = QFileInfo(framework.installName).canonicalFilePath(); + QFileInfo fileInfo= QFileInfo(framework.installName); + QString canonicalInstallName = fileInfo.canonicalFilePath(); if (!canonicalInstallName.isEmpty() && canonicalInstallName != framework.installName) { changeInstallName(canonicalInstallName, deployedInstallName, binary); + // some libraries' inner dependencies (such as ffmpeg, nettle) use symbol link (QTBUG-100093) + QString innerDependency = fileInfo.canonicalPath() + "/" + fileInfo.fileName(); + if (innerDependency != canonicalInstallName && innerDependency != framework.installName) { + changeInstallName(innerDependency, deployedInstallName, binary); + } } } }