From 8970da1c2c673d0a5562d9de5189b9cf94c5e4c2 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sat, 1 Feb 2020 08:20:58 -0800 Subject: [PATCH 1/9] macOS: preserve binary resources / codesign frmwks Copies libraries using `ditto` Codesigns each in Contents/Framework --- tools/osx/macosx_bundle.sh | 83 +++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index cb8839455..e4476c5e7 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -76,10 +76,7 @@ if [[ -z "${MINIMUM_SYSTEM_VERSION}" ]]; then MINIMUM_SYSTEM_VERSION="$(sw_vers -productVersion | cut -d. -f-2)" fi -case ${PROC_BIT_DEPTH} in - 64) arch=x86_64;; - 32) arch=i386;; -esac +arch=x86_64 cat <<__EOS__ PROJECT_NAME: ${PROJECT_NAME} @@ -131,8 +128,8 @@ msg "Copying configuration files from ${GTK_PREFIX}:" install -d "${ETC}/gtk-3.0" # Make Frameworks folder flat -mv "${LIB}"/gdk-pixbuf-2.0/2*/loaders/*.so "${LIB}" -mv "${LIB}"/gtk-3.0/3*/immodules/*.so "${LIB}" +ditto "${LIB}"/gdk-pixbuf-2.0/2*/loaders/*.so "${LIB}" +ditto "${LIB}"/gtk-3.0/3*/immodules/*.so "${LIB}" # the print*.so lead to errors when running gtk-query-immodules-3.0, just seeing what the app does without, since they are not in immodules # and including them leads to errors and a completely empty gtk.immodules file # mv "${LIB}"/gtk-3.0/3*/printbackends/*.so "${LIB}" @@ -144,11 +141,11 @@ rm -r "${LIB}"/gdk-pixbuf-2.0 sed -i "" -e "s|${PWD}/RawTherapee.app/Contents/|/Applications/RawTherapee.app/Contents/|" "${ETC}/gtk-3.0/gdk-pixbuf.loaders" "${ETC}/gtk-3.0/gtk.immodules" mkdir -p ${RESOURCES}/share/glib-2.0 -cp -pRL {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/glib-2.0/schemas +ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/glib-2.0/schemas "${LOCAL_PREFIX}/local/bin/glib-compile-schemas" "${RESOURCES}/share/glib-2.0/schemas" msg "Copying shared files from ${GTK_PREFIX}:" -cp -pRL {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/mime +ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/mime # GTK3 themes ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Mac/gtk-3.0/gtk-keys.css @@ -157,33 +154,33 @@ ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Default/gtk-3.0/gtk- iconfolders=("16x16/actions" "16x16/devices" "16x16/mimetypes" "16x16/places" "16x16/status" "48x48/devices") for f in "${iconfolders[@]}"; do mkdir -p ${RESOURCES}/share/icons/Adwaita/${f} - cp ${LOCAL_PREFIX}/local/share/icons/Adwaita/${f}/* "${RESOURCES}"/share/icons/Adwaita/${f} + ditto ${LOCAL_PREFIX}/local/share/icons/Adwaita/${f}/* "${RESOURCES}"/share/icons/Adwaita/${f} done ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/icons/Adwaita/index.theme "${LOCAL_PREFIX}/local/bin/gtk-update-icon-cache" "${RESOURCES}/share/icons/Adwaita" -# Copy libjpeg-turbo into the app bundle -cp ${LOCAL_PREFIX}/local/lib/libjpeg.*.dylib "${CONTENTS}/Frameworks" +# Copy libjpeg-turbo ("62") into the app bundle +ditto ${LOCAL_PREFIX}/local/lib/libjpeg.62.dylib "${CONTENTS}/Frameworks/libjpeg.62.dylib" # Copy libexpat into the app bundle (which is keg-only) -if [[ -d /usr/local/Cellar/expat ]]; then cp /usr/local/Cellar/expat/*/lib/libexpat.1.dylib "${CONTENTS}/Frameworks"; else cp "${EXPATLIB}" "${CONTENTS}/Frameworks"; fi +if [[ -d /usr/local/Cellar/expat ]]; then ditto /usr/local/Cellar/expat/*/lib/libexpat.1.dylib "${CONTENTS}/Frameworks"; else ditto "${EXPATLIB}" "${CONTENTS}/Frameworks"; fi # Copy libz into the app bundle -cp /usr/lib/libz.1.dylib "${CONTENTS}/Frameworks" +ditto ${LOCAL_PREFIX}/local/lib/libz.1.dylib "${CONTENTS}/Frameworks" -# Copy libtiff into the app bundle -cp ${LOCAL_PREFIX}/local/lib/libtiff.5.dylib "${CONTENTS}/Frameworks" +# Copy libtiff 5 into the app bundle +ditto ${LOCAL_PREFIX}/local/lib/libtiff.5.dylib "${CONTENTS}/Frameworks/libtiff.5.dylib" # Copy the Lensfun database into the app bundle mkdir -p "${RESOURCES}/share/lensfun" -cp ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" +ditto ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" # Copy liblensfun to Frameworks -cp ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks" +ditto ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks" # Copy libomp to Frameworks -cp ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks" +ditto ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks" # Install names find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee-cli|rawtherapee|.*\.(dylib|so))' | while read -r x; do @@ -198,9 +195,7 @@ find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee-cli|rawtherapee|.*\.(dylib } | bash -v done -msg "Registering @loader_path into the executable:" -echo " install_name_tool -add_rpath @executable_path/../../Frameworks '${EXECUTABLE}'" | bash -v -echo " install_name_tool -add_rpath @loader_path/../Frameworks '${EXECUTABLE}-cli'" | bash -v + msg "Installing required application bundle files:" PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}/tools/osx" @@ -208,34 +203,46 @@ ditto "${PROJECT_SOURCE_DIR}/build/Resources" "${RESOURCES}" # Executable loader # Note: executable is renamed to 'rawtherapee-bin'. mkdir "${MACOS}/bin" -mv "${MACOS}/rawtherapee" "${MACOS}/bin/rawtherapee-bin" +ditto "${MACOS}/rawtherapee" "${MACOS}/bin/rawtherapee-bin" +rm "${MACOS}/rawtherappe" install -m 0755 "${PROJECT_SOURCE_DATA_DIR}/executable_loader.in" "${MACOS}/rawtherapee" # App bundle resources -cp "${PROJECT_SOURCE_DATA_DIR}/"{rawtherapee,profile}.icns "${RESOURCES}" -cp "${PROJECT_SOURCE_DATA_DIR}/PkgInfo" "${CONTENTS}" +ditto "${PROJECT_SOURCE_DATA_DIR}/"{rawtherapee,profile}.icns "${RESOURCES}" +ditto "${PROJECT_SOURCE_DATA_DIR}/PkgInfo" "${CONTENTS}" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/Info.plist.in" "${CONTENTS}/Info.plist" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/Info.plist-bin.in" "${CONTENTS}/MacOS/bin/Info.plist" sed -i "" -e "s|@version@|${PROJECT_FULL_VERSION}| s|@shortVersion@|${PROJECT_VERSION}| s|@arch@|${arch}|" \ "${CONTENTS}/Info.plist" -plutil -convert binary1 "${CONTENTS}/Info.plist" -plutil -convert binary1 "${CONTENTS}/MacOS/bin/Info.plist" +plutil -convert xml1 "${CONTENTS}/Info.plist" +plutil -convert xml1 "${CONTENTS}/MacOS/bin/Info.plist" +update-mime-database -V "${CONTENTS}/Resources/share/mime" + +msg "Registering @rpath into the executable:" +echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${MACOS}/bin/rawtherapee-bin'" | bash -v +echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${EXECUTABLE}-cli'" | bash -v + # Sign the app CODESIGNID="$(cmake .. -LA -N | grep "CODESIGNID" | cut -d "=" -f2)" if ! test -z "$CODESIGNID" ; then install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/rt.entitlements" "${CONTENTS}/Entitlements.plist" -plutil -convert binary1 "${CONTENTS}/Entitlements.plist" +plutil -convert xml1 "${CONTENTS}/Entitlements.plist" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/rt-bin.entitlements" "${CONTENTS}/MacOS/bin/Entitlements.plist" -plutil -convert binary1 "${CONTENTS}/MacOS/bin/Entitlements.plist" -codesign -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee-bin" --timestamp -o runtime --entitlements "${APP}/Contents/MacOS/bin/Entitlements.plist" "${APP}/Contents/MacOS/bin/rawtherapee-bin" -codesign --deep --preserve-metadata=identifier,entitlements,runtime --strict -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee" --timestamp -o runtime --entitlements "${APP}/Contents/Entitlements.plist" "${APP}" - spctl -a -vvvv "${APP}" +plutil -convert xml1 "${CONTENTS}/MacOS/bin/Entitlements.plist" +codesign -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee-bin" -o runtime --timestamp --entitlements "${APP}/Contents/MacOS/bin/Entitlements.plist" "${APP}/Contents/MacOS/bin/rawtherapee-bin" +for frameworklibs in ${CONTENTS}/Frameworks/* ; do + codesign -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee-bin" -o runtime --timestamp "${frameworklibs}" +done +codesign --deep --preserve-metadata=identifier,entitlements,runtime --timestamp --strict -v -s "${CODESIGNID}" -i "com.rawtherapee.rawtherapee" -o runtime --entitlements "${CONTENTS}/Entitlements.plist" "${APP}" +spctl -a -vvvv "${APP}" fi # Notarize the app + NOTARY="$(cmake .. -LA -N | grep "NOTARY" | cut -d "=" -f2)" if ! test -z "$NOTARY" ; then + msg "Notarizing the application:" ditto -c -k --sequesterRsrc --keepParent "${APP}" "${APP}.zip" uuid=`xcrun altool --notarize-app --primary-bundle-id "com.rawtherapee.rawtherapee" ${NOTARY} --file "${APP}.zip" 2>&1 | grep 'RequestUUID' | awk '{ print $3 }'` echo "Result= $uuid" # Display identifier string @@ -264,8 +271,8 @@ function CreateDmg { local srcDir="$(mktemp -dt $$)" msg "Preparing disk image sources at ${srcDir}:" - cp -R "${APP}" "${srcDir}" - cp AboutThisBuild.txt "${srcDir}" + ditto -R "${APP}" "${srcDir}" + ditto AboutThisBuild.txt "${srcDir}" ln -s /Applications "${srcDir}" # Web bookmarks @@ -292,7 +299,9 @@ function CreateDmg { fi # Notarize the dmg - if ! test -z "$NOTARY" ; then + + if ! test -z "$NOTARY" ; then + msg "Notarizing the dmg:" zip "${dmg_name}.dmg.zip" "${dmg_name}.dmg" uuid=`xcrun altool --notarize-app --primary-bundle-id "com.rawtherapee" ${NOTARY} --file "${dmg_name}.dmg.zip" 2>&1 | grep 'RequestUUID' | awk '{ print $3 }'` echo "dmg Result= $uuid" # Display identifier string @@ -316,9 +325,11 @@ function CreateDmg { fi done fi + + +# Zip disk image for redistribution + msg "Zipping disk image for redistribution:" - - # Zip disk image for redistribution zip "${dmg_name}.zip" "${dmg_name}.dmg" AboutThisBuild.txt rm "${dmg_name}.dmg" From 91259a23283e5e79370722e33ef734411517a913 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sat, 1 Feb 2020 10:15:42 -0800 Subject: [PATCH 2/9] macOS: Fix location of pixbuf loaders --- tools/osx/macosx_bundle.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index e4476c5e7..a2df9eba2 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -118,7 +118,7 @@ msg "Copying dependencies from ${GTK_PREFIX}:" CheckLink "${EXECUTABLE}" msg "Copying library modules from ${GTK_PREFIX}:" -ditto --arch "${arch}" {"${GDK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0 +ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0 ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gtk-3.0 msg "Removing static libraries and cache files:" @@ -136,7 +136,7 @@ ditto "${LIB}"/gtk-3.0/3*/immodules/*.so "${LIB}" rm -r "${LIB}"/gtk-3.0 rm -r "${LIB}"/gdk-pixbuf-2.0 -"${GDK_PREFIX}"/bin/gdk-pixbuf-query-loaders "${LIB}"/libpix*.so > "${ETC}"/gtk-3.0/gdk-pixbuf.loaders +"${GTK_PREFIX}"/bin/gdk-pixbuf-query-loaders "${LIB}"/libpix*.so > "${ETC}"/gtk-3.0/gdk-pixbuf.loaders "${GTK_PREFIX}"/bin/gtk-query-immodules-3.0 "${LIB}"/im*.so > "${ETC}"/gtk-3.0/gtk.immodules sed -i "" -e "s|${PWD}/RawTherapee.app/Contents/|/Applications/RawTherapee.app/Contents/|" "${ETC}/gtk-3.0/gdk-pixbuf.loaders" "${ETC}/gtk-3.0/gtk.immodules" From 07a6ec5f10892f91afdd9f409bc753f5296b9f3f Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sat, 1 Feb 2020 15:44:05 -0800 Subject: [PATCH 3/9] macOS: cleanup rpaths, gdk adjustments --- tools/osx/macosx_bundle.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index a2df9eba2..36b650f3b 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -99,7 +99,7 @@ MACOS="${CONTENTS}/MacOS" LIB="${CONTENTS}/Frameworks" ETC="${RESOURCES}/etc" EXECUTABLE="${MACOS}/rawtherapee" -GDK_PREFIX="${LOCAL_PREFIX}/local/opt/gdk-pixbuf" +GDK_PREFIX="${LOCAL_PREFIX}/local/" msg "Removing old files:" rm -rf "${APP}" "${PROJECT_NAME}_*.dmg" "*zip" @@ -129,16 +129,14 @@ install -d "${ETC}/gtk-3.0" # Make Frameworks folder flat ditto "${LIB}"/gdk-pixbuf-2.0/2*/loaders/*.so "${LIB}" -ditto "${LIB}"/gtk-3.0/3*/immodules/*.so "${LIB}" -# the print*.so lead to errors when running gtk-query-immodules-3.0, just seeing what the app does without, since they are not in immodules -# and including them leads to errors and a completely empty gtk.immodules file -# mv "${LIB}"/gtk-3.0/3*/printbackends/*.so "${LIB}" +ditto "${LIB}"/gtk-3.0/3*/immodules/*.{dylib,so} "${LIB}" rm -r "${LIB}"/gtk-3.0 rm -r "${LIB}"/gdk-pixbuf-2.0 -"${GTK_PREFIX}"/bin/gdk-pixbuf-query-loaders "${LIB}"/libpix*.so > "${ETC}"/gtk-3.0/gdk-pixbuf.loaders -"${GTK_PREFIX}"/bin/gtk-query-immodules-3.0 "${LIB}"/im*.so > "${ETC}"/gtk-3.0/gtk.immodules +"${LOCAL_PREFIX}"/local/bin/gdk-pixbuf-query-loaders "${LIB}"/libpix*.so > "${ETC}"/gtk-3.0/gdk-pixbuf.loaders +"${LOCAL_PREFIX}"/local/bin/gtk-query-immodules-3.0 "${LIB}"/im-* > "${ETC}"/gtk-3.0/gtk.immodules sed -i "" -e "s|${PWD}/RawTherapee.app/Contents/|/Applications/RawTherapee.app/Contents/|" "${ETC}/gtk-3.0/gdk-pixbuf.loaders" "${ETC}/gtk-3.0/gtk.immodules" +sed -i "" -e "s|/opt/local/|/usr/|" "${ETC}/gtk-3.0/gtk.immodules" mkdir -p ${RESOURCES}/share/glib-2.0 ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/glib-2.0/schemas @@ -158,6 +156,7 @@ for f in "${iconfolders[@]}"; do done ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/icons/Adwaita/index.theme "${LOCAL_PREFIX}/local/bin/gtk-update-icon-cache" "${RESOURCES}/share/icons/Adwaita" +ditto "${LOCAL_PREFIX}/local/share/icons/hicolor" "${RESOURCES}/share/icons/hicolor" # Copy libjpeg-turbo ("62") into the app bundle ditto ${LOCAL_PREFIX}/local/lib/libjpeg.62.dylib "${CONTENTS}/Frameworks/libjpeg.62.dylib" @@ -222,6 +221,10 @@ update-mime-database -V "${CONTENTS}/Resources/share/mime" msg "Registering @rpath into the executable:" echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${MACOS}/bin/rawtherapee-bin'" | bash -v echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${EXECUTABLE}-cli'" | bash -v +for frameworklibs in ${CONTENTS}/Frameworks/* ; do + echo " install_name_tool -delete_rpath /opt/local/lib '${frameworklibs}'" | bash -v + echo " install_name_tool -add_rpath /Applications/RawTherapee.app/Contents/Frameworks '${frameworklibs}'" | bash -v +done # Sign the app CODESIGNID="$(cmake .. -LA -N | grep "CODESIGNID" | cut -d "=" -f2)" From 2b307218be95671c554510c120ed8919859c329e Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sat, 1 Feb 2020 15:45:23 -0800 Subject: [PATCH 4/9] macOS: exec loader, harden app to /Applications --- tools/osx/executable_loader.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/osx/executable_loader.in b/tools/osx/executable_loader.in index 429173d8e..a10e88265 100644 --- a/tools/osx/executable_loader.in +++ b/tools/osx/executable_loader.in @@ -1,19 +1,22 @@ #!/bin/sh +# GIMP has this next line regarding raising the open-number-of-files limit: +ulimit -n 7000 + cd "$(dirname "$0")" || exit 1 cwd="$(pwd)" -app="${cwd%/Contents/*}" +app="/Applications/RawTherapee.app" lib="${app}/Contents/Frameworks" resources="${app}/Contents/Resources" -etc="${resources}"/etc +etc="${resources}/etc" export XDG_DATA_DIRS="${resources}/share" export DYLD_LIBRARY_PATH="${lib}" export GTK_PATH="${lib}/gtk-3.0/3.0.0" export XDG_DATA_HOME="${resources}/share" export GSETTINGS_SCHEMA_DIR="${resources}/share/glib-2.0/schemas" export GDK_PIXBUF_MODULE_FILE="${etc}/gtk-3.0/gdk-pixbuf.loaders" -export GDK_PIXBUF_MODULEDIR="${lib}/gdk-pixbuf-2.0/2.10.0/loaders" +export GDK_PIXBUF_MODULEDIR="${lib}" export RT_SETTINGS="${HOME}/Library/Application Support/RawTherapee/config" export RT_CACHE="${HOME}/Library/Application Support/RawTherapee/cache" From 081c4eedeebf2ba620d316cafed6dbad5c3915be Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 2 Feb 2020 01:01:51 -0800 Subject: [PATCH 5/9] macOS: use ${app} to call binary from exec-loader --- tools/osx/executable_loader.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/osx/executable_loader.in b/tools/osx/executable_loader.in index a10e88265..8e9a9b230 100644 --- a/tools/osx/executable_loader.in +++ b/tools/osx/executable_loader.in @@ -1,6 +1,6 @@ #!/bin/sh -# GIMP has this next line regarding raising the open-number-of-files limit: +# GIMP has this next line regarding raising the number-of-open-files limit: ulimit -n 7000 cd "$(dirname "$0")" || exit 1 @@ -30,4 +30,4 @@ esac AppleLocale=`defaults read -g AppleLocale` export LANG=${AppleLocale%@*}.UTF-8 -exec "${cwd}/bin/rawtherapee-bin" "$@" +exec "${app}/Contents/MacOS/bin/rawtherapee-bin" "$@" From 10b6171f6323ca06743a9c0864b10a2cb03bb6c1 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 2 Feb 2020 01:10:45 -0800 Subject: [PATCH 6/9] macOS: fix a ditto statement --- tools/osx/macosx_bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 36b650f3b..02a85564e 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -274,7 +274,7 @@ function CreateDmg { local srcDir="$(mktemp -dt $$)" msg "Preparing disk image sources at ${srcDir}:" - ditto -R "${APP}" "${srcDir}" + ditto "${APP}" "${srcDir}" ditto AboutThisBuild.txt "${srcDir}" ln -s /Applications "${srcDir}" From 49e93d27b31fab18f9e47867c6ccfc9bff53a766 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 2 Feb 2020 01:45:38 -0800 Subject: [PATCH 7/9] macOS: use DYLD_FALLBACK_LIBRARY_PATH --- tools/osx/executable_loader.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/osx/executable_loader.in b/tools/osx/executable_loader.in index 8e9a9b230..5ee609043 100644 --- a/tools/osx/executable_loader.in +++ b/tools/osx/executable_loader.in @@ -11,7 +11,7 @@ lib="${app}/Contents/Frameworks" resources="${app}/Contents/Resources" etc="${resources}/etc" export XDG_DATA_DIRS="${resources}/share" -export DYLD_LIBRARY_PATH="${lib}" +export DYLD_FALLBACK_LIBRARY_PATH="${lib}" export GTK_PATH="${lib}/gtk-3.0/3.0.0" export XDG_DATA_HOME="${resources}/share" export GSETTINGS_SCHEMA_DIR="${resources}/share/glib-2.0/schemas" From 17b7783e727930f74abeffc3b997f58cae0f28d9 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 2 Feb 2020 04:25:48 -0800 Subject: [PATCH 8/9] macOS: correct copy bundle to temp dir for dmg. --- tools/osx/macosx_bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 02a85564e..44f351080 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -274,7 +274,7 @@ function CreateDmg { local srcDir="$(mktemp -dt $$)" msg "Preparing disk image sources at ${srcDir}:" - ditto "${APP}" "${srcDir}" + cp -R "${APP}" "${srcDir}" ditto AboutThisBuild.txt "${srcDir}" ln -s /Applications "${srcDir}" From efd28baa3a440e5b110c14e8cc3f9f629df79f3c Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 2 Feb 2020 06:02:49 -0800 Subject: [PATCH 9/9] macOS: specify certain library destinations --- tools/osx/macosx_bundle.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 44f351080..f21915cab 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -163,7 +163,7 @@ ditto ${LOCAL_PREFIX}/local/lib/libjpeg.62.dylib "${CONTENTS}/Frameworks/libjpeg # Copy libexpat into the app bundle (which is keg-only) -if [[ -d /usr/local/Cellar/expat ]]; then ditto /usr/local/Cellar/expat/*/lib/libexpat.1.dylib "${CONTENTS}/Frameworks"; else ditto "${EXPATLIB}" "${CONTENTS}/Frameworks"; fi +if [[ -d /usr/local/Cellar/expat ]]; then ditto /usr/local/Cellar/expat/*/lib/libexpat.1.dylib "${CONTENTS}/Frameworks"; else ditto "${EXPATLIB}" "${CONTENTS}/Frameworks/libexpat.1.dylib"; fi # Copy libz into the app bundle ditto ${LOCAL_PREFIX}/local/lib/libz.1.dylib "${CONTENTS}/Frameworks" @@ -176,7 +176,7 @@ mkdir -p "${RESOURCES}/share/lensfun" ditto ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" # Copy liblensfun to Frameworks -ditto ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks" +ditto ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks/liblensfun.2.dylib" # Copy libomp to Frameworks ditto ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks"