Skip to content

Commit 4591795

Browse files
zisoftTurboGit
authored andcommitted
fix macOS package building
1 parent 6fd2902 commit 4591795

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

packaging/macosx/3_make_hb_darktable_package.sh

+16-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function reset_exec_path {
116116
# Set correct executable path
117117
install_name_tool -change "$hbDependency" "@executable_path/../Resources/lib/$dynDepOrigFile" "$1" || true
118118

119-
# Check for loader path
119+
# Check for loader paths
120120
oToolLoader=$(otool -L "$1" 2>/dev/null | grep '@loader_path' | grep $dynDepOrigFile | cut -d\( -f1 | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//' ) || true
121121
if [[ -n "$oToolLoader" ]]; then
122122
echo "Resetting loader path for $hbDependency of $libraryOrigFile"
@@ -135,7 +135,21 @@ function reset_exec_path {
135135
echo "Resetting library ID of $libraryOrigFile"
136136

137137
# 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
139153
fi
140154
}
141155

0 commit comments

Comments
 (0)