osxbundle: resolve loader_path on rpath retrieval

rpaths can be relative to the current object folder path. resolve those
paths.
This commit is contained in:
der richter 2024-02-22 00:44:19 +01:00
parent 98f2dcb676
commit 48f48e0d5d
1 changed files with 6 additions and 1 deletions

View File

@ -50,7 +50,12 @@ def get_rapths(objfile):
return rpaths
for line in result.splitlines():
rpaths.append(pathRe.search(line).group(1).strip())
line_clean = pathRe.search(line).group(1).strip()
# resolve @loader_path
if line_clean.startswith('@loader_path/'):
line_clean = line_clean[len('@loader_path/'):]
line_clean = os.path.normpath(os.path.join(os.path.dirname(objfile), line_clean))
rpaths.append(line_clean)
return rpaths