build: Resolve @rpath in macdeployqtplus
Extend `getFrameworks()` with an optional `rpath` parameter to replace `@rpath` in dependency paths. This fixes resolution of framework dependencies when using Homebrew's `qt@6` package.
This commit is contained in:
1 parent
cdc32994fe
commit
938208d91a
1 file changed
+4
-2
@@ -181,7 +181,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}")
|
||||||
@@ -199,6 +199,8 @@ def getFrameworks(binaryPath: str, verbose: int) -> list[FrameworkInfo]:
|
|||||||
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:
|
||||||
@@ -318,7 +320,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)
|
||||||
|
|||||||
Reference in new issue
Block a user