Fixed old paths in osx scripts and quoted some variables
This commit is contained in:
@@ -103,7 +103,7 @@ if (APPLE)
|
|||||||
elseif (PROC_BIT_DEPTH MATCHES 64)
|
elseif (PROC_BIT_DEPTH MATCHES 64)
|
||||||
list (APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64)
|
list (APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64)
|
||||||
endif (PROC_BIT_DEPTH MATCHES 32)
|
endif (PROC_BIT_DEPTH MATCHES 32)
|
||||||
list (APPEND MACOSX_BUNDLE_COMMAND sh "${PROJECT_SOURCE_DIR}/rtdata/osx/macosx_bundle.sh")
|
list (APPEND MACOSX_BUNDLE_COMMAND sh "${PROJECT_SOURCE_DIR}/tools/osx/macosx_bundle.sh")
|
||||||
|
|
||||||
add_custom_target(macosx_bundle
|
add_custom_target(macosx_bundle
|
||||||
COMMAND ${MACOSX_BUNDLE_COMMAND}
|
COMMAND ${MACOSX_BUNDLE_COMMAND}
|
||||||
|
@@ -32,20 +32,20 @@ if test ! -d "${CMAKE_BUILD_TYPE}"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# update project version
|
# update project version
|
||||||
if test -x $(which git) -a -d "${PROJECT_SOURCE_DIR}/.git"; then
|
if test -x "$(which git)" -a -d "${PROJECT_SOURCE_DIR}/.git"; then
|
||||||
# This is what the version ought to look like to be accurate in the git universe:
|
# This is what the version ought to look like to be accurate in the git universe:
|
||||||
# PROJECT_VERSION="$(git describe --tags --always)_$(git symbolic-ref --short -q HEAD)"
|
PROJECT_FULL_VERSION="$(git describe --tags --always)_$(git symbolic-ref --short -q HEAD)"
|
||||||
# outputs: 4.2-677-g904467b_master
|
# outputs: 4.2-677-g904467b_master
|
||||||
# but due to Apple requirements https://goo.gl/eWDQv6 we must use this:
|
# but Apple requirements https://goo.gl/eWDQv6 state we should use this:
|
||||||
PROJECT_VERSION="$(git describe --tags --always | sed -e 's/-g.*//' -e 's/-/./')"
|
PROJECT_VERSION="$(git describe --tags --always | sed -e 's/-g.*//' -e 's/-/./')"
|
||||||
# outputs: 4.2.677
|
# outputs: 4.2.677
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if not specify CMAKE_OSX_DEPLOYMENT_TARGET when compiling,
|
# if not specify CMAKE_OSX_DEPLOYMENT_TARGET when compiling,
|
||||||
# 'MINIMUM_VERSION' will be used host OS X version.
|
# 'MINIMUM_VERSION' will be used host OS X version.
|
||||||
MINIMUM_SYSTEM_VERSION=$(otool -l "${CMAKE_BUILD_TYPE}"/rawtherapee | grep -A2 'LC_VERSION_MIN_MACOSX' | awk '$1 ~ /version/ { printf $2 }')
|
MINIMUM_SYSTEM_VERSION="$(otool -l "${CMAKE_BUILD_TYPE}"/rawtherapee | grep -A2 'LC_VERSION_MIN_MACOSX' | awk '$1 ~ /version/ { printf $2 }')"
|
||||||
if test ! -n "${MINIMUM_SYSTEM_VERSION}"; then
|
if test ! -n "${MINIMUM_SYSTEM_VERSION}"; then
|
||||||
MINIMUM_SYSTEM_VERSION=$(sw_vers -productVersion | cut -d. -f-2)
|
MINIMUM_SYSTEM_VERSION="$(sw_vers -productVersion | cut -d. -f-2)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check for pango-querymodules. Pango 1.38.0 and above do not include it.
|
# check for pango-querymodules. Pango 1.38.0 and above do not include it.
|
||||||
@@ -100,9 +100,9 @@ message "Copying dependencies from ${GTK_PREFIX}"
|
|||||||
CheckLink "${EXECUTABLE}"
|
CheckLink "${EXECUTABLE}"
|
||||||
|
|
||||||
message "Copying library modules from ${GTK_PREFIX}"
|
message "Copying library modules from ${GTK_PREFIX}"
|
||||||
ditto --arch ${arch} {"${GTK_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-2.0
|
ditto --arch "${arch}" {"${GTK_PREFIX}"/lib,"${LIB}"}/gtk-2.0
|
||||||
ditto --arch ${arch} {"${GTK_PREFIX}"/lib,"${LIB}"}/pango
|
ditto --arch "${arch}" {"${GTK_PREFIX}"/lib,"${LIB}"}/pango
|
||||||
|
|
||||||
message "Removing static libraries and cache files"
|
message "Removing static libraries and cache files"
|
||||||
find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read; do rm "${REPLY}"; done
|
find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read; do rm "${REPLY}"; done
|
||||||
@@ -154,7 +154,7 @@ echo " install_name_tool -add_rpath @loader_path/lib '${EXECUTABLE}'" | bash -
|
|||||||
|
|
||||||
|
|
||||||
message "Installing required application bundle files"
|
message "Installing required application bundle files"
|
||||||
PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}"/rtdata/osx
|
PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}"/tools/osx
|
||||||
# executable loader
|
# executable loader
|
||||||
# note: executable is renamed to 'rawtherapee-bin'.
|
# note: executable is renamed to 'rawtherapee-bin'.
|
||||||
mv "${MACOS}"/rawtherapee{,-bin}
|
mv "${MACOS}"/rawtherapee{,-bin}
|
||||||
@@ -164,7 +164,7 @@ cp "${PROJECT_SOURCE_DATA_DIR}"/{rawtherapee,profile}.icns "${RESOURCES}"
|
|||||||
cp "${PROJECT_SOURCE_DATA_DIR}"/PkgInfo "${CONTENTS}"
|
cp "${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.in "${CONTENTS}"/Info.plist
|
||||||
sed -i "" -e "s|@version@|${PROJECT_VERSION}|
|
sed -i "" -e "s|@version@|${PROJECT_VERSION}|
|
||||||
s|@shortVersion@|$(echo ${PROJECT_VERSION}|
|
s|@shortVersion@|${PROJECT_VERSION}|
|
||||||
s|@arch@|${arch}|" \
|
s|@arch@|${arch}|" \
|
||||||
"${CONTENTS}"/Info.plist
|
"${CONTENTS}"/Info.plist
|
||||||
plutil -convert binary1 "${CONTENTS}"/Info.plist
|
plutil -convert binary1 "${CONTENTS}"/Info.plist
|
||||||
@@ -172,31 +172,31 @@ plutil -convert binary1 "${CONTENTS}"/Info.plist
|
|||||||
|
|
||||||
|
|
||||||
function CreateDmg {
|
function CreateDmg {
|
||||||
local srcdir=$(mktemp -dt $$)
|
local srcdir="$(mktemp -dt $$)"
|
||||||
|
|
||||||
message "Preparing disk image sources at ${srcdir}"
|
message "Preparing disk image sources at ${srcdir}"
|
||||||
mv "${APP}" ${srcdir}
|
mv "${APP}" "${srcdir}"
|
||||||
cp AboutThisBuild.txt ${srcdir}
|
cp AboutThisBuild.txt "${srcdir}"
|
||||||
ln -s /Applications ${srcdir}
|
ln -s /Applications "${srcdir}"
|
||||||
|
|
||||||
# web bookmarks
|
# web bookmarks
|
||||||
function CreateWebloc {
|
function CreateWebloc {
|
||||||
defaults write ${srcdir}/"$1" URL "$2"
|
defaults write "${srcdir}/$1" URL "$2"
|
||||||
mv ${srcdir}/"$1".{plist,webloc}
|
mv "${srcdir}/$1".{plist,webloc}
|
||||||
}
|
}
|
||||||
CreateWebloc 'RawTherapee Blog' 'http://www.rawtherapee.com'
|
CreateWebloc 'RawTherapee Blog' 'http://www.rawtherapee.com'
|
||||||
CreateWebloc 'Online Manual' 'https://docs.google.com/document/d/1DHLb_6xNQsEInxiuU8pz1-sWNinnj09bpBUA4_Vl8w8/edit'
|
CreateWebloc 'Online Manual' 'http://rawpedia.rawtherapee.com/'
|
||||||
|
|
||||||
# disk image name
|
# disk image name
|
||||||
dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_VERSION}"
|
dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}"
|
||||||
if ! echo ${CMAKE_BUILD_TYPE} | grep -sqi "release"; then
|
if ! echo "${CMAKE_BUILD_TYPE}" | grep -sqi "release"; then
|
||||||
dmg_name="${dmg_name}_$(echo ${CMAKE_BUILD_TYPE} | tr '[:upper:]' '[:lower:]')"
|
dmg_name="${dmg_name}_$(echo ${CMAKE_BUILD_TYPE} | tr '[:upper:]' '[:lower:]')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
message "Creating disk image"
|
message "Creating disk image"
|
||||||
hdiutil create -format UDBZ -srcdir ${srcdir} -volname "${PROJECT_NAME}_${PROJECT_VERSION}" "${dmg_name}".dmg
|
hdiutil create -format UDBZ -srcdir "${srcdir}" -volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" "${dmg_name}".dmg
|
||||||
|
|
||||||
message "Removing disk image caches"
|
message "Removing disk image caches"
|
||||||
rm -rf ${srcdir}
|
rm -rf "${srcdir}"
|
||||||
}
|
}
|
||||||
CreateDmg
|
CreateDmg
|
||||||
|
Reference in New Issue
Block a user