From 817ac17189959f19cf17052eacc52651d774b4a3 Mon Sep 17 00:00:00 2001 From: Beep6581 Date: Sat, 20 Feb 2016 18:30:59 +0100 Subject: [PATCH 01/10] Updated OS X scripts and moved OS X and Windows files from rtdata/ to tools/ --- tools/generateSourceTarball | 11 ++++++----- {rtdata => tools}/osx/Info.plist.in | 2 +- {rtdata => tools}/osx/PkgInfo | 0 {rtdata => tools}/osx/executable_loader.in | 3 ++- {rtdata => tools}/osx/macosx_bundle.sh | 15 +++++++++++---- {rtdata => tools}/osx/profile.icns | Bin {rtdata => tools}/osx/rawtherapee.icns | Bin .../win/InnoSetup/WindowsInnoSetup.iss.in | 0 .../win/InnoSetup/installerStrip.bmp | Bin .../win/InnoSetup/installerStrip.svg | 0 {rtdata => tools}/win/readme.txt | 0 11 files changed, 20 insertions(+), 11 deletions(-) rename {rtdata => tools}/osx/Info.plist.in (97%) rename {rtdata => tools}/osx/PkgInfo (100%) rename {rtdata => tools}/osx/executable_loader.in (89%) rename {rtdata => tools}/osx/macosx_bundle.sh (92%) rename {rtdata => tools}/osx/profile.icns (100%) rename {rtdata => tools}/osx/rawtherapee.icns (100%) rename {rtdata => tools}/win/InnoSetup/WindowsInnoSetup.iss.in (100%) rename {rtdata => tools}/win/InnoSetup/installerStrip.bmp (100%) rename {rtdata => tools}/win/InnoSetup/installerStrip.svg (100%) rename {rtdata => tools}/win/readme.txt (100%) diff --git a/tools/generateSourceTarball b/tools/generateSourceTarball index eb4688037..98173c00f 100755 --- a/tools/generateSourceTarball +++ b/tools/generateSourceTarball @@ -1,16 +1,17 @@ #!/usr/bin/env bash if [[ ! "$1" ]]; then - printf "%s\n" "Usage: $0 " "Example: $0 4.0.10" + printf "%s\n" "Usage: $0 " "Example: $0 4.2" exit fi -hg update "$1" +git checkout "$1" || exit 0 tools/generateReleaseInfo mkdir rawtherapee-"$1" mv ReleaseInfo.cmake rawtherapee-"$1" -hg archive -X ".hg*" -X "rtgui/config.h" -X "rtgui/version.h" -X "rtdata/rawtherapee.desktop" rawtherapee-"$1".tar -tar -rf rawtherapee-"$1".tar rawtherapee-"$1"/ReleaseInfo.cmake +#hg archive -X ".hg*" -X "rtgui/config.h" -X "rtgui/version.h" -X "rtdata/rawtherapee.desktop" rawtherapee-"$1".tar +git archive --format=tar "$1" > rawtherapee-"$1".tar +tar --append --file=rawtherapee-"$1".tar rawtherapee-"$1"/ReleaseInfo.cmake xz -z -9e rawtherapee-"$1".tar rm -r rawtherapee-"$1" -hg update +git checkout diff --git a/rtdata/osx/Info.plist.in b/tools/osx/Info.plist.in similarity index 97% rename from rtdata/osx/Info.plist.in rename to tools/osx/Info.plist.in index 491d2ee85..5b08d63a1 100644 --- a/rtdata/osx/Info.plist.in +++ b/tools/osx/Info.plist.in @@ -111,7 +111,7 @@ CFBundleExecutable rawtherapee CFBundleGetInfoString - @version@, Copyright © 2004-2013 Gábor Horváth + @version@, Copyright © 2004-2010 Gábor Horváth, 2010-2016 RT dev team CFBundleIconFile rawtherapee.icns CFBundleIdentifier diff --git a/rtdata/osx/PkgInfo b/tools/osx/PkgInfo similarity index 100% rename from rtdata/osx/PkgInfo rename to tools/osx/PkgInfo diff --git a/rtdata/osx/executable_loader.in b/tools/osx/executable_loader.in similarity index 89% rename from rtdata/osx/executable_loader.in rename to tools/osx/executable_loader.in index d56cd1dc1..5f1911edb 100644 --- a/rtdata/osx/executable_loader.in +++ b/tools/osx/executable_loader.in @@ -4,7 +4,8 @@ cwd="$(cd "$(dirname "$0")"; pwd)" app="${cwd%/Contents/*}" etc="${cwd}"/etc -# for different os x version (issue 1795) +# for different os x versions +# see https://github.com/Beep6581/RawTherapee/issues/1779 cups_dir=/tmp/RT4 install -d ${cups_dir} cp -f /usr/lib/libcups.2.dylib ${cups_dir} diff --git a/rtdata/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh similarity index 92% rename from rtdata/osx/macosx_bundle.sh rename to tools/osx/macosx_bundle.sh index 670343b08..05836905e 100644 --- a/rtdata/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -5,7 +5,7 @@ # these are very important variables. Must be set into rtdata/CMakeLists.txt! # - PROJECT_NAME # - PROJECT_SOURCE_DIR -# - PROJECT_VERSION (if without mercurial) +# - PROJECT_VERSION (if without git) # - CMAKE_BUILD_TYPE # - PROC_BIT_DEPTH # - GTK_PREFIX @@ -13,9 +13,11 @@ function message { printf '\e[34m-- %s\e[m\n' "$*" } + function GetDependencies { otool -L "$1" | awk 'NR >= 2 && $1 !~ /^(\/usr\/lib|\/System|@executable_path|@rpath)\// { print $1 }' } + function CheckLink { GetDependencies "$1" | while read; do local dest="${LIB}/$(basename "${REPLY}")" @@ -30,8 +32,13 @@ if test ! -d "${CMAKE_BUILD_TYPE}"; then fi # update project version -if test -x $(which hg) -a -d "${PROJECT_SOURCE_DIR}/.hg"; then - PROJECT_VERSION=$(hg -R "${PROJECT_SOURCE_DIR}" parents --template "{latesttag}.{latesttagdistance}") +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: + # PROJECT_VERSION="$(git describe --tags --always)_$(git symbolic-ref --short -q HEAD)" + # outputs: 4.2-677-g904467b_master + # but due to Apple requirements https://goo.gl/eWDQv6 we must use this: + PROJECT_VERSION="$(git describe --tags --always | sed -e 's/-g.*//' -e 's/-/./')" + # outputs: 4.2.677 fi # if not specify CMAKE_OSX_DEPLOYMENT_TARGET when compiling, @@ -157,7 +164,7 @@ cp "${PROJECT_SOURCE_DATA_DIR}"/{rawtherapee,profile}.icns "${RESOURCES}" cp "${PROJECT_SOURCE_DATA_DIR}"/PkgInfo "${CONTENTS}" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}"/Info.plist.in "${CONTENTS}"/Info.plist sed -i "" -e "s|@version@|${PROJECT_VERSION}| - s|@shortVersion@|$(echo ${PROJECT_VERSION} | cut -d. -f-3)| + s|@shortVersion@|$(echo ${PROJECT_VERSION}| s|@arch@|${arch}|" \ "${CONTENTS}"/Info.plist plutil -convert binary1 "${CONTENTS}"/Info.plist diff --git a/rtdata/osx/profile.icns b/tools/osx/profile.icns similarity index 100% rename from rtdata/osx/profile.icns rename to tools/osx/profile.icns diff --git a/rtdata/osx/rawtherapee.icns b/tools/osx/rawtherapee.icns similarity index 100% rename from rtdata/osx/rawtherapee.icns rename to tools/osx/rawtherapee.icns diff --git a/rtdata/win/InnoSetup/WindowsInnoSetup.iss.in b/tools/win/InnoSetup/WindowsInnoSetup.iss.in similarity index 100% rename from rtdata/win/InnoSetup/WindowsInnoSetup.iss.in rename to tools/win/InnoSetup/WindowsInnoSetup.iss.in diff --git a/rtdata/win/InnoSetup/installerStrip.bmp b/tools/win/InnoSetup/installerStrip.bmp similarity index 100% rename from rtdata/win/InnoSetup/installerStrip.bmp rename to tools/win/InnoSetup/installerStrip.bmp diff --git a/rtdata/win/InnoSetup/installerStrip.svg b/tools/win/InnoSetup/installerStrip.svg similarity index 100% rename from rtdata/win/InnoSetup/installerStrip.svg rename to tools/win/InnoSetup/installerStrip.svg diff --git a/rtdata/win/readme.txt b/tools/win/readme.txt similarity index 100% rename from rtdata/win/readme.txt rename to tools/win/readme.txt From 80dacddedc9eb31abe3ee470fbba885dca970137 Mon Sep 17 00:00:00 2001 From: Beep6581 Date: Sat, 20 Feb 2016 18:59:56 +0100 Subject: [PATCH 02/10] Added patch for libiconv 1.14 needed for OS X, see issue #3161 --- tools/osx/libiconv_1.14_rt.patch | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools/osx/libiconv_1.14_rt.patch diff --git a/tools/osx/libiconv_1.14_rt.patch b/tools/osx/libiconv_1.14_rt.patch new file mode 100644 index 000000000..7a01b1373 --- /dev/null +++ b/tools/osx/libiconv_1.14_rt.patch @@ -0,0 +1,30 @@ +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 From 174c0cd601ca5318bac6fe44704d7e54548e753f Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 20 Feb 2016 20:49:09 +0100 Subject: [PATCH 03/10] Fix typo in safe_build_subdir_list, fixes #3160 --- rtengine/safegtk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/safegtk.cc b/rtengine/safegtk.cc index 844afe40a..053507c3e 100644 --- a/rtengine/safegtk.cc +++ b/rtengine/safegtk.cc @@ -174,7 +174,7 @@ void safe_build_subdir_list (Glib::RefPtr &dir, std::vectorget_file_type() == Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || add_hidden)) { subDirs.push_back (info->get_name()); From c40979340b9c00e70d56cde085c6aa9c98896bb6 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 20 Feb 2016 21:09:24 +0100 Subject: [PATCH 04/10] Fix broken windows build --- rtdata/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index 9f6eee693..f38869b96 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -57,7 +57,7 @@ if (WIN32) include("${PROJECT_SOURCE_DIR}/ReleaseInfo.cmake") endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) - configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss") + configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/../tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss") install (FILES "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss" DESTINATION ${BINDIR}) endif (WIN32) @@ -104,7 +104,7 @@ if (APPLE) list (APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64) endif (PROC_BIT_DEPTH MATCHES 32) list (APPEND MACOSX_BUNDLE_COMMAND sh "${PROJECT_SOURCE_DIR}/rtdata/osx/macosx_bundle.sh") - + add_custom_target(macosx_bundle COMMAND ${MACOSX_BUNDLE_COMMAND} WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" From 0b32f12f6c405929054f03c35b6fddc5efa15ca8 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sun, 21 Feb 2016 00:20:34 +0100 Subject: [PATCH 05/10] Solving issue #3163: "Detail window centres to whole image instead of centre of preview" --- rtgui/imagearea.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index ce0699664..5383058e3 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -474,7 +474,13 @@ void ImageArea::addCropWindow () cw->setEditSubscriber (getCurrSubscriber()); cw->enable(); // start processing! - cw->centerCrop(); + { + int anchorX = 0; + int anchorY = 0; + mainCropWindow->getCropAnchorPosition(anchorX, anchorY); + cw->setCropAnchorPosition(anchorX, anchorY); + } + mainCropWindow->setObservedCropWin (cropWins.front()); if(cropWins.size() == 1) { // after first detail window we already have high quality From 1f77da52388e9cd77661d1340a54f2003b04cca0 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Sun, 21 Feb 2016 20:30:02 +0100 Subject: [PATCH 06/10] Add a build-time option to easily enable run-time sanitizers available in recent versions of Clang and GCC. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 646dbf46f..7c1a12c87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,7 @@ option (BUILD_SHARED "Build rawtherapee with shared libraries" OFF) option (WITH_BZIP "Build with Bzip2 support" ON) option (WITH_MYFILE_MMAP "Build using memory mapped file" ON) option (WITH_LTO "Build with link-time optimizations" OFF) +option (WITH_SAN "Build with run-time sanitizer" OFF) option (OPTION_OMP "Build with OpenMP support" ON) option (STRICT_MUTEX "True (recommended): MyMutex will behave like POSIX Mutex; False: MyMutex will behave like POSIX RecMutex; Note: forced to ON for Debug builds" ON) option (TRACE_MYRWMUTEX "Trace RT's custom R/W Mutex (Debug builds only); redirecting std::out to a file is strongly recommended!" OFF) @@ -274,6 +275,12 @@ if (WITH_LTO) SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") endif (WITH_LTO) +if (WITH_SAN) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${WITH_SAN}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${WITH_SAN}") + SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${WITH_SAN}") +endif (WITH_SAN) + if (OPTION_OMP) find_package(OpenMP) if (OPENMP_FOUND) From 053905838231ee0c0bba8a885b1173a6471b70fb Mon Sep 17 00:00:00 2001 From: Beep6581 Date: Sun, 21 Feb 2016 23:35:48 +0100 Subject: [PATCH 07/10] Fixed old paths in osx scripts and quoted some variables --- rtdata/CMakeLists.txt | 2 +- tools/osx/macosx_bundle.sh | 42 +++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index f38869b96..ad8fe3421 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -103,7 +103,7 @@ if (APPLE) elseif (PROC_BIT_DEPTH MATCHES 64) list (APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64) 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 COMMAND ${MACOSX_BUNDLE_COMMAND} diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 05836905e..81f8f5b87 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -32,20 +32,20 @@ if test ! -d "${CMAKE_BUILD_TYPE}"; then fi # 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: - # 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 - # 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/-/./')" # outputs: 4.2.677 fi # if not specify CMAKE_OSX_DEPLOYMENT_TARGET when compiling, # '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 - MINIMUM_SYSTEM_VERSION=$(sw_vers -productVersion | cut -d. -f-2) + MINIMUM_SYSTEM_VERSION="$(sw_vers -productVersion | cut -d. -f-2)" fi # 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}" 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}"}/gtk-2.0 -ditto --arch ${arch} {"${GTK_PREFIX}"/lib,"${LIB}"}/pango +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}"}/pango message "Removing static libraries and cache files" 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" -PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}"/rtdata/osx +PROJECT_SOURCE_DATA_DIR="${PROJECT_SOURCE_DIR}"/tools/osx # executable loader # note: executable is renamed to '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}" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}"/Info.plist.in "${CONTENTS}"/Info.plist sed -i "" -e "s|@version@|${PROJECT_VERSION}| - s|@shortVersion@|$(echo ${PROJECT_VERSION}| + s|@shortVersion@|${PROJECT_VERSION}| s|@arch@|${arch}|" \ "${CONTENTS}"/Info.plist plutil -convert binary1 "${CONTENTS}"/Info.plist @@ -172,31 +172,31 @@ plutil -convert binary1 "${CONTENTS}"/Info.plist function CreateDmg { - local srcdir=$(mktemp -dt $$) + local srcdir="$(mktemp -dt $$)" message "Preparing disk image sources at ${srcdir}" - mv "${APP}" ${srcdir} - cp AboutThisBuild.txt ${srcdir} - ln -s /Applications ${srcdir} + mv "${APP}" "${srcdir}" + cp AboutThisBuild.txt "${srcdir}" + ln -s /Applications "${srcdir}" # web bookmarks function CreateWebloc { - defaults write ${srcdir}/"$1" URL "$2" - mv ${srcdir}/"$1".{plist,webloc} + defaults write "${srcdir}/$1" URL "$2" + mv "${srcdir}/$1".{plist,webloc} } 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 - dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_VERSION}" - if ! echo ${CMAKE_BUILD_TYPE} | grep -sqi "release"; then + dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}" + if ! echo "${CMAKE_BUILD_TYPE}" | grep -sqi "release"; then dmg_name="${dmg_name}_$(echo ${CMAKE_BUILD_TYPE} | tr '[:upper:]' '[:lower:]')" fi 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" - rm -rf ${srcdir} + rm -rf "${srcdir}" } CreateDmg From 9f29f49f0196ae3bec1dd54971a9d6f221372e36 Mon Sep 17 00:00:00 2001 From: Beep6581 Date: Sun, 21 Feb 2016 23:45:48 +0100 Subject: [PATCH 08/10] Re-formatted tools/osx/macosx_bundle.sh --- tools/osx/macosx_bundle.sh | 102 ++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 81f8f5b87..411b2d331 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -11,24 +11,24 @@ # - GTK_PREFIX function message { - printf '\e[34m-- %s\e[m\n' "$*" + printf '\e[34m-- %s\e[m\n' "$*" } 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 }' } function CheckLink { - GetDependencies "$1" | while read; do - local dest="${LIB}/$(basename "${REPLY}")" - test -f "${dest}" || { ditto --arch ${arch} "${REPLY}" "${dest}"; CheckLink "${dest}"; } - done + GetDependencies "$1" | while read; do + local dest="${LIB}/$(basename "${REPLY}")" + test -f "${dest}" || { ditto --arch ${arch} "${REPLY}" "${dest}"; CheckLink "${dest}"; } + done } # source check if test ! -d "${CMAKE_BUILD_TYPE}"; then - printf "\e[31m${PWD}/${CMAKE_BUILD_TYPE} directory is not found. Please execute 'make install' first.\e[m\n" - exit 1 + printf "\e[31m${PWD}/${CMAKE_BUILD_TYPE} directory is not found. Please execute 'make install' first.\e[m\n" + exit 1 fi # update project version @@ -45,7 +45,7 @@ fi # '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 }')" 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 # check for pango-querymodules. Pango 1.38.0 and above do not include it. @@ -61,8 +61,8 @@ else fi case ${PROC_BIT_DEPTH} in - 64) arch=x86_64;; - 32) arch=i386;; + 64) arch=x86_64;; + 32) arch=i386;; esac cat <<__EOS__ @@ -89,9 +89,9 @@ rm -rf "${APP}" ${PROJECT_NAME}_*.dmg message "Creating bundle container" install -d "${RESOURCES}" \ - "${MACOS}" \ - "${LIB}" \ - "${ETC}" +"${MACOS}" \ +"${LIB}" \ +"${ETC}" message "Copying release files" ditto "${CMAKE_BUILD_TYPE}" "${MACOS}" @@ -113,7 +113,7 @@ cp "${GTK_PREFIX}"/etc/gtk-2.0/im-multipress.conf "${ETC}"/gtk-2.0 "${GTK_PREFIX}"/bin/gdk-pixbuf-query-loaders "${LIB}"/gdk-pixbuf-2.0/*/loaders/*.so > "${ETC}"/gtk-2.0/gdk-pixbuf.loaders "${GTK_PREFIX}"/bin/gtk-query-immodules-2.0 "${LIB}"/gtk-2.0/*/immodules/*.so > "${ETC}"/gtk-2.0/gtk.immodules sed -i "" -e "s|${PWD}|/tmp|" "${ETC}"/gtk-2.0/gdk-pixbuf.loaders \ - "${ETC}"/gtk-2.0/gtk.immodules +"${ETC}"/gtk-2.0/gtk.immodules if [[ "$ExistPangoQuerymodules" = "true" ]]; then "${GTK_PREFIX}"/bin/pango-querymodules "${LIB}"/pango/*/modules/*.so > "${ETC}"/pango/pango.modules sed -i "" -e "s|${PWD}|/tmp|" "${ETC}"/pango/pango.modules @@ -129,23 +129,23 @@ install -d "${MACOS}"/share/themes/Raleigh/gtk-2.0 (cd "${MACOS}"/share/themes/Raleigh/gtk-2.0 && ln -s ../../Clearlooks/gtk-2.0/gtkrc) # fontconfig files (X11 backend only) if otool -L "${EXECUTABLE}" | grep -sq 'libgtk-x11-2.0'; then - message "Installing fontconfig files (Your library is X11 backend. 'FONTCONFIG_PATH' will be set by executable loader.)" - cp -RL "${GTK_PREFIX}"/etc/fonts "${ETC}" + message "Installing fontconfig files (Your library is X11 backend. 'FONTCONFIG_PATH' will be set by executable loader.)" + cp -RL "${GTK_PREFIX}"/etc/fonts "${ETC}" fi # install names find -E "${MACOS}" -type f -regex '.*/(rawtherapee|.*\.(dylib|so))' | while read x; do - message "Modifying install names: ${x}" - { - # id + message "Modifying install names: ${x}" + { + # id case ${x} in *.dylib) echo " install_name_tool -id '@rpath/$(basename "${x}")' '${x}'";; esac # names GetDependencies "${x}" | while read y; do - echo " install_name_tool -change '${y}' '@rpath/$(basename "${y}")' '${x}'" + echo " install_name_tool -change '${y}' '@rpath/$(basename "${y}")' '${x}'" done - } | bash -v +} | bash -v done message "Registering @loader_path into the executable" @@ -164,39 +164,39 @@ cp "${PROJECT_SOURCE_DATA_DIR}"/{rawtherapee,profile}.icns "${RESOURCES}" cp "${PROJECT_SOURCE_DATA_DIR}"/PkgInfo "${CONTENTS}" install -m 0644 "${PROJECT_SOURCE_DATA_DIR}"/Info.plist.in "${CONTENTS}"/Info.plist sed -i "" -e "s|@version@|${PROJECT_VERSION}| - s|@shortVersion@|${PROJECT_VERSION}| - s|@arch@|${arch}|" \ - "${CONTENTS}"/Info.plist +s|@shortVersion@|${PROJECT_VERSION}| +s|@arch@|${arch}|" \ +"${CONTENTS}"/Info.plist plutil -convert binary1 "${CONTENTS}"/Info.plist function CreateDmg { - local srcdir="$(mktemp -dt $$)" - - message "Preparing disk image sources at ${srcdir}" - mv "${APP}" "${srcdir}" - cp AboutThisBuild.txt "${srcdir}" - ln -s /Applications "${srcdir}" - - # web bookmarks - function CreateWebloc { - defaults write "${srcdir}/$1" URL "$2" - mv "${srcdir}/$1".{plist,webloc} - } - CreateWebloc 'RawTherapee Blog' 'http://www.rawtherapee.com' - CreateWebloc 'Online Manual' 'http://rawpedia.rawtherapee.com/' - - # disk image name - dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}" - if ! echo "${CMAKE_BUILD_TYPE}" | grep -sqi "release"; then - dmg_name="${dmg_name}_$(echo ${CMAKE_BUILD_TYPE} | tr '[:upper:]' '[:lower:]')" - fi - - message "Creating disk image" - hdiutil create -format UDBZ -srcdir "${srcdir}" -volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" "${dmg_name}".dmg - - message "Removing disk image caches" - rm -rf "${srcdir}" + local srcdir="$(mktemp -dt $$)" + + message "Preparing disk image sources at ${srcdir}" + mv "${APP}" "${srcdir}" + cp AboutThisBuild.txt "${srcdir}" + ln -s /Applications "${srcdir}" + + # web bookmarks + function CreateWebloc { + defaults write "${srcdir}/$1" URL "$2" + mv "${srcdir}/$1".{plist,webloc} + } + CreateWebloc 'RawTherapee Blog' 'http://www.rawtherapee.com' + CreateWebloc 'Online Manual' 'http://rawpedia.rawtherapee.com/' + + # disk image name + dmg_name="${PROJECT_NAME// /_}_OSX_${MINIMUM_SYSTEM_VERSION}_${PROC_BIT_DEPTH}_${PROJECT_FULL_VERSION}" + if ! echo "${CMAKE_BUILD_TYPE}" | grep -sqi "release"; then + dmg_name="${dmg_name}_$(echo ${CMAKE_BUILD_TYPE} | tr '[:upper:]' '[:lower:]')" + fi + + message "Creating disk image" + hdiutil create -format UDBZ -srcdir "${srcdir}" -volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" "${dmg_name}".dmg + + message "Removing disk image caches" + rm -rf "${srcdir}" } CreateDmg From ca1c1a03d774e1017c8110127fc71814e4be89df Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Sun, 21 Feb 2016 15:44:41 +0100 Subject: [PATCH 09/10] Add build option to enable gprof-based profiling instrumentation. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c1a12c87..20a898dfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,6 +99,7 @@ option (WITH_BZIP "Build with Bzip2 support" ON) option (WITH_MYFILE_MMAP "Build using memory mapped file" ON) option (WITH_LTO "Build with link-time optimizations" OFF) option (WITH_SAN "Build with run-time sanitizer" OFF) +option (WITH_PROF "Build with profiling instrumentation" OFF) option (OPTION_OMP "Build with OpenMP support" ON) option (STRICT_MUTEX "True (recommended): MyMutex will behave like POSIX Mutex; False: MyMutex will behave like POSIX RecMutex; Note: forced to ON for Debug builds" ON) option (TRACE_MYRWMUTEX "Trace RT's custom R/W Mutex (Debug builds only); redirecting std::out to a file is strongly recommended!" OFF) @@ -281,6 +282,12 @@ if (WITH_SAN) SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${WITH_SAN}") endif (WITH_SAN) +if (WITH_PROF) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") +endif (WITH_PROF) + if (OPTION_OMP) find_package(OpenMP) if (OPENMP_FOUND) From e16a505e04ca2b369e919cb1f3c033db66905067 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 22 Feb 2016 19:28:03 +0100 Subject: [PATCH 10/10] Fix broken build without OpenMP --- rtengine/opthelper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/opthelper.h b/rtengine/opthelper.h index 555ea587c..bee97f6b2 100644 --- a/rtengine/opthelper.h +++ b/rtengine/opthelper.h @@ -69,7 +69,7 @@ #define ALIGNED64 #define ALIGNED16 #endif - #ifndef __clang__ - #define _RT_NESTED_OPENMP _OPENMP + #if !defined(__clang__) && defined _OPENMP + #define _RT_NESTED_OPENMP #endif #endif