Merge branch 'dev' into metadata-exiv2

This commit is contained in:
Lawrence Lee
2023-02-05 12:29:58 -08:00
278 changed files with 74278 additions and 13534 deletions

46
tools/findorphans.py Executable file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env python3
import clang.cindex
import subprocess
import sys
index = clang.cindex.Index.create()
procevents = index.parse('rtengine/procevents.h',args=['-x', 'c++'])
if(1):
for chld in procevents.cursor.get_children():
if(chld.displayname == 'rtengine'):
for c in chld.get_children():
if(c.displayname == 'ProcEventCode'):
for pec in c.get_children():
#print(pec.kind, pec.displayname, pec.enum_value)
#print(pec.displayname, file=sys.stderr)
grp1 = subprocess.Popen(('grep', '-ro', '--exclude=procevents.h', '--exclude-dir=.git', pec.displayname), stdout=subprocess.PIPE)
wcr1 = subprocess.check_output(('wc', '-l'), stdin=grp1.stdout)
grp1.wait()
grp2 = subprocess.Popen(('grep', '-ro', '--exclude=procevents.h', '--exclude=refreshmap.cc', '--exclude-dir=.git', pec.displayname), stdout=subprocess.PIPE)
wcr2 = subprocess.check_output(('wc', '-l'), stdin=grp2.stdout)
grp2.wait()
print(pec.enum_value, pec.displayname,int(wcr1), int(wcr2))
with open('rtdata/languages/default', 'r') as deflang:
for line in deflang:
if(line[0] == '#'):
continue
if(line[0:2] == '//'):
continue
if(line[0:2] == '/*'):
#our language files support comment blocks?????????????????????????????
#or is this commented block bogus?
continue
if(line[0:2] == '*/'):
continue
else:
stringid = line.split(';')[0]
if(stringid.startswith('HISTORY_MSG')):
continue
#print(stringid, file=sys.stderr)
grp1 = subprocess.Popen(('grep', '-ro', '--exclude-dir=languages', '--exclude-dir=.git', stringid), stdout=subprocess.PIPE)
wcr1 = subprocess.check_output(('wc', '-l'), stdin=grp1.stdout)
grp1.wait()
print(stringid, int(wcr1))

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# By Maciej Dworak
# Version 2018-07-21
# Version 2021-06-04
# Compatible with Inkscape 1.0
# This script generates PNG icons from SVG files using Inkscape.
# If pngquant is installed, it will automatically use it to compress the PNGs.
#
@@ -96,17 +97,17 @@ printf '%s\n' "Output folder: ${outDir}" ""
convertSvg() {
if [[ ${OSTYPE^^} = "MSYS" ]]; then
"/c/Program Files/Inkscape/inkscape.exe" \
--without-gui \
--export-area-page \
--export-background-opacity="0" \
--export-png="$1" \
--export-type=png \
--export-filename="$1" \
"$2"
else
inkscape \
--without-gui \
--export-area-page \
--export-background-opacity="0" \
--export-png="$1" \
--export-type=png \
--export-filename="$1" \
"$2"
fi

View File

@@ -69,6 +69,7 @@ dos2unix default 2>/dev/null
# -Irl -m1
# Dynamically built keys like HISTORY_MSG_1 can't be grepped in the code,
# so it renames KEY_1-KEY_9 to KEY_ so that they can be grepped and therefore ignored.
# See RAWParams::BayerSensor::getMethodStrings
t1="$(date +%s)"
printf '%s\n' 'Matching keys in "default" against .cc and .h files' 'Unmatched keys follow:'
unset delLines
@@ -84,11 +85,25 @@ done < <( \
-e "^(#|$)|TP_RAW_2PASS" \
-e "^(#|$)|TP_RAW_3PASSBEST" \
-e "^(#|$)|TP_RAW_4PASS" \
-e "^(#|$)|TP_RAW_AMAZE" \
-e "^(#|$)|TP_RAW_AMAZEBILINEAR" \
-e "^(#|$)|TP_RAW_AMAZEVNG4" \
-e "^(#|$)|TP_RAW_DCBVNG4" \
-e "^(#|$)|TP_RAW_MONO" \
-e "^(#|$)|TP_RAW_NONE" \
-e "^(#|$)|TP_RAW_RCD" \
-e "^(#|$)|TP_RAW_RCDBILINEAR" \
-e "^(#|$)|TP_RAW_RCDVNG4" \
-e "^(#|$)|TP_RAW_DCB" \
-e "^(#|$)|TP_RAW_DCBBILINEAR" \
-e "^(#|$)|TP_RAW_DCBVNG4" \
-e "^(#|$)|TP_RAW_LMMSE" \
-e "^(#|$)|TP_RAW_IGV" \
-e "^(#|$)|TP_RAW_AHD" \
-e "^(#|$)|TP_RAW_EAHD" \
-e "^(#|$)|TP_RAW_HPHD" \
-e "^(#|$)|TP_RAW_VNG4" \
-e "^(#|$)|TP_RAW_FAST" \
-e "^(#|$)|TP_RAW_MONO" \
-e "^(#|$)|TP_RAW_PIXELSHIFT" \
-e "^(#|$)|TP_RAW_NONE" \
"default" | \
sed -e "s/EXTPROGTARGET_[0-9]*/EXTPROGTARGET_/" \
-e "s/FILEBROWSER_POPUPCOLORLABEL[0-9]*/FILEBROWSER_POPUPCOLORLABEL/" \

View File

@@ -0,0 +1,7 @@
To use the RawTherapee Application:
You must drag the app from the .dmg into the /Applications folder.
If you wish to use the Command-Line Interface:
An unsigned -cli is in the zip along with the .dmg.
You must install the app from the .dmg into /Applications and copy the -cli to your /usr/local/bin.
The -cli will load its libraries dynamically from the app in /Applications.

View File

@@ -3,16 +3,16 @@
<dict>
<key>LSEnvironment</key>
<dict>
<key>XDG_DATA_DIRS</key>
<key>XDG_CONFIG_DIRS</key>
<string>/Applications/RawTherapee.app/Contents/Resources/share/gtk-3.0</string>
<key>XDG_CONFIG_HOME</key>
<string>/Applications/RawTherapee.app/Contents/Resources/share</string>
<key>DYLD_FALLBACK_LIBRARY_PATH</key>
<string>/Applications/RawTherapee.app/Contents/Frameworks</string>
<key>XDG_DATA_DIRS</key>
<string>/Applications/RawTherapee.app/Contents/Resources/share/gtk-3.0</string>
<key>GTK_PATH</key>
<string>/Applications/RawTherapee.app/Contents/Frameworks</string>
<string>/Applications/RawTherapee.app/Contents/Resources/share/gtk-3.0</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>
@@ -21,8 +21,6 @@
<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>
@@ -31,17 +29,18 @@
<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>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>arm64</key>
<string>@minimum_arm64_version@</string>
<key>x86_64</key>
<string>@minimum_x86_64_version@</string>
</dict>
<key>CFBundleAllowMixedLocalizations</key>
<true />
<key>CFBundleDisplayName</key>
<string>RawTherapee</string>
<key>CFBundleDocumentTypes</key>
@@ -166,9 +165,10 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>@shortVersion@</string>
<key>LSExecutableArchitectures</key>
<key>LSArchitecturePriority</key>
<array>
<string>@arch@</string>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>NSHighResolutionCapable</key>
<true />
@@ -202,4 +202,4 @@
</dict>
</array>
</dict>
</plist>
</plist>

View File

@@ -0,0 +1 @@
configure_file(${PROJECT_SOURCE_DATA_DIR}/Info.plist.in ${CONTENTS}/Info.plist)

View File

@@ -24,7 +24,7 @@ function msgError {
}
function GetDependencies {
otool -L "$1" | awk 'NR >= 2 && $1 !~ /^(\/usr\/lib|\/System|@executable_path|@rpath)\// { print $1 }'
otool -L "$1" | awk 'NR >= 2 && $1 !~ /^(\/usr\/lib|\/System|@executable_path|@rpath)\// { print $1 }' 2>&1
}
function CheckLink {
@@ -40,11 +40,11 @@ function ModifyInstallNames {
{
# id
if [[ ${x:(-6)} == ".dylib" ]] || [[ f${x:(-3)} == ".so" ]]; then
install_name_tool -id /Applications/"${LIB}"/$(basename ${x}) ${x}
install_name_tool -id /Applications/"${LIB}"/$(basename ${x}) ${x} 2>/dev/null
fi
GetDependencies "${x}" | while read -r y
do
install_name_tool -change ${y} /Applications/"${LIB}"/$(basename ${y}) ${x}
install_name_tool -change ${y} /Applications/"${LIB}"/$(basename ${y}) ${x} 2>/dev/null
done
} | bash -v
done
@@ -86,12 +86,20 @@ if [[ -x $(which git) && -d $PROJECT_SOURCE_DIR/.git ]]; then
PROJECT_VERSION="$gitVersionNumericBS"
fi
#In: CMAKE_OSX_DEPLOYMENT_TARGET=11.3
#Out: 11.3
CMAKE_OSX_DEPLOYMENT_TARGET="$(cmake .. -L -N | grep CMAKE_OSX_DEPLOYMENT_TARGET)"; CMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET#*=}"
#In: CMAKE_OSX_ARCHITECTURES=x86_64
#Out: x86_64
CMAKE_OSX_ARCHITECTURES="$(cmake .. -L -N | grep CMAKE_OSX_ARCHITECTURES)"; CMAKE_OSX_ARCHITECTURES="${CMAKE_OSX_ARCHITECTURES#*=}"
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
MINIMUM_SYSTEM_VERSION="$(sw_vers -productVersion | cut -d. -f-2)"
MINIMUM_SYSTEM_VERSION=${CMAKE_OSX_DEPLOYMENT_TARGET}
fi
arch=x86_64
arch=${CMAKE_OSX_ARCHITECTURES}
cat <<__EOS__
PROJECT_NAME: ${PROJECT_NAME}
@@ -112,6 +120,13 @@ minimum_macos_version=${MINIMUM_SYSTEM_VERSION}
#Out: /opt
LOCAL_PREFIX="$(cmake .. -L -N | grep LOCAL_PREFIX)"; LOCAL_PREFIX="${LOCAL_PREFIX#*=}"
#In: OSX_UNIVERSAL_URL=https:// etc.
#Out: https:// etc.
UNIVERSAL_URL="$(cmake .. -L -N | grep OSX_UNIVERSAL_URL)"; UNIVERSAL_URL="${UNIVERSAL_URL#*=}"
if [[ -n $UNIVERSAL_URL ]]; then
echo "Universal app is ON. The URL is ${UNIVERSAL_URL}"
fi
#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#*=}"
@@ -131,6 +146,13 @@ if [[ -n $FANCY_DMG ]]; then
echo "Fancy .dmg build is ON."
fi
# In: OSX_NIGHTLY:BOOL=ON
# Out: ON
OSX_NIGHTLY="$(cmake .. -L -N | grep OSX_NIGHTLY)"; NIGHTLY="${OSX_NIGHTLY#*=}"
if [[ -n $NIGHTLY ]]; then
echo "Nightly/generically-named zip is ON."
fi
APP="${PROJECT_NAME}.app"
CONTENTS="${APP}/Contents"
RESOURCES="${CONTENTS}/Resources"
@@ -138,10 +160,10 @@ MACOS="${CONTENTS}/MacOS"
LIB="${CONTENTS}/Frameworks"
ETC="${RESOURCES}/etc"
EXECUTABLE="${MACOS}/rawtherapee"
GDK_PREFIX="${LOCAL_PREFIX}/local/"
GDK_PREFIX="${LOCAL_PREFIX}/"
msg "Removing old files:"
rm -rf "${APP}" *.dmg *.zip
rm -rf "${APP}" *.dmg *.zip *.app
msg "Creating bundle container:"
install -d "${RESOURCES}"
@@ -153,7 +175,7 @@ msg "Copying binary executable files."
ditto "${CMAKE_BUILD_TYPE}/MacOS" "${MACOS}"
msg "Copying Resources directory."
cp AboutThisBuild.txt "${RESOURCES}"
#cp AboutThisBuild.txt "${RESOURCES}"
ditto "${CMAKE_BUILD_TYPE}/Resources" "${RESOURCES}"
echo "\n--------\n" >> "${RESOURCES}/AboutThisBuild.txt"
@@ -165,144 +187,179 @@ echo "Bundle UUID: $(uuidgen|tr 'A-Z' 'a-z')" >> "${RESOURCES}/AboutThisBuild.
# Copy the Lensfun database into the app bundle
mkdir -p "${RESOURCES}/share/lensfun"
ditto ${LOCAL_PREFIX}/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun"
lensfunversion=$(pkg-config --modversion lensfun | cut -f3 -d'.')
if [ $lensfunversion = 95 ]
then
ditto ${LOCAL_PREFIX}/share/lensfun/version_2/* "${RESOURCES}/share/lensfun"
else
ditto ${LOCAL_PREFIX}/share/lensfun/version_1/* "${RESOURCES}/share/lensfun"
fi
# Copy liblensfun to Frameworks
ditto ${LOCAL_PREFIX}/local/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks/liblensfun.2.dylib"
ditto ${LOCAL_PREFIX}/lib/liblensfun.2.dylib "${CONTENTS}/Frameworks/liblensfun.2.dylib"
# Copy libomp to Frameworks
ditto ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks"
ditto ${LOCAL_PREFIX}/lib/libomp.dylib "${CONTENTS}/Frameworks"
msg "Copying dependencies from ${GTK_PREFIX}."
CheckLink "${EXECUTABLE}"
CheckLink "${EXECUTABLE}" 2>&1
# dylib install names
ModifyInstallNames
ModifyInstallNames 2>&1
# Copy libjpeg-turbo ("62") into the app bundle
ditto ${LOCAL_PREFIX}/local/lib/libjpeg.62.dylib "${CONTENTS}/Frameworks/libjpeg.62.dylib"
ditto ${LOCAL_PREFIX}/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 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"
ditto ${LOCAL_PREFIX}/lib/libz.1.dylib "${CONTENTS}/Frameworks"
# Copy libpng16 to the app bundle
ditto ${LOCAL_PREFIX}/local/lib/libpng16.16.dylib "${CONTENTS}/Frameworks/libpng16.16.dylib"
# Copy libpng12 & 16 to the app bundle
ditto ${LOCAL_PREFIX}/lib/libpng16.16.dylib "${CONTENTS}/Frameworks/libpng16.16.dylib"
ditto ${LOCAL_PREFIX}/lib/libpng12.0.dylib "${CONTENTS}/Frameworks/libpng12.0.dylib"
# 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"
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/liblensfun.2.dylib"
ditto ${LOCAL_PREFIX}/lib/libtiff.5.dylib "${CONTENTS}/Frameworks/libtiff.5.dylib"
# Copy libomp to Frameworks
ditto ${LOCAL_PREFIX}/local/lib/libomp.dylib "${CONTENTS}/Frameworks"
ditto ${LOCAL_PREFIX}/lib/libomp.dylib "${CONTENTS}/Frameworks"
# Prepare GTK+3 installation
msg "Copying configuration files from ${GTK_PREFIX}:"
install -d "${ETC}/gtk-3.0"
cp -RL {"${GDK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0
msg "Copying library modules from ${GTK_PREFIX}:"
ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0
cp -RL {"${GDK_PREFIX}/lib","${LIB}"}/gdk-pixbuf-2.0
ditto --arch "${arch}" {"${GTK_PREFIX}/lib","${LIB}"}/gtk-3.0
msg "Removing static libraries and cache files:"
find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read -r; do rm "${REPLY}"; done
# Make Frameworks folder flat
msg "Flattening the Frameworks folder"
ditto "${LIB}"/gdk-pixbuf-2.0/2*/loaders/*.so "${LIB}"
ditto "${LIB}"/gtk-3.0/3*/immodules/*.{dylib,so} "${LIB}"
cp -RL "${LIB}"/gdk-pixbuf-2.0/2*/loaders/* "${LIB}"
cp "${LIB}"/gtk-3.0/3*/immodules/*.{dylib,so} "${LIB}"
rm -r "${LIB}"/gtk-3.0
rm -r "${LIB}"/gdk-pixbuf-2.0
# 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
ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/themes/Default/gtk-3.0/gtk-keys.css
ditto {"${LOCAL_PREFIX}","${RESOURCES}"}/share/themes/Mac/gtk-3.0/gtk-keys.css
ditto {"${LOCAL_PREFIX}","${RESOURCES}"}/share/themes/Default/gtk-3.0/gtk-keys.css
# Adwaita icons
msg "Copy Adwaita icons"
iconfolders=("16x16/actions" "16x16/devices" "16x16/mimetypes" "16x16/places" "16x16/status" "48x48/devices")
iconfolders=("16x16/actions" "16x16/devices" "16x16/mimetypes" "16x16/places" "16x16/status" "16x16/ui" "48x48/devices")
for f in "${iconfolders[@]}"; do
mkdir -p ${RESOURCES}/share/icons/Adwaita/${f}
ditto ${LOCAL_PREFIX}/local/share/icons/Adwaita/${f}/* "${RESOURCES}"/share/icons/Adwaita/${f}
cp -RL ${LOCAL_PREFIX}/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"
ditto "${LOCAL_PREFIX}/local/share/icons/hicolor" "${RESOURCES}/share/icons/hicolor"
cp -RL {"${LOCAL_PREFIX}","${RESOURCES}"}/share/icons/Adwaita/index.theme
"${LOCAL_PREFIX}/bin/gtk-update-icon-cache" "${RESOURCES}/share/icons/Adwaita" || "${LOCAL_PREFIX}/bin/gtk-update-icon-cache-3.0" "${RESOURCES}/share/icons/Adwaita"
cp -RL "${LOCAL_PREFIX}/share/icons/hicolor" "${RESOURCES}/share/icons/hicolor"
# fix libfreetype install name
for lib in "${LIB}"/*; do
install_name_tool -change libfreetype.6.dylib "${LIB}"/libfreetype.6.dylib "${lib}"
install_name_tool -change libfreetype.6.dylib "${LIB}"/libfreetype.6.dylib "${lib}" 2>/dev/null
done
# pixbuf loaders & immodules
# Build GTK3 pixbuf loaders & immodules database
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/|/Applications/RawTherapee.app/Contents/Frameworks/|" "${ETC}/gtk-3.0/gtk.immodules"
mkdir -p "${RESOURCES}"/share/gtk-3.0
mkdir -p "${ETC}"/gtk-3.0
"${LOCAL_PREFIX}"/bin/gdk-pixbuf-query-loaders "${LIB}"/libpixbufloader-*.so > "${ETC}"/gtk-3.0/gdk-pixbuf.loaders
"${LOCAL_PREFIX}"/bin/gtk-query-immodules-3.0 "${LIB}"/im-* > "${ETC}"/gtk-3.0/gtk.immodules || "${LOCAL_PREFIX}"/bin/gtk-query-immodules "${LIB}"/im-* > "${ETC}"/gtk-3.0/gtk.immodules
sed -i.bak -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.bak -e "s|${LOCAL_PREFIX}/share/|/Applications/RawTherapee.app/Contents/Resources/share/|" "${ETC}"/gtk-3.0/gtk.immodules
sed -i.bak -e "s|${LOCAL_PREFIX}/|/Applications/RawTherapee.app/Contents/Frameworks/|" "${ETC}"/gtk-3.0/gtk.immodules
rm "${ETC}"/*/*.bak
# Install names
ModifyInstallNames
ModifyInstallNames 2>/dev/null
# Mime directory
msg "Copying shared files from ${GTK_PREFIX}:"
ditto {"${LOCAL_PREFIX}/local","${RESOURCES}"}/share/mime
ditto {"${LOCAL_PREFIX}","${RESOURCES}"}/share/mime
msg "Installing required application bundle files:"
PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}/tools/osx"
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}/cliInfo.plist.in" "${LIB}/Info.plist"
sed -i "" -e "s|@version@|${PROJECT_FULL_VERSION}|
s|@shortVersion@|${PROJECT_VERSION}|
s|@arch@|${arch}|" \
"${CONTENTS}/Info.plist"
#ditto "${PROJECT_SOURCE_DATA_DIR}/PkgInfo" "${CONTENTS}"
update-mime-database -V "${RESOURCES}/share/mime"
cp -RL "${LOCAL_PREFIX}/share/locale" "${RESOURCES}/share/locale"
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"
cp -LR {"${LOCAL_PREFIX}","${RESOURCES}"}/share/glib-2.0/schemas
"${LOCAL_PREFIX}/bin/glib-compile-schemas" "${RESOURCES}/share/glib-2.0/schemas"
# Append an LC_RPATH
msg "Registering @rpath into the main executable."
install_name_tool -add_rpath /Applications/"${LIB}" "${EXECUTABLE}"
install_name_tool -add_rpath /Applications/"${LIB}" "${EXECUTABLE}" 2>/dev/null
ModifyInstallNames
ModifyInstallNames 2>/dev/null
# fix @rpath in Frameworks
msg "Registering @rpath in Frameworks folder."
for frameworklibs in "${LIB}"/*{dylib,so,cli}; do
install_name_tool -delete_rpath ${LOCAL_PREFIX}/local/lib "${frameworklibs}"
install_name_tool -add_rpath /Applications/"${LIB}" "${frameworklibs}"
install_name_tool -delete_rpath ${LOCAL_PREFIX}/lib "${frameworklibs}" 2>/dev/null
install_name_tool -add_rpath /Applications/"${LIB}" "${frameworklibs}" 2>/dev/null
done
install_name_tool -delete_rpath RawTherapee.app/Contents/Frameworks "${EXECUTABLE}"-cli
install_name_tool -add_rpath /Applications/"${LIB}" "${EXECUTABLE}"-cli
install_name_tool -delete_rpath RawTherapee.app/Contents/Frameworks "${EXECUTABLE}"-cli 2>/dev/null
install_name_tool -add_rpath /Applications/"${LIB}" "${EXECUTABLE}"-cli 2>/dev/null
ditto "${EXECUTABLE}"-cli "${APP}"/..
# Merge the app with the other architecture to create the Universal app.
if [[ -n $UNIVERSAL_URL ]]; then
msg "Getting Universal countercomponent."
curl -L ${UNIVERSAL_URL} -o univ.zip
msg "Extracting app."
unzip univ.zip -d univapp
hdiutil attach -mountpoint ./RawTherapeeuniv univapp/*/*dmg
if [[ $arch = "arm64" ]]; then
cp -R RawTherapee.app RawTherapee-arm64.app
minimum_arm64_version=$(f=$(cat RawTherapee-arm64.app/Contents/Resources/AboutThisBuild.txt | grep mmacosx-version); echo "${f#*min=}" | cut -d ' ' -f1)
cp -R RawTherapeeuniv/RawTherapee.app RawTherapee-x86_64.app
minimum_x86_64_version=$(f=$(cat RawTherapee-x86_64.app/Contents/Resources/AboutThisBuild.txt | grep mmacosx-version); echo "${f#*min=}" | cut -d ' ' -f1)
echo "\n\n=====================================\n\n" >> RawTherapee.app/Contents/Resources/AboutThisBuild.txt
cat RawTherapee-x86_64.app/Contents/Resources/AboutThisBuild.txt >> RawTherapee.app/Contents/Resources/AboutThisBuild.txt
else
cp -R RawTherapee.app RawTherapee-x86_64.app
minimum_x86_64_version=$(f=$(cat RawTherapee-x86_64.app/Contents/Resources/AboutThisBuild.txt | grep mmacosx-version); echo "${f#*min=}" | cut -d ' ' -f1)
cp -R RawTherapeeuniv/RawTherapee.app RawTherapee-arm64.app
minimum_arm64_version=$(f=$(cat RawTherapee-arm64.app/Contents/Resources/AboutThisBuild.txt | grep mmacosx-version); echo "${f#*min=}" | cut -d ' ' -f1)
echo "\n\n=====================================\n\n" >> RawTherapee.app/Contents/Resources/AboutThisBuild.txt
cat RawTherapee-arm64.app/Contents/Resources/AboutThisBuild.txt >> RawTherapee.app/Contents/Resources/AboutThisBuild.txt
fi
cmake -DPROJECT_SOURCE_DATA_DIR=${PROJECT_SOURCE_DATA_DIR} -DCONTENTS=${CONTENTS} -Dversion=${PROJECT_FULL_VERSION} -DshortVersion=${PROJECT_VERSION} -Dminimum_arm64_version=${minimum_arm64_version} -Dminimum_x86_64_version=${minimum_x86_64_version} -Darch=${arch} -P ${PROJECT_SOURCE_DATA_DIR}/info-plist.cmake
hdiutil unmount ./RawTherapeeuniv
rm -r univapp
# Create the fat main RawTherapee binary and move it into the new bundle
lipo -create -output RawTherapee RawTherapee-arm64.app/Contents/MacOS/RawTherapee RawTherapee-x86_64.app/Contents/MacOS/RawTherapee
mv RawTherapee RawTherapee.app/Contents/MacOS
# Create all the fat dependencies and move them into the bundle
for lib in RawTherapee-arm64.app/Contents/Frameworks/* ; do
lipo -create -output $(basename $lib) RawTherapee-arm64.app/Contents/Frameworks/$(basename $lib) RawTherapee-x86_64.app/Contents/Frameworks/$(basename $lib)
done
sudo mv *cli *so *dylib RawTherapee.app/Contents/Frameworks
rm -r RawTherapee-arm64.app
rm -r RawTherapee-x86_64.app
else
minimum_arm64_version=$(f=$(cat RawTherapee.app/Contents/Resources/AboutThisBuild.txt | grep mmacosx-version); echo "${f#*min=}" | cut -d ' ' -f1)
minimum_x86_64_version=${minimum_arm64_version}
cmake -DPROJECT_SOURCE_DATA_DIR=${PROJECT_SOURCE_DATA_DIR} -DCONTENTS=${CONTENTS} -Dversion=${PROJECT_FULL_VERSION} -DshortVersion=${PROJECT_VERSION} -Dminimum_arm64_version=${minimum_arm64_version} -Dminimum_x86_64_version=${minimum_x86_64_version} -Darch=${arch} -P ${PROJECT_SOURCE_DATA_DIR}/info-plist.cmake
fi
# Codesign the app
if [[ -n $CODESIGNID ]]; then
msg "Codesigning Application."
iconv -f UTF-8 -t ASCII "${PROJECT_SOURCE_DATA_DIR}"/rt.entitlements > "${CMAKE_BUILD_TYPE}"/rt.entitlements
iconv -f UTF-8 -t ASCII "${PROJECT_SOURCE_DATA_DIR}"/rt-cli.entitlements > "${CMAKE_BUILD_TYPE}"/rt-cli.entitlements
mv "${EXECUTABLE}"-cli "${LIB}"
for frameworklibs in "${LIB}"/*{dylib,so}; do
codesign -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee --force --verbose -o runtime --timestamp --entitlements "${CMAKE_BUILD_TYPE}"/rt.entitlements "${frameworklibs}"
done
codesign --force -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee -o runtime --entitlements "${CMAKE_BUILD_TYPE}"/rt-cli.entitlements "${LIB}"/rawtherapee-cli
codesign --deep --timestamp --strict -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee -o runtime --entitlements "${CMAKE_BUILD_TYPE}"/rt.entitlements "${APP}"
codesign --force --deep --timestamp --strict -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee -o runtime --entitlements "${CMAKE_BUILD_TYPE}"/rt.entitlements "${APP}"
spctl -a -vvvv "${APP}"
fi
@@ -310,6 +367,7 @@ fi
if [[ -n $NOTARY ]]; then
msg "Notarizing the application:"
ditto -c -k --sequesterRsrc --keepParent "${APP}" "${APP}.zip"
echo "Uploading..."
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
@@ -334,11 +392,11 @@ if [[ -n $NOTARY ]]; then
fi
function CreateDmg {
local srcDir="$(mktemp -dt $$)"
local srcDir="$(mktemp -dt $$.XXXXXXXXXXXX)"
msg "Preparing disk image sources at ${srcDir}:"
cp -R "${APP}" "${srcDir}"
cp "${RESOURCES}"/share/LICENSE.txt "${srcDir}"
cp "${RESOURCES}"/LICENSE "${srcDir}"
ln -s /Applications "${srcDir}"
# Web bookmarks
@@ -352,7 +410,10 @@ function CreateDmg {
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}"
if [[ -n $UNIVERSAL_URL ]]; then
arch="Universal"
fi
dmg_name="${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}"
lower_build_type="$(tr '[:upper:]' '[:lower:]' <<< "$CMAKE_BUILD_TYPE")"
if [[ $lower_build_type != release ]]; then
dmg_name="${dmg_name}_${lower_build_type}"
@@ -367,6 +428,7 @@ function CreateDmg {
SetFile -c incC "${srcDir}/.VolumeIcon.icns"
create-dmg "${dmg_name}.dmg" "${srcDir}" \
--volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" \
--appname "${PROJECT_NAME}" \
--volicon "${srcDir}/.VolumeIcon.icns" \
--sandbox-safe \
--no-internet-enable \
@@ -379,6 +441,7 @@ function CreateDmg {
# Sign disk image
if [[ -n $CODESIGNID ]]; then
msg "Signing disk image"
codesign --deep --force -v -s "${CODESIGNID}" --timestamp "${dmg_name}.dmg"
fi
@@ -386,8 +449,9 @@ function CreateDmg {
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
echo "Uploading..."
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
sleep 15
while :
do
@@ -412,15 +476,13 @@ function CreateDmg {
# Zip disk image for redistribution
msg "Zipping disk image for redistribution:"
mkdir "${PROJECT_NAME}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}_folder"
ditto {"${PROJECT_NAME}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}.dmg","rawtherapee-cli","${PROJECT_SOURCE_DATA_DIR}/INSTALL.readme.rtf"} "${PROJECT_NAME}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}_folder"
zip -r "${PROJECT_NAME}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}_folder/"
# rm "${dmg_name}.dmg"
# msg "Removing disk image caches:"
# rm -rf "${srcDir}"
mkdir "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder"
ditto {"${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.dmg","rawtherapee-cli","${PROJECT_SOURCE_DATA_DIR}/INSTALL.txt"} "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder"
zip -r "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder/"
if [[ -n $NIGHTLY ]]; then
cp "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_macOS_${arch}_latest.zip"
fi
}
CreateDmg
msg "Finishing build:"
echo "Script complete."
#
# TODO filter out the benign errors

View File

@@ -47,7 +47,7 @@ AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}\{#MyAppVersion}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile={#MyBuildBasePath}\LICENSE.txt
LicenseFile={#MyBuildBasePath}\LICENSE
OutputDir={#MyBuildBasePath}\..\
OutputBaseFilename={#MyAppName}_{#MyAppVersion}_{#MySystemName}_{#MyBitDepth}
SetupIconFile={#MySourceBasePath}\rtdata\images\rawtherapee.ico
@@ -61,7 +61,9 @@ PrivilegesRequired=none
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "bulgarian"; MessagesFile: "compiler:Languages\Bulgarian.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
@@ -70,19 +72,18 @@ Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
[Tasks]
@@ -111,7 +112,7 @@ Source: "{#MyBuildBasePath}\sounds\*"; DestDir: "{app}\sounds\"; Flags: ignoreve
Source: "{#MyBuildBasePath}\themes\*"; DestDir: "{app}\themes\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#MyBuildBasePath}\AboutThisBuild.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyBuildBasePath}\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyBuildBasePath}\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyBuildBasePath}\LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyBuildBasePath}\RELEASE_NOTES.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyBuildBasePath}\options"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyBuildBasePath}\*.dll"; DestDir: "{app}"; Flags: ignoreversion
@@ -152,4 +153,4 @@ function IsElevatedUser(): Boolean;
begin
Result := IsAdminLoggedOn or IsPowerUserLoggedOn;
end;