Skip to content
Snippets Groups Projects
Commit 06634eda authored by Martin Afanasjew's avatar Martin Afanasjew Committed by Mike McQuaid
Browse files

keg_relocate: fix relocation of frameworks


When fixing references to regular dylibs, it is sufficient to search for
a file with the same base name, e.g., `libpoppler.56.dylib`. However, if
the broken reference is to a framework, we also have to take into
account preceding path components to find a suitable match. Framework
references (according to the `dyld` man page) come in two flavors:

- `XXX.framework/Versions/YYY/XXX` (with version)
- `XXX.framework/XXX` (without version)

The change here is to detect these patterns and to make sure that the
fixed library reference has the same suffix as the broken one.

Prior to this fix, a broken framework reference (if originating in a
sister framework) to `QtXml.framework/Versions/5/QtXml` would have been
rewritten to `<qt5-keg>/lib/QtXml.framework/QtXml`. In practice, this
mostly works, but is technically incorrect and thus creates problems
like in Homebrew/homebrew#42191. With this fix, the framework reference is correctly
rewritten to `<qt5-keg>/lib/QtXml.framework/Versions/5/QtXml`.

Closes Homebrew/homebrew#45494.

Signed-off-by: default avatarMike McQuaid <mike@mikemcquaid.com>
parent 55063f0e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment