Merge pull request #5644 from Benitoite/patch-22

mac: simplifies bundle structure, bundle packaging fixes
This commit is contained in:
Beep6581
2020-02-25 09:05:20 +01:00
committed by GitHub
17 changed files with 524 additions and 351 deletions

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

@@ -1,7 +1,45 @@
<?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>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>GTK_MODULES</key>
<string>/Applications/RawTherapee.app/Contents/Frameworks/im-quartz.so</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>
<key>GDK_NATIVE_WINDOWS</key>
<string>1</string>
</dict>
<key>ATSApplicationFontsPath</key>
<string>etc/fonts</string>
<key>LSMultipleInstancesProhibited</key>
<true />
<key>LSMinimumSystemVersion</key>
<string>@minimum_macos_version@</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
@@ -21,7 +59,7 @@
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSIsAppleDefaultForType</key>
<true/>
<true />
<key>LSItemContentTypes</key>
<array>
<string>com.rawtherapee.pp3</string>
@@ -115,7 +153,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>
@@ -133,7 +171,7 @@
<string>@arch@</string>
</array>
<key>NSHighResolutionCapable</key>
<true/>
<true />
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2004-2010 Gábor Horváth, 2010-2017 RawTherapee Development Team</string>
<key>UTExportedTypeDeclarations</key>
@@ -164,4 +202,4 @@
</dict>
</array>
</dict>
</plist>
</plist>

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

@@ -1,30 +0,0 @@
diff --git a/lib/iconv.c b/lib/iconv.c
index 3785296..24a0f07 100644
--- a/lib/iconv.c
+++ b/lib/iconv.c
@@ -607,4 +607,25 @@ strong_alias (libiconv, iconv)
strong_alias (libiconv_close, iconv_close)
#endif
+#undef iconv_open
+#undef iconv
+#undef iconv_close
+
+LIBICONV_DLL_EXPORTED iconv_t iconv_open (const char* tocode, const char* fromcode)
+{
+ return libiconv_open(tocode, fromcode);
+}
+
+LIBICONV_DLL_EXPORTED size_t iconv (iconv_t icd,
+ ICONV_CONST char * * inbuf, size_t *inbytesleft,
+ char * * outbuf, size_t *outbytesleft)
+{
+ return libiconv(icd, inbuf, inbytesleft, outbuf, outbytesleft);
+}
+
+LIBICONV_DLL_EXPORTED int iconv_close (iconv_t icd)
+{
+ return libiconv_close(icd);
+}
+
#endif

View File

@@ -1,30 +0,0 @@
diff --git a/lib/iconv.c b/lib/iconv.c
index 31853a7..630a498 100644
--- a/lib/iconv.c
+++ b/lib/iconv.c
@@ -611,4 +611,25 @@ strong_alias (libiconv, iconv)
strong_alias (libiconv_close, iconv_close)
#endif
+#undef iconv_open
+#undef iconv
+#undef iconv_close
+
+LIBICONV_DLL_EXPORTED iconv_t iconv_open (const char* tocode, const char* fromcode)
+{
+ return libiconv_open(tocode, fromcode);
+}
+
+LIBICONV_DLL_EXPORTED size_t iconv (iconv_t icd,
+ ICONV_CONST char * * inbuf, size_t *inbytesleft,
+ char * * outbuf, size_t *outbytesleft)
+{
+ return libiconv(icd, inbuf, inbytesleft, outbuf, outbytesleft);
+}
+
+LIBICONV_DLL_EXPORTED int iconv_close (iconv_t icd)
+{
+ return libiconv_close(icd);
+}
+
#endif

View File

@@ -34,27 +34,43 @@ function CheckLink {
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
install_name_tool -id /Applications/"${LIB}"/$(basename ${x}) ${x}
fi
GetDependencies "${x}" | while read -r y
do
install_name_tool -change ${y} /Applications/"${LIB}"/$(basename ${y}) ${x}
done
} | bash -v
done
}
# Source check
if [[ ! -d "${CMAKE_BUILD_TYPE}" ]]; then
if [[ ! -d $CMAKE_BUILD_TYPE ]]; then
msgError "${PWD}/${CMAKE_BUILD_TYPE} folder does not exist. Please execute 'make install' first."
exit 1
fi
# Update project version
if [[ -x "$(which git)" && -d "${PROJECT_SOURCE_DIR}/.git" ]]; then
if [[ -x $(which git) && -d $PROJECT_SOURCE_DIR/.git ]]; then
### This section is copied from tools/generateReleaseInfo
# Get version description.
# Depending on whether you checked out a branch (dev) or a tag (release),
# "git describe" will return "5.0-gtk2-2-g12345678" or "5.0-gtk2", respectively.
gitDescribe="$(git describe --tags --always)"
# Apple requires a numeric version of the form n.n.n
# https://goo.gl/eWDQv6
# Get number of commits since tagging. This is what gitDescribe uses.
# Works when checking out branch, tag or commit.
gitCommitsSinceTag="$(git rev-list --count HEAD --not $(git tag --merged HEAD))"
# Create numeric version.
# This version is nonsense, either don't use it at all or use it only where you have no other choice, e.g. Inno Setup's VersionInfoVersion.
# Strip everything after hyphen, e.g. "5.0-gtk2" -> "5.0", "5.1-rc1" -> "5.1" (ergo BS).
@@ -65,14 +81,13 @@ if [[ -x "$(which git)" && -d "${PROJECT_SOURCE_DIR}/.git" ]]; then
gitVersionNumericBS="${gitVersionNumericBS}.${gitCommitsSinceTag}" # Remove everything until after first hyphen: 5.0
fi
### Copy end.
PROJECT_FULL_VERSION="$gitDescribe"
PROJECT_VERSION="$gitVersionNumericBS"
fi
MINIMUM_SYSTEM_VERSION="$(otool -l "${CMAKE_BUILD_TYPE}"/MacOS/rawtherapee | grep -A2 'LC_VERSION_MIN_MACOSX' | awk '$1 ~ /version/ { printf $2 }')"
if [[ -z "${MINIMUM_SYSTEM_VERSION}" ]]; then
if [[ -z $MINIMUM_SYSTEM_VERSION ]]; then
MINIMUM_SYSTEM_VERSION="$(sw_vers -productVersion | cut -d. -f-2)"
fi
@@ -89,9 +104,33 @@ GTK_PREFIX: ${GTK_PREFIX}
PWD: ${PWD}
__EOS__
LOCAL_PREFIX="$(cmake .. -LA -N | grep "LOCAL_PREFIX" | cut -d "=" -f2)"
EXPATLIB="$(cmake .. -LA -N | grep "pkgcfg_lib_EXPAT_expat" | cut -d "=" -f2)"
minimum_macos_version=${MINIMUM_SYSTEM_VERSION}
# Retreive cached values from cmake
#In: LOCAL_PREFIX:STRING=/opt
#Out: /opt
LOCAL_PREFIX="$(cmake .. -L -N | grep LOCAL_PREFIX)"; LOCAL_PREFIX="${LOCAL_PREFIX#*=}"
#In: pkgcfg_lib_EXPAT_expat:FILEPATH=/opt/local/lib/libexpat.dylib
#Out: /opt/local/lib/libexpat.dylib
EXPATLIB="$(cmake .. -LA -N | grep pkgcfg_lib_EXPAT_expat)"; pkgcfg_lib_EXPAT_expat="${pkgcfg_lib_EXPAT_expat#*=}"
#In: CODESIGNID:STRING=Developer ID Application: Doctor Who (1234567890)
#Out: Developer ID Application: Doctor Who (1234567890)
CODESIGNID="$(cmake .. -L -N | grep CODESIGNID)"; CODESIGNID="${CODESIGNID#*=}"
#In: NOTARY:STRING=--username drwho@bbc.com --password abcd-efgh-hijk-lmno
#Out: --username drwho@bbc.com --password abcd-efgh-hijk-lmno
NOTARY="$(cmake .. -L -N | grep NOTARY)"; NOTARY="${NOTARY#*=}"
# In: FANCY_DMG:BOOL=ON
# Out: ON
FANCY_DMG="$(cmake .. -L -N | grep FANCY_DMG)"; FANCY_DMG="${FANCY_DMG#*=}"
if [[ -n $FANCY_DMG ]]; then
echo "Fancy .dmg build is ON."
fi
APP="${PROJECT_NAME}.app"
CONTENTS="${APP}/Contents"
RESOURCES="${CONTENTS}/Resources"
@@ -102,17 +141,27 @@ EXECUTABLE="${MACOS}/rawtherapee"
GDK_PREFIX="${LOCAL_PREFIX}/local/"
msg "Removing old files:"
rm -rf "${APP}" "${PROJECT_NAME}_*.dmg" "*zip"
rm -rf "${APP}" *.dmg *.zip
msg "Creating bundle container:"
install -d "${RESOURCES}" \
"${MACOS}" \
"${LIB}" \
"${ETC}"
install -d "${RESOURCES}"
install -d "${MACOS}"
install -d "${LIB}"
install -d "${ETC}"
msg "Copying release files:"
msg "Copying binary executable files."
ditto "${CMAKE_BUILD_TYPE}/MacOS" "${MACOS}"
ditto "Resources" "${RESOURCES}"
msg "Copying Resources directory."
cp AboutThisBuild.txt "${RESOURCES}"
ditto "${CMAKE_BUILD_TYPE}/Resources" "${RESOURCES}"
echo "\n--------\n" >> "${RESOURCES}/AboutThisBuild.txt"
echo "Bundle system: $(sysctl -n machdep.cpu.brand_string)" >> "${RESOURCES}/AboutThisBuild.txt"
echo "Bundle OS: $(sw_vers -productName) $(sw_vers -productVersion) $(sw_vers -buildVersion) $(uname -mrs)" >> "${RESOURCES}/AboutThisBuild.txt"
echo "Bundle date: $(date -Ru) UTC" >> "${RESOURCES}/AboutThisBuild.txt"
echo "Bundle epoch: $(date +%s)" >> "${RESOURCES}/AboutThisBuild.txt"
echo "Bundle UUID: $(uuidgen|tr 'A-Z' 'a-z')" >> "${RESOURCES}/AboutThisBuild.txt"
# Copy the Lensfun database into the app bundle
mkdir -p "${RESOURCES}/share/lensfun"
@@ -124,9 +173,12 @@ ditto ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks/lible
# Copy libomp to Frameworks
ditto ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks"
msg "Copying dependencies from ${GTK_PREFIX}:"
msg "Copying dependencies from ${GTK_PREFIX}."
CheckLink "${EXECUTABLE}"
# 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"
@@ -168,11 +220,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
@@ -189,32 +236,15 @@ 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"
# Install names
find -E "${CONTENTS}" -type f -regex '.*/(rawtherapee-cli|rawtherapee|.*\.(dylib|so))' | while read -r x; do
msg "Modifying install names: ${x}"
{
# id
case ${x} in *.dylib) echo " install_name_tool -id '@rpath/$(basename "${x}")' '${x}'";; esac
# names
GetDependencies "${x}" | while read -r y; do
echo " install_name_tool -change '${y}' '@rpath/$(basename "${y}")' '${x}'"
done
} | bash -v
done
# fix @rpath in Frameworks
msg "Registering @rpath in Frameworks folder:"
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
# pixbuf loaders & immodules
msg "Build GTK3 databases:"
"${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"
sed -i "" -e "s|/opt/local/|/Applications/RawTherapee.app/Contents/Frameworks/|" "${ETC}/gtk-3.0/gtk.immodules"
# Install names
ModifyInstallNames
# Mime directory
msg "Copying shared files from ${GTK_PREFIX}:"
@@ -222,65 +252,70 @@ ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/mime
msg "Installing required application bundle files:"
PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}/tools/osx"
ditto "${PROJECT_SOURCE_DIR}/build/Resources" "${RESOURCES}"
# Executable loader
# Note: executable is renamed to 'rawtherapee-bin'.
mkdir "${MACOS}/bin"
ditto "${MACOS}/rawtherapee" "${MACOS}/bin/rawtherapee-bin"
rm "${MACOS}/rawtherapee"
install -m 0755 "${PROJECT_SOURCE_DATA_DIR}/executable_loader.in" "${MACOS}/rawtherapee"
ditto "${CMAKE_BUILD_TYPE}/Resources" "${RESOURCES}"
ditto "${PROJECT_SOURCE_DIR}/rtdata/fonts" "${ETC}/fonts"
# App bundle resources
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 xml1 "${CONTENTS}/Info.plist"
plutil -convert xml1 "${CONTENTS}/MacOS/bin/Info.plist"
update-mime-database -V "${CONTENTS}/Resources/share/mime"
"${CONTENTS}/Info.plist"
plutil -convert binary1 "${CONTENTS}/Info.plist"
update-mime-database -V "${RESOURCES}/share/mime"
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"
# Append an LC_RPATH
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
msg "Registering @rpath into the main executable."
install_name_tool -add_rpath /Applications/"${LIB}" "${EXECUTABLE}"
# Sign the app
msg "Codesigning:"
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 xml1 "${CONTENTS}/Entitlements.plist"
install -m 0644 "${PROJECT_SOURCE_DATA_DIR}/rt-bin.entitlements" "${CONTENTS}/MacOS/bin/Entitlements.plist"
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}"
ModifyInstallNames
# fix @rpath in Frameworks
msg "Registering @rpath in Frameworks folder."
for frameworklibs in "${LIB}"/*{dylib,so}; do
install_name_tool -delete_rpath ${LOCAL_PREFIX}/local/lib "${frameworklibs}"
install_name_tool -add_rpath /Applications/"${LIB}" "${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}"
install_name_tool -delete_rpath RawTherapee.app/Contents/Frameworks "${EXECUTABLE}"-cli
install_name_tool -add_rpath @executable_path "${EXECUTABLE}"-cli
# Codesign the app
if [[ -n $CODESIGNID ]]; then
msg "Codesigning Application."
install -m 0644 "${PROJECT_SOURCE_DATA_DIR}"/rt.entitlements "${CMAKE_BUILD_TYPE}"/rt.entitlements
plutil -convert binary1 "${CMAKE_BUILD_TYPE}"/rt.entitlements
mv "${EXECUTABLE}"-cli "${LIB}"
for frameworklibs in "${LIB}"/*; do
codesign -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee --force --verbose -o runtime --timestamp "${frameworklibs}"
done
codesign --timestamp --strict -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee -o runtime --entitlements "${CMAKE_BUILD_TYPE}"/rt.entitlements "${APP}"
spctl -a -vvvv "${APP}"
fi
# Notarize the app
NOTARY="$(cmake .. -LA -N | grep "NOTARY" | cut -d "=" -f2)"
if ! test -z "$NOTARY" ; then
if [[ -n $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
sleep 15
while :
do
do
fullstatus=`xcrun altool --notarization-info "$uuid" ${NOTARY} 2>&1` # get the status
status1=`echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }'`
if [ "$status1" = "success" ]; then
if [[ $status1 = "success" ]]; then
xcrun stapler staple *app # staple the ticket
xcrun stapler validate -v *app
echo "Notarization success"
break
elif [ "$status1" = "in" ]; then
elif [[ $status1 = "in" ]]; then
echo "Notarization still in progress, sleeping for 15 seconds and trying again"
sleep 15
else
@@ -293,38 +328,55 @@ fi
function CreateDmg {
local srcDir="$(mktemp -dt $$)"
msg "Preparing disk image sources at ${srcDir}:"
cp -R "${APP}" "${srcDir}"
ditto AboutThisBuild.txt "${srcDir}"
cp "${RESOURCES}"/share/LICENSE.txt "${srcDir}"
ln -s /Applications "${srcDir}"
# Web bookmarks
function CreateWebloc {
defaults write "${srcDir}/$1" URL "$2"
mv "${srcDir}/$1".{plist,webloc}
}
CreateWebloc 'Website' 'http://www.rawtherapee.com/'
CreateWebloc 'Manual' 'http://rawpedia.rawtherapee.com/'
CreateWebloc 'Website' 'https://www.rawtherapee.com/'
CreateWebloc 'Documentation' 'https://rawpedia.rawtherapee.com/'
CreateWebloc 'Forum' 'https://discuss.pixls.us/c/software/rawtherapee'
CreateWebloc 'Report Bug' 'https://github.com/Beep6581/RawTherapee/issues/new'
# Disk image name
dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}"
lower_build_type="$(tr '[:upper:]' '[:lower:]' <<< "$CMAKE_BUILD_TYPE")"
if [[ ${lower_build_type} != release ]]; then
if [[ $lower_build_type != release ]]; then
dmg_name="${dmg_name}_${lower_build_type}"
fi
msg "Creating disk image:"
hdiutil create -format UDBZ -fs HFS+ -srcdir "${srcDir}" -volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" "${dmg_name}.dmg"
if [[ ! -z $FANCY_DMG ]]; then
echo "Building Fancy .dmg"
mkdir "${srcDir}/.background"
cp -R "${PROJECT_SOURCE_DATA_DIR}/rtdmg.icns" "${srcDir}/.VolumeIcon.icns"
cp -R "${PROJECT_SOURCE_DATA_DIR}/rtdmg-bkgd.png" "${srcDir}/.background/background.png"
SetFile -c incC "${srcDir}/.VolumeIcon.icns"
create-dmg "${dmg_name}.dmg" "${srcDir}" \
--volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" \
--volicon "${srcDir}/.VolumeIcon.icns" \
--sandbox-safe \
--no-internet-enable \
--eula LICENSE.txt \
--hdiutil-verbose \
--rez /Library/Developer/CommandLineTools/usr/bin/Rez
else
hdiutil create -format UDBZ -fs HFS+ -srcdir "${srcDir}" -volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" "${dmg_name}.dmg"
fi
# Sign disk image
if ! test -z "$CODESIGNID" ; then
codesign --deep --force -v -s "${CODESIGNID}" --timestamp "${dmg_name}.dmg"
fi
if [[ -n $CODESIGNID ]]; then
codesign --deep --force -v -s "${CODESIGNID}" --timestamp "${dmg_name}.dmg"
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 }'`
@@ -334,31 +386,30 @@ function CreateDmg {
do
fullstatus=`xcrun altool --notarization-info "$uuid" ${NOTARY} 2>&1` # get the status
status1=`echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }'`
if [ "$status1" = "success" ]; then
if [[ $status1 = "success" ]]; then
xcrun stapler staple "${dmg_name}.dmg" # staple the ticket
xcrun stapler validate -v "${dmg_name}.dmg"
echo "dmg Notarization success"
break
elif [ "$status1" = "in" ]; then
elif [[ $status1 = "in" ]]; then
echo "dmg Notarization still in progress, sleeping for 15 seconds and trying again"
sleep 15
else
echo "dmg Notarization failed fullstatus below"
echo "$fullstatus"
exit 1
exit 1
fi
done
fi
# Zip disk image for redistribution
# Zip disk image for redistribution
msg "Zipping disk image for redistribution:"
zip "${dmg_name}.zip" "${dmg_name}.dmg" AboutThisBuild.txt
rm "${dmg_name}.dmg"
msg "Removing disk image caches:"
rm -rf "${srcDir}"
}
CreateDmg
msg "Finishing build:"
echo "Script complete."
#
# TODO filter out the benign errors

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,19 @@
<?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>
<string>com.rawtherapee.RawTherapee</string>
<key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
<array>
<string>&quot;/&quot;</string>
<string>/</string>
</array>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<true />
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<true />
<key>com.apple.security.app-sandbox</key>
<true/>
<true />
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<true />
</dict>
</plist>
</plist>

BIN
tools/osx/rtdmg-bkgd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

BIN
tools/osx/rtdmg.icns Normal file

Binary file not shown.