mac: simplify bundle structure

This commit is contained in:
Richard Barber
2020-02-15 15:56:20 -08:00
parent 3349aa041a
commit 9d24423c77
8 changed files with 88 additions and 75 deletions

View File

@@ -13,3 +13,7 @@ Build flags: ${CXX_FLAGS}
Link flags: ${LFLAGS}
OpenMP support: ${OPTION_OMP}
MMAP support: ${WITH_MYFILE_MMAP}
Build OS: ${BUILDINFO_OS}
Build date: ${BUILDINFO_DATE} ZULU
Build epoch: ${BUILDINFO_EPOCH}
Build UUID: ${BUILDINFO_UUID}

View File

@@ -64,6 +64,11 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
set(GIT_NUMERIC_VERSION_BS "${GIT_NUMERIC_VERSION_BS}.${GIT_COMMITS_SINCE_TAG}")
endif()
execute_process(COMMAND uname -mrs OUTPUT_VARIABLE BUILDINFO_OS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND date -Ru OUTPUT_VARIABLE BUILDINFO_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND date +%s OUTPUT_VARIABLE BUILDINFO_EPOCH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND uuidgen COMMAND tr "A-Z" "a-z" OUTPUT_VARIABLE BUILDINFO_UUID OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Git checkout information:")
message(STATUS " Commit description: ${GIT_DESCRIBE}")
message(STATUS " Branch: ${GIT_BRANCH}")
@@ -72,6 +77,11 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
message(STATUS " Commits since tag: ${GIT_COMMITS_SINCE_TAG}")
message(STATUS " Commits since branch: ${GIT_COMMITS_SINCE_BRANCH}")
message(STATUS " Version (unreliable): ${GIT_NUMERIC_VERSION_BS}")
message(STATUS "Build information:")
message(STATUS " Build OS: ${BUILDINFO_OS}")
message(STATUS " Build date: ${BUILDINFO_DATE}")
message(STATUS " Epoch: ${BUILDINFO_EPOCH}")
message(STATUS " UUID: ${BUILDINFO_UUID}")
if(NOT DEFINED CACHE_NAME_SUFFIX)
set(CACHE_NAME_SUFFIX "${GIT_DESCRIBE}")

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>RawTherapee-bin</string>
<key>CFBundleIdentifier</key>
<string>com.rawtherapee.rawtherapee</string>
</dict>
</plist>

View File

@@ -2,6 +2,35 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSEnvironment</key>
<dict>
<key>XDG_DATA_DIRS</key>
<string>/Applications/RawTherapee.app/Contents/Resources/share</string>
<key>DYLD_FALLBACK_LIBRARY_PATH</key>
<string>/Applications/RawTherapee.app/Contents/Frameworks</string>
<key>GTK_PATH</key>
<string>/Applications/RawTherapee.app/Contents/Frameworks</string>
<key>GTK_IM_MODULE_FILE</key>
<string>/Applications/RawTherapee.app/Contents/Resources/etc/gtk-3.0/gtk.immodules</string>
<key>XDG_DATA_HOME</key>
<string>/Applications/RawTherapee.app/Contents/Resources/share</string>
<key>GSETTINGS_SCHEMA_DIR</key>
<string>/Applications/RawTherapee.app/Contents/Resources/share/glib-2.0/schemas</string>
<key>GDK_PIXBUF_MODULE_FILE</key>
<string>/Applications/RawTherapee.app/Contents/Resources/etc/gtk-3.0/gdk-pixbuf.loaders</string>
<key>GDK_PIXBUF_MODULEDIR</key>
<string>/Applications/RawTherapee.app/Contents/Frameworks</string>
<key>FONTCONFIG_PATH</key>
<string>/Applications/RawTherapee.app/Contents/Resources/etc/fonts</string>
<key>LIBDIR</key>
<string>/Applications/RawTherapee.app/Contents/Frameworks</string>
<key>DATADIR</key>
<string>/Applications/RawTherapee.app/Contents/Resources</string>
<key>GDK_RENDERING</key>
<string>similar</string>
<key>GTK_OVERLAY_SCROLLING</key>
<string>0</string>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
@@ -115,7 +144,7 @@
<key>CFBundleIconFile</key>
<string>rawtherapee.icns</string>
<key>CFBundleIdentifier</key>
<string>com.rawtherapee.rawtherapee</string>
<string>com.rawtherapee.RawTherapee</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@@ -1,33 +0,0 @@
#!/bin/sh
# GIMP has this next line regarding raising the number-of-open-files limit:
ulimit -n 7000
cd "$(dirname "$0")" || exit 1
cwd="$(pwd)"
app="/Applications/RawTherapee.app"
lib="${app}/Contents/Frameworks"
resources="${app}/Contents/Resources"
etc="${resources}/etc"
export XDG_DATA_DIRS="${resources}/share"
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"
export GDK_PIXBUF_MODULE_FILE="${etc}/gtk-3.0/gdk-pixbuf.loaders"
export GDK_PIXBUF_MODULEDIR="${lib}"
export RT_SETTINGS="${HOME}/Library/Application Support/RawTherapee/config"
export RT_CACHE="${HOME}/Library/Application Support/RawTherapee/cache"
# Strip out system argument
case "$1" in
-psn_*) shift ;;
esac
# Prevent crash when directory name contains special characters
AppleLocale=`defaults read -g AppleLocale`
export LANG=${AppleLocale%@*}.UTF-8
exec "${app}/Contents/MacOS/bin/rawtherapee-bin" "$@"

