INNER CODE UNIT · Python
destination
mumu-lhl/Ciyue · tools/bundle_linux_dependencies.py:115
destination = library_dir / name
if destination.exists() or destination.is_symlink():
return destination
if source.parent == library_dir:
destination.symlink_to(source.name)
return destination
shutil.copy2(source.resolve(), destination)
patchelf = shutil.which("patchelf")
if patchelf:
subprocess.run([patchelf, "--remove-rpath", str(destination)], check=True)
return destination
def collect(bundle_dir: Path, search_roots: list[Path]) -> None:
library_dir = bundle_dir / "lib"
index = library_index(search_roots)