Repair libraries pointing to symlinks
Symlinks are not copied, so we have to make the link precisely right.
This commit is contained in:
parent
149d3459de
commit
7bd98f06b3
@ -116,15 +116,21 @@ function fix_paths {
|
|||||||
log Fixing $lib
|
log Fixing $lib
|
||||||
for dep in $(resolve_deps $lib)
|
for dep in $(resolve_deps $lib)
|
||||||
do
|
do
|
||||||
# @executable_path is /path/to/Gaphor.app/MacOS
|
local relname
|
||||||
if [[ "$dep" =~ ^.*/Frameworks/.* ]]
|
if [[ "$dep" =~ ^.*/Frameworks/.* ]]
|
||||||
then
|
then
|
||||||
log " $dep -> @executable_path/../$(echo $dep | sed 's#^.*/\(Frameworks/.*$\)#\1#')"
|
relname="../$(echo $dep | sed 's#^.*/\(Frameworks/.*$\)#\1#')"
|
||||||
install_name_tool -change $dep @executable_path/../$(echo $dep | sed 's#^.*/\(Frameworks/.*$\)#\1#') $lib
|
|
||||||
else
|
else
|
||||||
log " $dep -> @executable_path/../lib/$(basename $dep)"
|
relname="../lib/$(basename $dep)"
|
||||||
install_name_tool -change $dep @executable_path/../lib/$(basename $dep) $lib
|
|
||||||
fi
|
fi
|
||||||
|
test -f "${MACOSDIR}/$relname" || {
|
||||||
|
local fullname=$(eval echo ${MACOSDIR}/${relname//\.dylib/.*.dylib})
|
||||||
|
log "Library ${MACOSDIR}/$relname not found, using $(basename $fullname) instead"
|
||||||
|
relname="$(dirname $relname)/$(basename $fullname)"
|
||||||
|
}
|
||||||
|
# @executable_path is /path/to/Gaphor.app/MacOS
|
||||||
|
log " $dep -> @executable_path/$relname"
|
||||||
|
install_name_tool -change $dep @executable_path/$relname $lib
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user