@@ -181,7 +181,7 @@ class DeploymentInfo(object):
181
181
return True
182
182
return False
183
183
184
- def getFrameworks (binaryPath : str , verbose : int ) -> list [FrameworkInfo ]:
184
+ def getFrameworks (binaryPath : str , verbose : int , rpath : str = '' ) -> list [FrameworkInfo ]:
185
185
objdump = os .getenv ("OBJDUMP" , "objdump" )
186
186
if verbose :
187
187
print (f"Inspecting with { objdump } : { binaryPath } " )
@@ -195,17 +195,19 @@ def getFrameworks(binaryPath: str, verbose: int) -> list[FrameworkInfo]:
195
195
lines .pop (0 ) # First line is the inspected binary
196
196
if ".framework" in binaryPath or binaryPath .endswith (".dylib" ):
197
197
lines .pop (0 ) # Frameworks and dylibs list themselves as a dependency.
198
-
198
+
199
199
libraries = []
200
200
for line in lines :
201
201
line = line .replace ("@loader_path" , os .path .dirname (binaryPath ))
202
+ if rpath :
203
+ line = line .replace ("@rpath" , rpath )
202
204
info = FrameworkInfo .fromLibraryLine (line .strip ())
203
205
if info is not None :
204
206
if verbose :
205
207
print ("Found framework:" )
206
208
print (info )
207
209
libraries .append (info )
208
-
210
+
209
211
return libraries
210
212
211
213
def runInstallNameTool (action : str , * args ):
@@ -318,7 +320,7 @@ def deployFrameworks(frameworks: list[FrameworkInfo], bundlePath: str, binaryPat
318
320
# install_name_tool it a new id.
319
321
changeIdentification (framework .deployedInstallName , deployedBinaryPath , verbose )
320
322
# Check for framework dependencies
321
- dependencies = getFrameworks (deployedBinaryPath , verbose )
323
+ dependencies = getFrameworks (deployedBinaryPath , verbose , rpath = framework . frameworkDirectory )
322
324
323
325
for dependency in dependencies :
324
326
changeInstallName (dependency .installName , dependency .deployedInstallName , deployedBinaryPath , verbose )
0 commit comments