File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed
src/scikit_build_core/repair_wheel Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 66
77from typing import TYPE_CHECKING
88
9- from . import WheelRepairer
9+ from .rpath import RpathWheelRepairer
1010
1111if TYPE_CHECKING :
12- from .. file_api . model . codemodel import Target
12+ from pathlib import Path
1313
1414__all__ = ["LinuxWheelRepairer" ]
1515
@@ -18,13 +18,27 @@ def __dir__() -> list[str]:
1818 return __all__
1919
2020
21- class LinuxWheelRepairer (WheelRepairer ):
21+ class LinuxWheelRepairer (RpathWheelRepairer ):
2222 """
2323 Adjust the RPATH with $ORIGIN.
2424 """
2525
2626 _platform = "Linux"
27+ _origin_symbol = "$ORIGIN"
2728
28- def patch_target (self , target : Target ) -> None :
29- # TODO: Implement patching
30- pass
29+ def get_library_rpath (self , artifact : Path ) -> list [str ]:
30+ from auditwheel .elfutils import elf_read_rpaths
31+
32+ return [
33+ path
34+ for dt_rpaths in elf_read_rpaths (artifact ).values ()
35+ for path in dt_rpaths
36+ ]
37+
38+ def patch_library_rpath (self , artifact : Path , rpaths : list [str ]) -> None :
39+ from auditwheel .patcher import Patchelf
40+
41+ final_rpaths = set (rpaths )
42+ if final_rpaths :
43+ patcher = Patchelf ()
44+ patcher .set_rpath (artifact , ":" .join (final_rpaths ))
You can’t perform that action at this time.
0 commit comments