File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
src/scikit_build_core/repair_wheel Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 66
77from typing import TYPE_CHECKING
88
9- import auditwheel # noqa: F401
9+ from auditwheel .elfutils import elf_read_rpaths
10+ from auditwheel .patcher import Patchelf
1011
11- from . import WheelRepairer
12+ from .rpath import RpathWheelRepairer
1213
1314if TYPE_CHECKING :
14- from .. file_api . model . codemodel import Target
15+ from pathlib import Path
1516
1617__all__ = ["LinuxWheelRepairer" ]
1718
@@ -20,13 +21,23 @@ def __dir__() -> list[str]:
2021 return __all__
2122
2223
23- class LinuxWheelRepairer (WheelRepairer ):
24+ class LinuxWheelRepairer (RpathWheelRepairer ):
2425 """
2526 Adjust the RPATH with $ORIGIN.
2627 """
2728
2829 _platform = "Linux"
29-
30- def patch_target (self , target : Target ) -> None :
31- # TODO: Implement patching
32- pass
30+ _origin_symbol = "$ORIGIN"
31+
32+ def get_library_rpath (self , artifact : Path ) -> list [str ]:
33+ return [
34+ path
35+ for dt_rpaths in elf_read_rpaths (artifact ).values ()
36+ for path in dt_rpaths
37+ ]
38+
39+ def patch_library_rpath (self , artifact : Path , rpaths : list [str ]) -> None :
40+ final_rpaths = set (rpaths )
41+ if final_rpaths :
42+ patcher = Patchelf ()
43+ patcher .set_rpath (artifact , ":" .join (final_rpaths ))
You can’t perform that action at this time.
0 commit comments