File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ function reset_exec_path {
116
116
# Set correct executable path
117
117
install_name_tool -change " $hbDependency " " @executable_path/../Resources/lib/$dynDepOrigFile " " $1 " || true
118
118
119
- # Check for loader path
119
+ # Check for loader paths
120
120
oToolLoader=$( otool -L " $1 " 2> /dev/null | grep ' @loader_path' | grep $dynDepOrigFile | cut -d\( -f1 | sed ' s/^[[:blank:]]*//;s/[[:blank:]]*$//' ) || true
121
121
if [[ -n " $oToolLoader " ]]; then
122
122
echo " Resetting loader path for $hbDependency of $libraryOrigFile "
@@ -135,7 +135,21 @@ function reset_exec_path {
135
135
echo " Resetting library ID of $libraryOrigFile "
136
136
137
137
# Set correct library id
138
- install_name_tool -id " @executable_path/../Resources/lib/$libraryOrigFile " " $1 " || true
138
+ # build the path relative to the package by cutting off $dtResourcesDir
139
+ execpath=" @executable_path/../Resources${1# $dtResourcesDir } "
140
+ install_name_tool -id " $execpath " " $1 " || true
141
+ # install_name_tool -id "@executable_path/../Resources/lib/$libraryOrigFile" "$1" || true
142
+ fi
143
+
144
+ # Check for rpaths
145
+ oToolRpaths=$( otool -L " $1 " 2> /dev/null | grep ' @rpath' | cut -d\( -f1 | sed ' s/^[[:blank:]]*//;s/[[:blank:]]*$//' ) || true
146
+ if [[ -n " $oToolRpaths " ]]; then
147
+ for oToolRpath in $oToolRpaths ; do
148
+ oToolRpathNew=$( echo $oToolRpath | sed " s#@rpath/##" )
149
+ if [[ " $oToolRpathNew " != " libdarktable.dylib" ]]; then
150
+ install_name_tool -change " $oToolRpath " " @executable_path/../Resources/lib/$oToolRpathNew " " $1 " || true
151
+ fi
152
+ done
139
153
fi
140
154
}
141
155
You can’t perform that action at this time.
0 commit comments