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

@@ -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