[qtbase] fix macdeployqt for symlinks (#42430)

This commit is contained in:
Matthias Kuhn 2024-12-23 17:19:40 +01:00 committed by GitHub
parent a08d0b196f
commit 386ee8bae8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,33 @@
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index 6ff269b..caffd44 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1,4 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
+
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QCoreApplication>
#include <QString>
@@ -85,7 +86,21 @@
}
}
- if (QFile::copy(from, to)) {
+ QFileInfo fromFileInfo(from);
+
+ if (fromFileInfo.isSymLink()) {
+ const QString fromSymLinkTarget = fromFileInfo.absoluteDir().relativeFilePath(fromFileInfo.symLinkTarget());
+ if (QFile::link(fromSymLinkTarget, to)) {
+ return copyFilePrintStatus(fromFileInfo.absoluteDir().absoluteFilePath(fromSymLinkTarget), QFileInfo(to).absoluteDir().absoluteFilePath(fromSymLinkTarget));
+ }
+ else {
+ LogError() << "symlink copy failed from" << from;
+ LogError() << " to" << to;
+ return false;
+ }
+
+ }
+ else if (QFile::copy(from, to)) {
QFile dest(to);
dest.setPermissions(dest.permissions() | QFile::WriteOwner | QFile::WriteUser);
LogNormal() << " copied:" << from;

View File

@ -22,6 +22,7 @@ set(${PORT}_PATCHES
fix-host-aliasing.patch
fix_deploy_windows.patch
fix-link-lib-discovery.patch
macdeployqt-symlinks.patch
)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)

View File

@ -1,6 +1,7 @@
{
"name": "qtbase",
"version": "6.8.1",
"port-version": 1,
"description": "Qt Base (Core, Gui, Widgets, Network, ...)",
"homepage": "https://www.qt.io/",
"license": null,

View File

@ -7570,7 +7570,7 @@
},
"qtbase": {
"baseline": "6.8.1",
"port-version": 0
"port-version": 1
},
"qtcharts": {
"baseline": "6.8.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "aca356b06f62fc44f51769ef5418230a385e3c7f",
"version": "6.8.1",
"port-version": 1
},
{
"git-tree": "15eabae75af5ff861ffa692ff8072aca9af30fad",
"version": "6.8.1",