build: Fix macdeployqtplus after switching to Qt 6

Homebrew’s `qt@6` package places the `translations` and `plugins`
directories in the `share/qt` subdirectory.
This change updates the `macdeployqtplus` script accordingly.
This commit is contained in:
Hennadii Stepanov
2025-04-26 08:00:51 +01:00
parent 938208d91a
commit fad57e9e0f

View File

@@ -157,20 +157,19 @@ class DeploymentInfo(object):
self.qtPath = None self.qtPath = None
self.pluginPath = None self.pluginPath = None
self.deployedFrameworks = [] self.deployedFrameworks = []
def detectQtPath(self, frameworkDirectory: str): def detectQtPath(self, frameworkDirectory: str):
parentDir = os.path.dirname(frameworkDirectory) parentDir = os.path.dirname(frameworkDirectory)
if os.path.exists(os.path.join(parentDir, "translations")): if os.path.exists(os.path.join(parentDir, "share", "qt", "translations")):
# Classic layout, e.g. "/usr/local/Trolltech/Qt-4.x.x"
self.qtPath = parentDir self.qtPath = parentDir
else: else:
self.qtPath = os.getenv("QTDIR", None) self.qtPath = os.getenv("QTDIR", None)
if self.qtPath is not None: if self.qtPath is not None:
pluginPath = os.path.join(self.qtPath, "plugins") pluginPath = os.path.join(self.qtPath, "share", "qt", "plugins")
if os.path.exists(pluginPath): if os.path.exists(pluginPath):
self.pluginPath = pluginPath self.pluginPath = pluginPath
def usesFramework(self, name: str) -> bool: def usesFramework(self, name: str) -> bool:
for framework in self.deployedFrameworks: for framework in self.deployedFrameworks:
if framework.endswith(".framework"): if framework.endswith(".framework"):