Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle @loader_path and @rpath dependencies #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ThomasDebrunner
Copy link

macpack did not handle @loader_path and @rpath dependencies. I added the following functionality:

  • For every library, find all the rpath in the dependency by issuing and parsing otool -l command on the library.
  • If the library has a dependency on a @rpath library, try to find it in any of the libraries rpath.
  • If the library has a dependency on a @loader_path library, try to find it in the directory of its requester.

To make it all more generic, I renamed the the symlinks list to referred_as list, which just contains the list of all the strings under which a specific library is referred to as. This can include absolute paths to libraries, paths to symlinks or strings with @loader_path or @rpath. This list is the only thing the patcher then looks at, as it is all the reference strings it must change.

The path member of dependency always contains the resolved, absolute path to the actual library.

@chearon
Copy link
Owner

chearon commented Apr 18, 2019

Hey thanks for this pull request! It's been a long time since I've looked at this code so I've been putting it off but I do hope to take a look at this soon. I actually didn't even consider that it would be possible to handle @loader_path and @rpath, but this will be great to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants