Skip to content
/ RPatchO Public

Tool for patching dylibs for making use of an rpath setup for bundled distribution.

License

Notifications You must be signed in to change notification settings

tillt/RPatchO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 - see PyInstaller/utils/osx.py

About

Tool for patching dylibs for making use of an rpath setup for bundled distribution.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages