Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tillt/rpatcho
Tool for patching dylibs for making use of an rpath setup for bundled distribution.
https://github.com/tillt/rpatcho
bundle dylib macos rpath
Last synced: about 2 months ago
JSON representation
Tool for patching dylibs for making use of an rpath setup for bundled distribution.
- Host: GitHub
- URL: https://github.com/tillt/rpatcho
- Owner: tillt
- License: gpl-2.0
- Created: 2023-10-21T12:46:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-21T19:32:46.000Z (about 1 year ago)
- Last Synced: 2024-01-28T10:37:18.490Z (11 months ago)
- Topics: bundle, dylib, macos, rpath
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RPatchO
Tool for patching dylibs for making use of an rpath setup for bundled distribution.
Normalizes the `LC_ID_DYLIB` of the dylib to allow for bundled distribution. Adjusts all `LC_LOAD_DYLIB` commands that load a non system library to make use of the `rpath`. Adds a `LC_RPATH` that points to the provided path.
### Setup
```
pip3 install -r requirements.txt
```### Running
The first parameter is the rpath we want to use in the bundle. Commonly "@loader_dir/../Frameworks" is the right choice.
The second parameter is the library we want to mutate. Note: Modifications are done in place - create backups before running!```
python3 rpatcho.py "@loader_dir/../Frameworks" libtest.dylib
```### Validation
Use `otool` for getting the load commands.
```
otool -l libtest.dylib
```Make sure the dylib filename matches the `LC_ID_DYLIB` filename portion - adjust the dylib filename to match if needed.
### Credits
This is mostly a reduced copy of a piece of [PyInstaller](https://github.com/pyinstaller/pyinstaller) - see [PyInstaller/utils/osx.py](https://github.com/pyinstaller/pyinstaller/blob/122a99659e4b19bb38475e5c9e35a540e29451c2/PyInstaller/utils/osx.py)