Fetch deps before patching RPATH

This commit is contained in:
Valentin Niess
2024-10-14 14:48:16 +02:00
parent efc41b6079
commit da067b4831

View File

@@ -94,6 +94,8 @@ def patch_binary(path, libdir, recursive=True):
else:
excluded = _excluded_libs
deps = ldd(path) # Fetch deps before patching RPATH.
ensure_patchelf()
rpath = '\'' + system((PATCHELF, '--print-rpath', path)) + '\''
relpath = os.path.relpath(libdir, os.path.dirname(path))
@@ -102,7 +104,6 @@ def patch_binary(path, libdir, recursive=True):
if rpath != expected:
system((PATCHELF, '--set-rpath', expected, path))
deps = ldd(path)
for dep in deps:
name = os.path.basename(dep)
if name in excluded: