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 77import dataclasses
88from typing import TYPE_CHECKING
99
10- from .base import WheelRepairer
10+ from .rpath import RpathWheelRepairer
1111
1212if TYPE_CHECKING :
13- from .. file_api . model . codemodel import Target
13+ from pathlib import Path
1414
1515__all__ = ["LinuxWheelRepairer" ]
1616
@@ -20,13 +20,27 @@ def __dir__() -> list[str]:
2020
2121
2222@dataclasses .dataclass
23- class LinuxWheelRepairer (WheelRepairer ):
23+ class LinuxWheelRepairer (RpathWheelRepairer ):
2424 """
2525 Adjust the RPATH with $ORIGIN.
2626 """
2727
2828 _platform = "Linux"
29+ _origin_symbol = "$ORIGIN"
2930
30- def patch_target (self , target : Target ) -> None :
31- # TODO: Implement patching
32- pass
31+ def get_library_rpath (self , artifact : Path ) -> list [str ]:
32+ from auditwheel .elfutils import elf_read_rpaths
33+
34+ return [
35+ path
36+ for dt_rpaths in elf_read_rpaths (artifact ).values ()
37+ for path in dt_rpaths
38+ ]
39+
40+ def patch_library_rpath (self , artifact : Path , rpaths : list [str ]) -> None :
41+ from auditwheel .patcher import Patchelf
42+
43+ final_rpaths = set (rpaths )
44+ if final_rpaths :
45+ patcher = Patchelf ()
46+ patcher .set_rpath (artifact , ":" .join (final_rpaths ))
You can’t perform that action at this time.
0 commit comments