Link rawtherapee-cli in tools/osx/macosx_bundle.sh + safety fixes, #3924

This commit is contained in:
Morgan Hardwood 2017-07-17 00:22:20 +02:00
parent e08e921ad1
commit 9a13e4b360

View File

@ -16,11 +16,11 @@ fMagenta="$(tput setaf 5)"
fRed="$(tput setaf 1)" fRed="$(tput setaf 1)"
function msg { function msg {
printf "\n${fBold}-- %s${fNormal}\n" "${@}" printf "\\n${fBold}-- %s${fNormal}\\n" "${@}"
} }
function msgError { function msgError {
printf "\n${fBold}Error:${fNormal}\n%s\n" "${@}" printf "\\n${fBold}Error:${fNormal}\\n%s\\n" "${@}"
} }
function GetDependencies { function GetDependencies {
@ -28,9 +28,9 @@ function GetDependencies {
} }
function CheckLink { function CheckLink {
GetDependencies "$1" | while read; do GetDependencies "$1" | while read -r; do
local dest="${LIB}/$(basename "${REPLY}")" local dest="${LIB}/$(basename "${REPLY}")"
test -f "${dest}" || { ditto --arch ${arch} "${REPLY}" "${dest}"; CheckLink "${dest}"; } test -f "${dest}" || { ditto --arch "${arch}" "${REPLY}" "${dest}"; CheckLink "${dest}"; }
done done
} }
@ -121,7 +121,7 @@ ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0
ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gtk-3.0 ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gtk-3.0
msg "Removing static libraries and cache files:" msg "Removing static libraries and cache files:"
find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read; do rm "${REPLY}"; done find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read -r; do rm "${REPLY}"; done
msg "Copying configuration files from ${GTK_PREFIX}:" msg "Copying configuration files from ${GTK_PREFIX}:"
install -d "${ETC}/gtk-3.0" install -d "${ETC}/gtk-3.0"
@ -155,13 +155,13 @@ ditto {"${GTK_PREFIX}","${RESOURCES}"}/share/icons/Adwaita/index.theme
# fi # fi
# Install names # Install names
find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee|.*\.(dylib|so))' | while read x; do find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee-cli|rawtherapee|.*\.(dylib|so))' | while read -r x; do
msg "Modifying install names: ${x}" msg "Modifying install names: ${x}"
{ {
# id # id
case ${x} in *.dylib) echo " install_name_tool -id '@rpath/$(basename "${x}")' '${x}'";; esac case ${x} in *.dylib) echo " install_name_tool -id '@rpath/$(basename "${x}")' '${x}'";; esac
# names # names
GetDependencies "${x}" | while read y; do GetDependencies "${x}" | while read -r y; do
echo " install_name_tool -change '${y}' '@rpath/$(basename "${y}")' '${x}'" echo " install_name_tool -change '${y}' '@rpath/$(basename "${y}")' '${x}'"
done done
} | bash -v } | bash -v