View File

@@ -50,6 +50,22 @@ function ModifyInstallNames {
done
}
function ModifyInstallNames {
find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee-cli|rawtherapee|.*\.(dylib|so))' | while read -r x; do
msg "Modifying install names: ${x}"
{
# id
if [ ${x:(-6)} == ".dylib" ] || [ f${x:(-3)} == ".so" ]; then
echo " install_name_tool -id '@rpath/$(basename "${x}")' '${x}'"
fi
GetDependencies "${x}" | while read -r y
do
echo " install_name_tool -change '${y}' '@rpath/$(basename "${y}")' '${x}'"
done
} | bash -v
done
}
# Source check
if [[ ! -d "${CMAKE_BUILD_TYPE}" ]]; then
msgError "${PWD}/${CMAKE_BUILD_TYPE} folder does not exist. Please execute 'make install' first."
@@ -132,9 +148,16 @@ echo "Bundle date: $(date -Ru) ZULU" >> Resources/AboutThisBuild.txt
echo "Bundle epoch: $(date +%s)" >> Resources/AboutThisBuild.txt
echo "Bundle UUID: $(uuidgen)" >> Resources/AboutThisBuild.txt
echo "\n--------\n" >> "${CMAKE_BUILD_TYPE}"/Resources/AboutThisBuild.txt
echo "Bundle system: $(sysctl -n machdep.cpu.brand_string)" >> "${CMAKE_BUILD_TYPE}"/Resources/AboutThisBuild.txt
echo "Bundle OS: $(sw_vers -productName) $(sw_vers -productVersion) $(sw_vers -buildVersion) $(uname -mrs)" >> "${CMAKE_BUILD_TYPE}"/Resources/AboutThisBuild.txt
echo "Bundle date: $(date -Ru) ZULU" >> "${CMAKE_BUILD_TYPE}"/Resources/AboutThisBuild.txt
echo "Bundle epoch: $(date +%s)" >> "${CMAKE_BUILD_TYPE}"/Resources/AboutThisBuild.txt
echo "Bundle UUID: $(uuidgen)" >> "${CMAKE_BUILD_TYPE}"/Resources/AboutThisBuild.txt
msg "Copying release files:"
ditto "${CMAKE_BUILD_TYPE}/MacOS" "${MACOS}"
ditto "Resources" "${RESOURCES}"
ditto "${CMAKE_BUILD_TYPE}/Resources" "${RESOURCES}"
# Copy the Lensfun database into the app bundle
mkdir -p "${RESOURCES}/share/lensfun"
@@ -152,6 +175,9 @@ CheckLink "${EXECUTABLE}"
# dylib install names
ModifyInstallNames
# dylib install names
ModifyInstallNames
# Copy libjpeg-turbo ("62") into the app bundle
ditto ${LOCAL_PREFIX}/local/lib/libjpeg.62.dylib "${CONTENTS}/Frameworks/libjpeg.62.dylib"
@@ -193,11 +219,6 @@ ditto "${LIB}"/gtk-3.0/3*/immodules/*.{dylib,so} "${LIB}"
rm -r "${LIB}"/gtk-3.0
rm -r "${LIB}"/gdk-pixbuf-2.0
msg "Build glib database:"
mkdir -p ${RESOURCES}/share/glib-2.0
ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/glib-2.0/schemas
"${LOCAL_PREFIX}/local/bin/glib-compile-schemas" "${RESOURCES}/share/glib-2.0/schemas"
# GTK+3 themes
msg "Copy GTK+3 theme and icon resources:"
ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Mac/gtk-3.0/gtk-keys.css

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>

View File

@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>com.rawtherapee.rawtherapee</string>
<key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
<array>
<string>&quot;/&quot;</string>
</array>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
</dict>
</plist>
<dict>
<key>application-identifier</key>
<string>com.rawtherapee.RawTherapee</string>
<key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
<array>
<string>/</string>
</array>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
</dict>
</plist>