This commit is contained in:
Hennadii Stepanov 2025-04-29 11:52:00 +02:00 committed by GitHub
commit ffb12e1fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 10 deletions

View file

@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
# Homebrew's python@3.12 is marked as externally managed (PEP 668). # Homebrew's python@3.12 is marked as externally managed (PEP 668).
# Therefore, `--break-system-packages` is needed. # Therefore, `--break-system-packages` is needed.
export PIP_PACKAGES="--break-system-packages zmq" export PIP_PACKAGES="--break-system-packages zmq"
export GOAL="install" export GOAL="install deploy"
export CMAKE_GENERATOR="Ninja" export CMAKE_GENERATOR="Ninja"
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DWITH_ZMQ=ON -DREDUCE_EXPORTS=ON" export BITCOIN_CONFIG="-DBUILD_GUI=ON -DWITH_ZMQ=ON -DREDUCE_EXPORTS=ON"
export CI_OS_NAME="macos" export CI_OS_NAME="macos"

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"):
@ -181,7 +180,7 @@ class DeploymentInfo(object):
return True return True
return False return False
def getFrameworks(binaryPath: str, verbose: int) -> list[FrameworkInfo]: def getFrameworks(binaryPath: str, verbose: int, rpath: str = '') -> list[FrameworkInfo]:
objdump = os.getenv("OBJDUMP", "objdump") objdump = os.getenv("OBJDUMP", "objdump")
if verbose: if verbose:
print(f"Inspecting with {objdump}: {binaryPath}") print(f"Inspecting with {objdump}: {binaryPath}")
@ -195,17 +194,19 @@ def getFrameworks(binaryPath: str, verbose: int) -> list[FrameworkInfo]:
lines.pop(0) # First line is the inspected binary lines.pop(0) # First line is the inspected binary
if ".framework" in binaryPath or binaryPath.endswith(".dylib"): if ".framework" in binaryPath or binaryPath.endswith(".dylib"):
lines.pop(0) # Frameworks and dylibs list themselves as a dependency. lines.pop(0) # Frameworks and dylibs list themselves as a dependency.
libraries = [] libraries = []
for line in lines: for line in lines:
line = line.replace("@loader_path", os.path.dirname(binaryPath)) line = line.replace("@loader_path", os.path.dirname(binaryPath))
if rpath:
line = line.replace("@rpath", rpath)
info = FrameworkInfo.fromLibraryLine(line.strip()) info = FrameworkInfo.fromLibraryLine(line.strip())
if info is not None: if info is not None:
if verbose: if verbose:
print("Found framework:") print("Found framework:")
print(info) print(info)
libraries.append(info) libraries.append(info)
return libraries return libraries
def runInstallNameTool(action: str, *args): def runInstallNameTool(action: str, *args):
@ -318,7 +319,7 @@ def deployFrameworks(frameworks: list[FrameworkInfo], bundlePath: str, binaryPat
# install_name_tool it a new id. # install_name_tool it a new id.
changeIdentification(framework.deployedInstallName, deployedBinaryPath, verbose) changeIdentification(framework.deployedInstallName, deployedBinaryPath, verbose)
# Check for framework dependencies # Check for framework dependencies
dependencies = getFrameworks(deployedBinaryPath, verbose) dependencies = getFrameworks(deployedBinaryPath, verbose, rpath=framework.frameworkDirectory)
for dependency in dependencies: for dependency in dependencies:
changeInstallName(dependency.installName, dependency.deployedInstallName, deployedBinaryPath, verbose) changeInstallName(dependency.installName, dependency.deployedInstallName, deployedBinaryPath, verbose)