From e5c00f0a9d18ea9741f1ba4963178fc4adce9bc2 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Wed, 25 Jan 2017 00:18:52 +0100 Subject: [PATCH 01/10] Complete revision to how RawTherapee's version is handled in CMake and in other files, #3628 --- AboutThisBuild.cmake | 67 +++++++++++++---- AboutThisBuild.txt.in | 6 +- CMakeLists.txt | 1 - rtdata/CMakeLists.txt | 54 +++++--------- rtengine/imageio.cc | 2 +- rtengine/procparams.cc | 2 +- rtexif/rtexif.cc | 4 +- rtgui/cacheimagedata.cc | 2 +- rtgui/main.cc | 6 +- rtgui/options.cc | 5 +- rtgui/options.h | 1 - rtgui/rtwindow.cc | 66 +++-------------- rtgui/splash.cc | 5 -- rtgui/version.h.in | 4 +- tools/buildRT | 6 +- tools/compareRT | 4 +- tools/generateReleaseInfo | 82 ++++++++++++++++++--- tools/generateSourceTarball | 33 +++++---- tools/win/InnoSetup/WindowsInnoSetup.iss.in | 57 +++++++------- win.cmake | 3 - 20 files changed, 217 insertions(+), 193 deletions(-) diff --git a/AboutThisBuild.cmake b/AboutThisBuild.cmake index 2163ed0cb..bfb3d6eb5 100644 --- a/AboutThisBuild.cmake +++ b/AboutThisBuild.cmake @@ -22,31 +22,68 @@ if (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) message(STATUS "git command found: ${GIT_CMD}") endif () + # 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. + execute_process(COMMAND ${GIT_CMD} describe --tags --always OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") + + # Get branch name. + # Will return empty if you checked out a commit or tag. Empty string handled later. execute_process(COMMAND ${GIT_CMD} symbolic-ref --short -q HEAD OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") - execute_process(COMMAND ${GIT_CMD} describe --tags --always OUTPUT_VARIABLE GIT_VERSION_WHOLE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") - string(REGEX REPLACE "-g.*" "" GIT_VERSION ${GIT_VERSION_WHOLE}) - string(REPLACE "-" "." GIT_VERSION ${GIT_VERSION}) - execute_process(COMMAND ${GIT_CMD} rev-parse --verify HEAD OUTPUT_VARIABLE GIT_CHANGESET OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") - string(REGEX REPLACE ".*-(.*)-g.*" "\\1" GIT_TAGDISTANCE ${GIT_VERSION_WHOLE}) + + # Get commit hash. + execute_process(COMMAND ${GIT_CMD} rev-parse --short --verify HEAD OUTPUT_VARIABLE GIT_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") + + # Get commit date, YYYY-MM-DD. + execute_process(COMMAND ${GIT_CMD} show -s --format=%cd --date=format:%Y-%m-%d OUTPUT_VARIABLE GIT_COMMIT_DATE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") + + # Get number of commits since tagging. This is what "GIT_DESCRIBE" uses. + # Works when checking out branch, tag or commit. + # Get a list of all tags in repo: + execute_process(COMMAND ${GIT_CMD} tag --merged HEAD OUTPUT_VARIABLE GIT_TAG WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") + # Replace newlines with semicolons so that it can be split: + string(REPLACE "\n" ";" GIT_TAG_LIST "${GIT_TAG}") + execute_process(COMMAND ${GIT_CMD} rev-list --count HEAD --not ${GIT_TAG_LIST} OUTPUT_VARIABLE GIT_COMMITS_SINCE_TAG OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") + + # Get number of commits since branching. + # Works when checking out branch, tag or commit. + execute_process(COMMAND ${GIT_CMD} rev-list --count HEAD --not --tags OUTPUT_VARIABLE GIT_COMMITS_SINCE_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") + + # If user checked-out something which is not a branch, use the description as branch name. + if (GIT_BRANCH STREQUAL "") + set (GIT_BRANCH "${GIT_DESCRIBE}") + endif() + + # 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). + if (GIT_COMMITS_SINCE_TAG STREQUAL "") + set (GIT_NUMERIC_VERSION_BS "0.0.0") + else () + string(REGEX REPLACE "-.*" "" GIT_NUMERIC_VERSION_BS ${GIT_DESCRIBE}) + set(GIT_NUMERIC_VERSION_BS "${GIT_NUMERIC_VERSION_BS}.${GIT_COMMITS_SINCE_TAG}") + endif () + + message(STATUS "Git checkout information:") + message(STATUS " Commit description: ${GIT_DESCRIBE}") + message(STATUS " Branch: ${GIT_BRANCH}") + message(STATUS " Commit: ${GIT_COMMIT}") + message(STATUS " Commit date: ${GIT_COMMIT_DATE}") + message(STATUS " Commits since tag: ${GIT_COMMITS_SINCE_TAG}") + message(STATUS " Commits since branch: ${GIT_COMMITS_SINCE_BRANCH}") + message(STATUS " Version (unreliable): ${GIT_NUMERIC_VERSION_BS}") + if (NOT DEFINED CACHE_NAME_SUFFIX) - string(REGEX REPLACE "-.*" "" CACHE_NAME_SUFFIX ${GIT_VERSION_WHOLE}) + set(CACHE_NAME_SUFFIX "${GIT_DESCRIBE}") message(STATUS "CACHE_NAME_SUFFIX was not defined, it is now \"${CACHE_NAME_SUFFIX}\"") - elseif (CACHE_NAME_SUFFIX STREQUAL "latesttag") - string(REGEX REPLACE "-.*" "" CACHE_NAME_SUFFIX ${GIT_VERSION_WHOLE}) - message(STATUS "CACHE_NAME_SUFFIX was \"latesttag\", it is now \"${CACHE_NAME_SUFFIX}\"") else () message(STATUS "CACHE_NAME_SUFFIX is \"${CACHE_NAME_SUFFIX}\"") endif () + else (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) include("${PROJECT_SOURCE_DIR}/ReleaseInfo.cmake") endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) -if (VERSION_SUFFIX STREQUAL "") - set (GIT_VERSION_SUFFIX "${GIT_VERSION}") -else () - set (GIT_VERSION_SUFFIX "${GIT_VERSION} ${VERSION_SUFFIX}") -endif () - # build version.h from template configure_file ("${PROJECT_SOURCE_DIR}/rtgui/version.h.in" "${CMAKE_BINARY_DIR}/rtgui/version.h") # build AboutThisBuild.txt from template diff --git a/AboutThisBuild.txt.in b/AboutThisBuild.txt.in index b8ae4be1a..ea3269c09 100644 --- a/AboutThisBuild.txt.in +++ b/AboutThisBuild.txt.in @@ -1,6 +1,7 @@ +Version: ${GIT_DESCRIBE} Branch: ${GIT_BRANCH} -Version: ${GIT_VERSION_SUFFIX} -Changeset: ${GIT_CHANGESET} +Commit: ${GIT_COMMIT} +Commit date: ${GIT_COMMIT_DATE} Compiler: ${COMPILER_INFO} Processor: ${PROC_LABEL} System: ${SYSTEM} @@ -11,4 +12,3 @@ Build flags: ${CXX_FLAGS} Link flags: ${LFLAGS} OpenMP support: ${OPTION_OMP} MMAP support: ${WITH_MYFILE_MMAP} - diff --git a/CMakeLists.txt b/CMakeLists.txt index 0173856b1..1ffce3a7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -359,7 +359,6 @@ set(ABOUT_COMMAND_WITH_ARGS ${CMAKE_COMMAND} -DPROC_LABEL:STRING="${PROC_LABEL}" -DPROC_BIT_DEPTH:STRING="${PROC_BIT_DEPTH}" -DBUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DVERSION_SUFFIX:STRING=${VERSION_SUFFIX} -DGTKMM_VERSION:STRING=${GTKMM_VERSION} -DOPTION_OMP:STRING=${OPTION_OMP} -DWITH_MYFILE_MMAP:STRING=${WITH_MYFILE_MMAP}) diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index ad8fe3421..939584061 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -19,43 +19,23 @@ else (WIN32) endif (WIN32) if (WIN32) - if (CMAKE_SIZEOF_VOID_P EQUAL 4) - set(BUILD_BIT_DEPTH 32) - # 32 bits builds has to be installable on 64 bits system, to support WinXP/64. - set(ARCHITECTURE_ALLOWED "x86 x64 ia64") - # installing in 32 bits mode even on 64 bits OS and architecture - set(INSTALL_MODE "") - # set part of the output archive name - set(SYSTEM_NAME "WinXP") - elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(BUILD_BIT_DEPTH 64) - # Restricting the 64 bits builds to 64 bits systems only - set(ARCHITECTURE_ALLOWED "x64 ia64") - # installing in 64 bits mode for all 64 bits processors, even for itanium architecture - set(INSTALL_MODE "x64 ia64") - # set part of the output archive name - set(SYSTEM_NAME "WinVista") - endif (CMAKE_SIZEOF_VOID_P EQUAL 4) - - # If we find ReleaseInfo.cmake we use the info from there and don't need Git to be installed - find_file(REL_INFO_FILE ReleaseInfo.cmake PATHS "${PROJECT_SOURCE_DIR}" NO_DEFAULT_PATH) - if (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) - # we look for the git command in this paths by order of preference - find_file(GIT_CMD git.exe HINTS ENV Path PATH_SUFFIXES ../) - - # Fail if Git is not installed - if (GIT_CMD STREQUAL GIT_CMD-NOTFOUND) - message(FATAL_ERROR "git command not found!") - else () - message(STATUS "git command found: ${GIT_CMD}") - endif () - - execute_process(COMMAND ${GIT_CMD} describe --tags --always OUTPUT_VARIABLE GIT_VERSION_WHOLE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") - string(REGEX REPLACE "-.*" "" GIT_VERSION ${GIT_VERSION_WHOLE}) - string(REGEX REPLACE ".*-(.*)-g.*" "\\1" GIT_TAGDISTANCE ${GIT_VERSION_WHOLE}) - else (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) - include("${PROJECT_SOURCE_DIR}/ReleaseInfo.cmake") - endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set(BUILD_BIT_DEPTH 32) + # 32 bits builds has to be installable on 64 bits system, to support WinXP/64. + set(ARCHITECTURE_ALLOWED "x86 x64 ia64") + # installing in 32 bits mode even on 64 bits OS and architecture + set(INSTALL_MODE "") + # set part of the output archive name + set(SYSTEM_NAME "WinXP") + elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(BUILD_BIT_DEPTH 64) + # Restricting the 64 bits builds to 64 bits systems only + set(ARCHITECTURE_ALLOWED "x64 ia64") + # installing in 64 bits mode for all 64 bits processors, even for itanium architecture + set(INSTALL_MODE "x64 ia64") + # set part of the output archive name + set(SYSTEM_NAME "WinVista") + endif (CMAKE_SIZEOF_VOID_P EQUAL 4) 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}) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 1f170de9a..05684aaa7 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -1351,7 +1351,7 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) } - TIFFSetField (out, TIFFTAG_SOFTWARE, "RawTherapee " VERSION); + TIFFSetField (out, TIFFTAG_SOFTWARE, "RawTherapee " RTVERSION); TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width); TIFFSetField (out, TIFFTAG_IMAGELENGTH, height); TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e96d8ee2f..788c422d6 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -26,7 +26,7 @@ #include "../rtgui/paramsedited.h" #include "../rtgui/options.h" #include -#define APPVERSION VERSION +#define APPVERSION RTVERSION using namespace std; extern Options options; diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 64ddd0ee3..58b60ee3f 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -278,7 +278,7 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring try { kf->set_string ("RT General", "CachePath", options.cacheBaseDir); - kf->set_string ("RT General", "AppVersion", VERSION); + kf->set_string ("RT General", "AppVersion", RTVERSION); kf->set_integer("RT General", "ProcParamsVersion", PPVERSION); kf->set_string ("RT General", "ImageFileName", imageFName); kf->set_string ("RT General", "OutputProfileFileName", profileFName); @@ -2797,7 +2797,7 @@ std::vector ExifManager::getDefaultTIFFTags (TagDirectory* forthis) defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "XResolution"), 300, RATIONAL)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "YResolution"), 300, RATIONAL)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "ResolutionUnit"), 2, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Software"), "RawTherapee " VERSION)); + defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Software"), "RawTherapee " RTVERSION)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Orientation"), 1, SHORT)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "SamplesPerPixel"), 3, SHORT)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "BitsPerSample"), 8, SHORT)); diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index 220dcb2e8..34983d46a 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -203,7 +203,7 @@ int CacheImageData::save (const Glib::ustring& fname) } catch (Glib::Error&) {} keyFile.set_string ("General", "MD5", md5); - keyFile.set_string ("General", "Version", VERSION); // Application's version + keyFile.set_string ("General", "Version", RTVERSION); keyFile.set_boolean ("General", "Supported", supported); keyFile.set_integer ("General", "Format", format); keyFile.set_boolean ("General", "RecentlySaved", recentlySaved); diff --git a/rtgui/main.cc b/rtgui/main.cc index a3b4a60f2..a8ded72e5 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -214,7 +214,7 @@ int main(int argc, char **argv) SetConsoleCtrlHandler( NULL, true ); // Set title of console char consoletitle[128]; - sprintf(consoletitle, "RawTherapee %s Console", VERSION); + sprintf(consoletitle, "RawTherapee %s Console", RTVERSION); SetConsoleTitle(consoletitle); // increase size of screen buffer COORD c; @@ -240,7 +240,7 @@ int main(int argc, char **argv) consoleOpened = true; // printing RT's version in every case, particularly useful for the 'verbose' mode, but also for the batch processing - std::cout << "RawTherapee, version " << VERSION << std::endl; + std::cout << "RawTherapee, version " << RTVERSION << std::endl; std::cout << "WARNING: closing this window will close RawTherapee!" << std::endl << std::endl; } } @@ -263,7 +263,7 @@ int main(int argc, char **argv) if (argc > 1 || options.rtSettings.verbose) { // printing RT's version in all case, particularly useful for the 'verbose' mode, but also for the batch processing - std::cout << "RawTherapee, version " << VERSION << std::endl; + std::cout << "RawTherapee, version " << RTVERSION << std::endl; #ifdef WIN32 std::cout << "WARNING: closing this window will close RawTherapee!" << std::endl << std::endl; #endif diff --git a/rtgui/options.cc b/rtgui/options.cc index 397b5996a..7d3475ef6 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -46,8 +46,7 @@ Glib::ustring Options::rtdir; Glib::ustring Options::cacheBaseDir; Options options; -Glib::ustring versionString = VERSION; -Glib::ustring versionSuffixString = VERSION_SUFFIX; +Glib::ustring versionString = RTVERSION; Glib::ustring paramFileExtension = ".pp3"; Options::Options () @@ -1864,7 +1863,7 @@ int Options::saveToFile (Glib::ustring fname) keyFile.set_string ("General", "Theme", theme); keyFile.set_boolean ("General", "SlimUI", slimUI); keyFile.set_boolean ("General", "UseSystemTheme", useSystemTheme); - keyFile.set_string ("General", "Version", VERSION); + keyFile.set_string ("General", "Version", RTVERSION); keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath); keyFile.set_string ("General", "FlatFieldsPath", rtSettings.flatFieldsPath); keyFile.set_boolean ("General", "Verbose", rtSettings.verbose); diff --git a/rtgui/options.h b/rtgui/options.h index ab0726798..4a556a65c 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -343,7 +343,6 @@ extern Glib::ustring argv0; extern Glib::ustring argv1; extern bool simpleEditor; extern Glib::ustring versionString; -extern Glib::ustring versionSuffixString; extern Glib::ustring paramFileExtension; #endif diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 21bfb0886..e76604baa 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -119,10 +119,6 @@ RTWindow::RTWindow () #endif versionStr = "RawTherapee " + versionString; - if (!versionSuffixString.empty()) { - versionStr += " " + versionSuffixString; - } - set_title_decorated(""); property_allow_shrink() = true; set_default_size(options.windowWidth, options.windowHeight); @@ -309,30 +305,6 @@ RTWindow::~RTWindow() } } -void RTWindow::findVerNumbers(int* numbers, Glib::ustring versionStr) -{ - numbers[0] = numbers[1] = numbers[2] = numbers[3] = 0; - int n = 0; - - for (unsigned int i = 0; i < versionStr.length(); i++) { - char chr = (char)versionStr.at(i); - - if (chr >= '0' && chr <= '9') { - numbers[n] *= 10; - numbers[n] += (int)(chr - '0'); - } else { - n++; - - if (n > 4) { - printf("Error: malformed version string; \"%s\" must follow this format: xx.xx.xx.xx. Admitting it's a developer version...\n", versionStr.c_str()); - // Reseting the already found numbers - numbers[0] = numbers[1] = numbers[2] = numbers[3] = 100; - return; - } - } - } -} - void RTWindow::on_realize () { Gtk::Window::on_realize (); @@ -349,38 +321,20 @@ void RTWindow::on_realize () // Check if first run of this version, then display the Release Notes text if (options.version != versionString) { - int prevVerNbr[4]; - int currVerNbr[4]; - findVerNumbers(prevVerNbr, options.version); - findVerNumbers(currVerNbr, versionString); - // Now we can update the version parameter with the right value + // Update the version parameter with the right value options.version = versionString; - bool showReleaseNotes = false; + splash = new Splash (*this); + splash->set_transient_for (*this); + splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) ); - // Check if the current version is newer - if (currVerNbr[0] > prevVerNbr[0]) { - showReleaseNotes = true; - } else if (currVerNbr[1] > prevVerNbr[1]) { - showReleaseNotes = true; - } else if (currVerNbr[2] > prevVerNbr[2]) { - showReleaseNotes = true; - } - - if (showReleaseNotes) { - // this is a first run! - splash = new Splash (*this); - splash->set_transient_for (*this); - splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) ); - - if (splash->hasReleaseNotes()) { - splash->showReleaseNotes(); - splash->show (); - } else { - delete splash; - splash = nullptr; - } + if (splash->hasReleaseNotes()) { + splash->showReleaseNotes(); + splash->show (); + } else { + delete splash; + splash = nullptr; } } } diff --git a/rtgui/splash.cc b/rtgui/splash.cc index 87408598e..0295a9c9f 100644 --- a/rtgui/splash.cc +++ b/rtgui/splash.cc @@ -27,7 +27,6 @@ extern Glib::ustring argv0; extern Glib::ustring creditsPath; extern Glib::ustring licensePath; extern Glib::ustring versionString; -extern Glib::ustring versionSuffixString; SplashImage::SplashImage () { @@ -70,10 +69,6 @@ bool SplashImage::on_expose_event (GdkEventExpose* event) int w, h; Glib::ustring versionStr(versionString); - if (!versionSuffixString.empty()) { - versionStr += " " + versionSuffixString; - } - version = create_pango_layout (versionStr); version->set_markup("" + versionStr + ""); version->get_pixel_size (w, h); diff --git a/rtgui/version.h.in b/rtgui/version.h.in index 03630075b..39ecd6426 100644 --- a/rtgui/version.h.in +++ b/rtgui/version.h.in @@ -4,9 +4,7 @@ #ifndef _VERSION_ #define _VERSION_ -#define VERSION "${GIT_VERSION}" -#define VERSION_SUFFIX "${VERSION_SUFFIX}" -#define TAGDISTANCE ${GIT_TAGDISTANCE} +#define RTVERSION "${GIT_DESCRIBE}" #define CACHEFOLDERNAME "RawTherapee${CACHE_NAME_SUFFIX}" #endif diff --git a/tools/buildRT b/tools/buildRT index 66ed43894..71370e8df 100755 --- a/tools/buildRT +++ b/tools/buildRT @@ -83,7 +83,7 @@ while getopts "bc:fnp:s:t:uvh?-" opt; do " -s " \ "Suffix of destination build directory, so that if you have applied a patch, say \"dustremoval-1.patch\", and want to have RawTherapee compiled to a folder whose name ends with \"_dustremoval1\", you would set \"-s dustremoval1\" (the underscore is automated)." "" \ " -t \"\"" \ - "Suffix displayed next to the RawTherapee version in the window titlebar. It is recommended that you include the changeset of the newest public commit (the one you would see if you cloned the repository anew) so it is clear which commit you applied the patches to. E.g.:" "-t \": ee72ddbcfd4e + dustremoval-1.patch + mustafa ibrahim\"" "" \ + "Suffix displayed next to the RawTherapee version in the window titlebar. It is recommended that you include the commit of the newest public commit (the one you would see if you cloned the repository anew) so it is clear which commit you applied the patches to. E.g.:" "-t \": ee72ddbcfd4e + dustremoval-1.patch + mustafa ibrahim\"" "" \ " -u" \ "Check for an update of buildRT on GitHub." "" \ " -v" \ @@ -193,7 +193,7 @@ if [[ ! -d "${repo}" ]]; then currentBranch="$(git branch | grep "*" | sed -e 's/.* \+//')" rev="$(git rev-list --all --count)" node="$(git rev-parse --short HEAD)" - printf "\nRepository state:\n Branch: ${currentBranch}\n RawTherapee-${verLatesttag}.${verLatesttagdistance}\n Changeset: ${rev}:${node}\n Latest tag: ${verLatesttag}\n\n" + printf "\nRepository state:\n Branch: ${currentBranch}\n RawTherapee-${verLatesttag}.${verLatesttagdistance}\n Commit: ${rev}:${node}\n Latest tag: ${verLatesttag}\n\n" alert "Repository cloned succesfully. What would you like to do next?" printf "%b" "Repository cloned succesfully.\n" "Press 'q' to quit or any other key to continue... " read -r -n 1 @@ -239,7 +239,7 @@ verLatesttagdistance="$(git describe --tags | sed -e 's/.*-\([0-9]\+\)-.*/\1/')" currentBranch="$(git branch | grep "*" | sed -e 's/.* \+//')" rev="$(git rev-list --all --count)" node="$(git rev-parse --short HEAD)" -printf "\nRepository state:\n Branch: ${currentBranch}\n RawTherapee-${verLatesttag}.${verLatesttagdistance}\n Changeset: ${rev}:${node}\n Latest tag: ${verLatesttag}\n\n" +printf "\nRepository state:\n Branch: ${currentBranch}\n RawTherapee-${verLatesttag}.${verLatesttagdistance}\n Commit: ${rev}:${node}\n Latest tag: ${verLatesttag}\n\n" #--- Print the menu branches=() diff --git a/tools/compareRT b/tools/compareRT index cca18bee6..d701508f7 100755 --- a/tools/compareRT +++ b/tools/compareRT @@ -37,8 +37,8 @@ for rtDir in "${rtDirs[@]}"; do c=1 pp3name=${pp3%.*} pp3name=${pp3name#*/} - v+=("$(grep "Changeset:.*" "${rtDir}/AboutThisBuild.txt" | sed "s/Changeset: //")") - printf "%s\n" "Developing images using RawTherapee changeset ${v[$i]} - ${rtDir}" + v+=("$(grep "Commit:.*" "${rtDir}/AboutThisBuild.txt" | sed "s/Commit: //")") + printf "%s\n" "Developing images using RawTherapee commit ${v[$i]} - ${rtDir}" for img in "${imgs[@]}"; do printf "%s" "${c}/${#imgs[@]} - " "${rtDir}rawtherapee" -o "${outDir}${img%.*}_${v[i]}_${pp3%.*}.tif" -p "${pp3}" -t -Y -c "$img" | grep Processing diff --git a/tools/generateReleaseInfo b/tools/generateReleaseInfo index 79189ad44..b7480e875 100755 --- a/tools/generateReleaseInfo +++ b/tools/generateReleaseInfo @@ -1,12 +1,76 @@ #!/usr/bin/env bash -gitBranch="`git symbolic-ref --short -q HEAD`" -gitVersion="`git describe --tags --always`" -gitLatesttag="`echo $gitVersion | sed 's/-.*//'`" -gitLatesttagdistance="`echo $gitVersion | sed 's/.*-\(.*\)-g.*/\1/'`" -gitChangeset="`git rev-parse --verify HEAD`" +# This script is called from tools/generateSourceTarball +# It is used to generate a ReleaseInfo.cmake file with commit information which +# enables compilation without needing to have git installed. -echo "set(GIT_BRANCH $gitBranch) -set(GIT_VERSION $gitLatesttag.$gitLatesttagdistance) -set(GIT_CHANGESET $gitChangeset) -set(GIT_TAGDISTANCE $gitLatesttagdistance)" > ReleaseInfo.cmake +rm -f ReleaseInfo.cmake +# 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)" + +# Get branch name. +# Will return empty if you checked out a commit or tag. Empty string handled later. +gitBranch="$(git symbolic-ref --short -q HEAD)" + +# Get commit hash. +gitCommit="$(git rev-parse --short --verify HEAD)" + +# Get commit date, YYYY-MM-DD. +gitCommitDate="$(git show -s --format=%cd --date=format:%Y-%m-%d)" + +# 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))" + +# Get number of commits since branching. +# Works when checking out branch, tag or commit. +gitCommitsSinceBranch="$(git rev-list --count HEAD --not --tags)" + +if [[ -z $gitDescribe ]]; then + printf '%s\n' "Failed finding commit description, aborting." + exit 1 +fi +if [[ -z $gitBranch ]]; then + printf '%s\n' "No branch found. Using commit description as branch name." + gitBranch="$gitDescribe" +fi +if [[ -z $gitCommit ]]; then + printf '%s\n' "Failed finding commit hash, aborting." + exit 1 +fi +if [[ -z $gitCommitDate ]]; then + printf '%s\n' "Failed finding commit date, aborting." + exit 1 +fi + +# 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). +if [[ -z $gitCommitsSinceTag ]]; then + gitVersionNumericBS="0.0.0" +else + gitVersionNumericBS="${gitDescribe%%-*}" # Remove everything after first hyphen. + gitVersionNumericBS="${gitVersionNumericBS}.${gitCommitsSinceTag}" # Remove everything until after first hyphen: 5.0 +fi + +cat < ReleaseInfo.cmake +set(GIT_DESCRIBE $gitDescribe) +set(GIT_BRANCH $gitBranch) +set(GIT_COMMIT $gitCommit) +set(GIT_COMMIT_DATE $gitCommitDate) +set(GIT_COMMITS_SINCE_TAG $gitCommitsSinceTag) +set(GIT_COMMITS_SINCE_BRANCH $gitCommitsSinceBranch) +set(GIT_VERSION_NUMERIC_BS $gitVersionNumericBS) +EOF + +printf '%s\n' "Git information extracted:" \ + " Description: ${gitDescribe}" \ + " Branch: ${gitBranch}" \ + " Commit: ${gitCommit}" \ + " Commit date: ${gitCommitDate}" \ + " Commits since tag: ${gitCommitsSinceTag}" \ + " Commits since branch: ${gitCommitsSinceBranch}" \ + " Unreliable verison: ${gitVersionNumericBS}" \ + "" diff --git a/tools/generateSourceTarball b/tools/generateSourceTarball index 98173c00f..022e5646d 100755 --- a/tools/generateSourceTarball +++ b/tools/generateSourceTarball @@ -1,17 +1,24 @@ #!/usr/bin/env bash +# Run from the root of the cloned repository. +# This script is used to generate a source code tarball which includes commit +# metadata so that RawTherapee can be compiled without needing to install git. +# It is meant to be used every time a release is made after creating an +# annotated tag in git. +# It is your job to checkout the tag before running this script. -if [[ ! "$1" ]]; then - printf "%s\n" "Usage: $0 " "Example: $0 4.2" - exit +./tools/generateReleaseInfo +ret=$? +if [[ $ret -ne 0 ]]; then + printf '%s\n' "Something went wrong while running tools/generateReleaseInfo" "Aborting." + exit 1 fi +desc="$(grep GIT_DESCRIBE ReleaseInfo.cmake)" # Gets whole string: set(GIT_DESCRIBE 5.0-gtk2-1-g96bf9129) +desc="${desc#*GIT_DESCRIBE }" # Removes front: 5.0-gtk2-1-g96bf9129) +desc="${desc%)}" # Removes back: 5.0-gtk2-1-g96bf9129 -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 -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" -git checkout +mkdir "rawtherapee-${desc}" || exit 1 +mv ReleaseInfo.cmake "rawtherapee-${desc}" || exit 1 +git archive --format=tar --prefix="rawtherapee-${desc}/" -o "rawtherapee-${desc}.tar" HEAD || exit 1 +tar --append --file="rawtherapee-${desc}.tar" "rawtherapee-${desc}/ReleaseInfo.cmake" || exit 1 +xz -z -9e "rawtherapee-${desc}.tar" || exit 1 +rm -r "rawtherapee-${desc}" diff --git a/tools/win/InnoSetup/WindowsInnoSetup.iss.in b/tools/win/InnoSetup/WindowsInnoSetup.iss.in index 1ba02590d..05fdffefe 100644 --- a/tools/win/InnoSetup/WindowsInnoSetup.iss.in +++ b/tools/win/InnoSetup/WindowsInnoSetup.iss.in @@ -1,30 +1,26 @@ -; Script initially generated by the Inno Setup Script Wizard -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - - - -; This script has to be used by "INNO Setup" (http://www.jrsoftware.org/) to create a setup executable. -; When the "make install" process ends, you can double click on this file to load it into -; INNO Setup, then execute it to create the archive. It expect to find all the dependency libs -; in the root destination folder (the one of the 'make install' process), and the usual 'lib' directory. -; Please note that all *.dll files will be added, so be carefull on which dll are present in the directory -; before compiling the INNO Setup script. +; Script initially generated by the Inno Setup Script Wizard. +; Documentation: http://www.jrsoftware.org/ishelp/ ; -; It also search for and bundles all "rawtherapee*.exe" files, which mean that you can bundle a Release and -; a Debug build at the same time (for conveniency), but official downloads must only contain the Release -; version. +; This script is used by "Inno Setup" (http://www.jrsoftware.org/) to create a +; setup executable. When the "make install" process ends, double-click on this +; file to load it into Inno Setup, then execute it to create the installer. It +; expects to find all the dependency libs in the root destination folder (the +; one from the 'make install' process), and the usual 'lib' directory. +; Note that all *.dll files will be added, so be careful which DLLs are present +; in the folder before running this script. ; -; In all cases, you have to bundle at least one file named "rawtherapee.exe", which INNO Setup will require -; as a default executable to run. +; This script searches for and bundles all "rawtherapee*.exe" files, allowing +; you to bundle a "release" as well as a "debug" version at the same time. +; At least one "rawtherapee.exe" file is required. ; -; This script is configured to check that the operating system's bit depth is the same than the executable file. -; Please note that the ia64 architecture is not supported (is it really necessary?) - - +; This script is configured to check that the operating system's bit depth is +; the same as that of the executable file. +; +; The IA-64 architecture is not supported. #define MyAppName "RawTherapee" -#define MyAppVersion "${GIT_VERSION}" -#define MyAppFullVersion "${GIT_VERSION}.${GIT_TAGDISTANCE}" +#define MyAppVersion "${GIT_DESCRIBE}" +#define MyAppVersionNumeric "${GIT_NUMERIC_VERSION_BS}" #define MyAppPublisher "rawtherapee.com" #define MyAppURL "http://www.rawtherapee.com/" #define MyAppExeName "rawtherapee.exe" @@ -42,18 +38,17 @@ AppId={{128459AB-59A7-430A-8BD0-3D8803D50400} AppName={#MyAppName} AppVersion={#MyAppVersion} -VersionInfoVersion={#MyAppFullVersion} -;AppVerName={#MyAppName} {#MyAppVersion} +VersionInfoVersion={#MyAppVersionNumeric} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} -DefaultDirName={pf}\{#MyAppName}-{#MyAppFullVersion} -DefaultGroupName={#MyAppName} {#MyAppFullVersion} +DefaultDirName={pf}\{#MyAppName}\{#MyAppVersion} +DefaultGroupName={#MyAppName} AllowNoIcons=yes LicenseFile={#MyBuildBasePath}\LICENSE.txt OutputDir={#MyBuildBasePath}\..\ -OutputBaseFilename={#MyAppName}_{#MySystemName}_{#MyBitDepth}_{#MyAppFullVersion} +OutputBaseFilename={#MyAppName}_{#MyAppVersion}_{#MySystemName}_{#MyBitDepth} SetupIconFile={#MySourceBasePath}\rtdata\icons\RT.ico WizardImageFile={#MySourceBasePath}\tools\win\InnoSetup\installerStrip.bmp WizardImageBackColor=$2A2A2A @@ -97,7 +92,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 [Files] -Source: "{#MyBuildBasePath}\rawtherapee.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyBuildBasePath}\rawtherapee*.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#MyBuildBasePath}\camconst.json"; DestDir: "{app}"; Flags: ignoreversion Source: "{#MyBuildBasePath}\dcpprofiles\*"; DestDir: "{app}\dcpprofiles\"; Flags: ignoreversion recursesubdirs createallsubdirs ;Source: "{#MyBuildBasePath}\etc\*"; DestDir: "{app}\etc\"; Flags: ignoreversion recursesubdirs createallsubdirs @@ -122,11 +117,11 @@ Source: "{#MyBuildBasePath}\fonts\DroidSansMonoSlashed.ttf"; DestDir: "{fonts}"; ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] -Name: "{group}\{#MyAppName} {#MyAppFullVersion}"; Filename: "{app}\{#MyAppExeName}" +Name: "{group}\{#MyAppName} {#MyAppVersion}"; Filename: "{app}\{#MyAppExeName}" Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}" Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" -Name: "{commondesktop}\{#MyAppName}{#MyAppFullVersion}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon -Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName} {#MyAppFullVersion}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon +Name: "{commondesktop}\{#MyAppName} {#MyAppVersion}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon +Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName} {#MyAppVersion}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent diff --git a/win.cmake b/win.cmake index b4bbc66a2..2259c144f 100644 --- a/win.cmake +++ b/win.cmake @@ -22,9 +22,6 @@ set(CACHE_NAME_SUFFIX "" CACHE STRING "RawTherapee's cache folder suffix (leave # This line will let you chose the target number, and the associated processor set(PROC_TARGET_NUMBER 0 CACHE STRING "Target Processor") -# To add a version suffix (text) after the standard version number, e.g. for patched builds -set(VERSION_SUFFIX "" CACHE STRING "For patched builds, use this string to add a version suffix (text); KEEP EMPTY FOR RELEASE BULDS") - # If you want to force the target processor name when PROC_TARGET_NUMBER = 0 or 2, # uncomment the next line and replace labelWithoutQuotes by its value #set (PROC_LABEL labelWithoutQuotes CACHE STRING "Target Processor label") From 77d5f8779bf183080a837a709ad6d9c2b1e34569 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sat, 28 Jan 2017 02:29:22 +0100 Subject: [PATCH 02/10] Cleaned up CMake logic thanks to Hombre, #3628 --- CMakeLists.txt | 6 +++--- AboutThisBuild.cmake => UpdateInfo.cmake | 22 ++++++++++++++++++++++ rtdata/CMakeLists.txt | 19 ------------------- rtengine/CMakeLists.txt | 2 +- rtexif/CMakeLists.txt | 2 +- rtgui/CMakeLists.txt | 2 +- 6 files changed, 28 insertions(+), 25 deletions(-) rename AboutThisBuild.cmake => UpdateInfo.cmake (82%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ffce3a7e..9c4e74def 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -331,7 +331,7 @@ if (OUT_OF_SOURCE_BUILD) endforeach(f) endif () -## BEGIN: Generating AboutThisBuild.txt +## BEGIN: Create AboutThisBuild.txt and other version-dependent files. # set the bit number information of the platform if (CMAKE_SIZEOF_VOID_P EQUAL 4) set(PROC_BIT_DEPTH 32 bits) @@ -382,9 +382,9 @@ endif (WIN32) list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/AboutThisBuild.cmake") -add_custom_target(AboutFile ALL +add_custom_target(UpdateInfo ALL COMMAND ${ABOUT_COMMAND_WITH_ARGS} - COMMENT "Creating the about file") + COMMENT "Creating AboutThisBuild.txt and other version-dependent files") ## END: Generating AboutThisBuild.txt diff --git a/AboutThisBuild.cmake b/UpdateInfo.cmake similarity index 82% rename from AboutThisBuild.cmake rename to UpdateInfo.cmake index bfb3d6eb5..40cdab6d6 100644 --- a/AboutThisBuild.cmake +++ b/UpdateInfo.cmake @@ -84,6 +84,28 @@ else (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) include("${PROJECT_SOURCE_DIR}/ReleaseInfo.cmake") endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) +if (WIN32) + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set(BUILD_BIT_DEPTH 32) + # 32 bits builds has to be installable on 64 bits system, to support WinXP/64. + set(ARCHITECTURE_ALLOWED "x86 x64 ia64") + # installing in 32 bits mode even on 64 bits OS and architecture + set(INSTALL_MODE "") + # set part of the output archive name + set(SYSTEM_NAME "WinXP") + elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(BUILD_BIT_DEPTH 64) + # Restricting the 64 bits builds to 64 bits systems only + set(ARCHITECTURE_ALLOWED "x64 ia64") + # installing in 64 bits mode for all 64 bits processors, even for itanium architecture + set(INSTALL_MODE "x64 ia64") + # set part of the output archive name + set(SYSTEM_NAME "WinVista") + endif (CMAKE_SIZEOF_VOID_P EQUAL 4) + + configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/../tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss") +endif (WIN32) + # build version.h from template configure_file ("${PROJECT_SOURCE_DIR}/rtgui/version.h.in" "${CMAKE_BINARY_DIR}/rtgui/version.h") # build AboutThisBuild.txt from template diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index 939584061..b3f44a68c 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -19,25 +19,6 @@ else (WIN32) endif (WIN32) if (WIN32) - if (CMAKE_SIZEOF_VOID_P EQUAL 4) - set(BUILD_BIT_DEPTH 32) - # 32 bits builds has to be installable on 64 bits system, to support WinXP/64. - set(ARCHITECTURE_ALLOWED "x86 x64 ia64") - # installing in 32 bits mode even on 64 bits OS and architecture - set(INSTALL_MODE "") - # set part of the output archive name - set(SYSTEM_NAME "WinXP") - elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(BUILD_BIT_DEPTH 64) - # Restricting the 64 bits builds to 64 bits systems only - set(ARCHITECTURE_ALLOWED "x64 ia64") - # installing in 64 bits mode for all 64 bits processors, even for itanium architecture - set(INSTALL_MODE "x64 ia64") - # set part of the output archive name - set(SYSTEM_NAME "WinVista") - endif (CMAKE_SIZEOF_VOID_P EQUAL 4) - - 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) diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 477ccecae..dbab1dc2d 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -29,7 +29,7 @@ set (RTENGINESOURCEFILES colortemp.cc curves.cc flatcurves.cc diagonalcurves.cc include_directories (BEFORE "${CMAKE_CURRENT_BINARY_DIR}") add_library (rtengine ${RTENGINESOURCEFILES}) -add_dependencies (rtengine AboutFile) +add_dependencies (rtengine UpdateInfo) #It may be nice to store library version too IF (BUILD_SHARED_LIBS) diff --git a/rtexif/CMakeLists.txt b/rtexif/CMakeLists.txt index a2e713ed7..7dad67006 100644 --- a/rtexif/CMakeLists.txt +++ b/rtexif/CMakeLists.txt @@ -1,5 +1,5 @@ add_library (rtexif rtexif.cc stdattribs.cc nikonattribs.cc canonattribs.cc pentaxattribs.cc fujiattribs.cc sonyminoltaattribs.cc olympusattribs.cc kodakattribs.cc) -add_dependencies (rtexif AboutFile) +add_dependencies (rtexif UpdateInfo) IF (WIN32) set_target_properties (rtexif PROPERTIES COMPILE_FLAGS " -ffast-math -fexpensive-optimizations") diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index ad896041f..be2186e63 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -62,7 +62,7 @@ endif (WIN32) configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h") add_executable (rth ${EXTRA_SRC} ${BASESOURCEFILES}) -add_dependencies (rth AboutFile) +add_dependencies (rth UpdateInfo) set_target_properties (rth PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS}" OUTPUT_NAME rawtherapee) #target_link_libraries (rth rtengine ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${TIFF_LIBRARIES} ${EXTRA_LIB} ${GOBJECT_LIBRARIES} ${GTHREAD_LIBRARIES} From cded30dcbbdad0b7976b78a323395cabf3d28b5e Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sat, 28 Jan 2017 02:32:31 +0100 Subject: [PATCH 03/10] Fix previous commit: Update old name. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c4e74def..71c628635 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,7 +380,7 @@ else (WIN32) -DCOMPILER_INFO:STRING=${COMPILER_INFO}) endif (WIN32) -list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/AboutThisBuild.cmake") +list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/UpdateInfo.cmake") add_custom_target(UpdateInfo ALL COMMAND ${ABOUT_COMMAND_WITH_ARGS} From 2356af62465b3b9fe99bd5a89b91e9fbb8c89a83 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sat, 28 Jan 2017 03:03:15 +0100 Subject: [PATCH 04/10] Bugfix of paths in UpdateInfo.cmake --- UpdateInfo.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UpdateInfo.cmake b/UpdateInfo.cmake index 40cdab6d6..1192294d1 100644 --- a/UpdateInfo.cmake +++ b/UpdateInfo.cmake @@ -103,7 +103,7 @@ if (WIN32) set(SYSTEM_NAME "WinVista") endif (CMAKE_SIZEOF_VOID_P EQUAL 4) - configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/../tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss") + configure_file ("${PROJECT_SOURCE_DIR}/tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_BINARY_DIR}/rtdata/WindowsInnoSetup.iss") endif (WIN32) # build version.h from template From 52dca96723965e6a8f954c29ef156a6cf5da23b1 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sat, 28 Jan 2017 22:39:50 +0100 Subject: [PATCH 05/10] Bigfix of InnoSetup parameters (#3628) --- CMakeLists.txt | 4 +++- UpdateInfo.cmake | 6 +++--- tools/win/InnoSetup/WindowsInnoSetup.iss.in | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71c628635..c412f591f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -367,7 +367,9 @@ if (WIN32) list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Windows -DCXX_FLAGS:STRING="${CXX_FLAGS}" -DLFLAGS:STRING="${LFLAGS}" - -DCOMPILER_INFO:STRING="${COMPILER_INFO}") + -DCOMPILER_INFO:STRING="${COMPILER_INFO}" + -DCMAKE_INSTALL_PREFIX:STRING="${CMAKE_INSTALL_PREFIX}" + -DBIT_DEPTH:STRING="${CMAKE_SIZEOF_VOID_P}") elseif (APPLE) list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Apple -DCXX_FLAGS:STRING=${CXX_FLAGS} diff --git a/UpdateInfo.cmake b/UpdateInfo.cmake index 1192294d1..ff0f12482 100644 --- a/UpdateInfo.cmake +++ b/UpdateInfo.cmake @@ -85,7 +85,7 @@ else (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) if (WIN32) - if (CMAKE_SIZEOF_VOID_P EQUAL 4) + if (BIT_DEPTH EQUAL 4) set(BUILD_BIT_DEPTH 32) # 32 bits builds has to be installable on 64 bits system, to support WinXP/64. set(ARCHITECTURE_ALLOWED "x86 x64 ia64") @@ -93,7 +93,7 @@ if (WIN32) set(INSTALL_MODE "") # set part of the output archive name set(SYSTEM_NAME "WinXP") - elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) + elseif (BIT_DEPTH EQUAL 8) set(BUILD_BIT_DEPTH 64) # Restricting the 64 bits builds to 64 bits systems only set(ARCHITECTURE_ALLOWED "x64 ia64") @@ -101,7 +101,7 @@ if (WIN32) set(INSTALL_MODE "x64 ia64") # set part of the output archive name set(SYSTEM_NAME "WinVista") - endif (CMAKE_SIZEOF_VOID_P EQUAL 4) + endif (BIT_DEPTH EQUAL 4) configure_file ("${PROJECT_SOURCE_DIR}/tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_BINARY_DIR}/rtdata/WindowsInnoSetup.iss") endif (WIN32) diff --git a/tools/win/InnoSetup/WindowsInnoSetup.iss.in b/tools/win/InnoSetup/WindowsInnoSetup.iss.in index 05fdffefe..82aa7a60d 100644 --- a/tools/win/InnoSetup/WindowsInnoSetup.iss.in +++ b/tools/win/InnoSetup/WindowsInnoSetup.iss.in @@ -74,7 +74,6 @@ Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl" Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" -Name: "nepali"; MessagesFile: "compiler:Languages\Nepali.islu" Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" From f1e253b176139ed83db4348a018e665adb1206b5 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sun, 29 Jan 2017 20:53:03 +0100 Subject: [PATCH 06/10] Git version fix for macOS files. --- tools/osx/Info.plist.in | 6 +++--- tools/osx/macosx_bundle.sh | 37 +++++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/tools/osx/Info.plist.in b/tools/osx/Info.plist.in index 5b08d63a1..e78db0cc4 100644 --- a/tools/osx/Info.plist.in +++ b/tools/osx/Info.plist.in @@ -111,7 +111,7 @@ CFBundleExecutable rawtherapee CFBundleGetInfoString - @version@, Copyright © 2004-2010 Gábor Horváth, 2010-2016 RT dev team + @version@, Copyright © 2004-2010 Gábor Horváth, 2010-2017 RawTherapee Development Team CFBundleIconFile rawtherapee.icns CFBundleIdentifier @@ -127,7 +127,7 @@ CFBundleSignature ???? CFBundleVersion - @version@ + @shortVersion@ LSExecutableArchitectures @arch@ @@ -135,7 +135,7 @@ NSHighResolutionCapable NSHumanReadableCopyright - Copyright © 2004-2013 Gábor Horváth + Copyright © 2004-2010 Gábor Horváth, 2010-2017 RawTherapee Development Team UTExportedTypeDeclarations diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 2803396ba..89e0c23b0 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -33,12 +33,33 @@ fi # update project version 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_FULL_VERSION="$(git describe --tags --always | sed 's/-g.*//')_$(git symbolic-ref --short -q HEAD)" - # outputs: 4.2-677-g904467b_master - # 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 + ### 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). + if [[ -z $gitCommitsSinceTag ]]; then + gitVersionNumericBS="0.0.0" + else + gitVersionNumericBS="${gitDescribe%%-*}" # Remove everything after first hyphen. + gitVersionNumericBS="${gitVersionNumericBS}.${gitCommitsSinceTag}" # Remove everything until after first hyphen: 5.0 + fi + ### Copy end. + + PROJECT_FULL_VERSION="$gitDescribe" + PROJECT_VERSION="$gitVersionNumericBS" + fi # if not specify CMAKE_OSX_DEPLOYMENT_TARGET when compiling, @@ -85,7 +106,7 @@ ETC="${MACOS}"/etc EXECUTABLE="${MACOS}"/rawtherapee message "Removing old files" -rm -rf "${APP}" ${PROJECT_NAME}_*.dmg +rm -rf "${APP}" "${PROJECT_NAME}_*.dmg" message "Creating bundle container" install -d "${RESOURCES}" \ @@ -163,7 +184,7 @@ install -m 0755 "${PROJECT_SOURCE_DATA_DIR}"/executable_loader.in "${MACOS}"/raw 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}| +sed -i "" -e "s|@version@|${PROJECT_FULL_VERSION}| s|@shortVersion@|${PROJECT_VERSION}| s|@arch@|${arch}|" \ "${CONTENTS}"/Info.plist From bc19897bc782cbee7994a1eaa3769de834a8f1e1 Mon Sep 17 00:00:00 2001 From: Hombre Date: Mon, 30 Jan 2017 01:32:36 +0100 Subject: [PATCH 07/10] Changed AppId value for InnoSetup installer (#3628) --- tools/win/InnoSetup/WindowsInnoSetup.iss.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/win/InnoSetup/WindowsInnoSetup.iss.in b/tools/win/InnoSetup/WindowsInnoSetup.iss.in index 82aa7a60d..55305d5f0 100644 --- a/tools/win/InnoSetup/WindowsInnoSetup.iss.in +++ b/tools/win/InnoSetup/WindowsInnoSetup.iss.in @@ -35,7 +35,7 @@ ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{128459AB-59A7-430A-8BD0-3D8803D50400} +AppId={#MyAppName}{#MyAppVersion} AppName={#MyAppName} AppVersion={#MyAppVersion} VersionInfoVersion={#MyAppVersionNumeric} From 139df58adeb46792500dc2f283731d334177a919 Mon Sep 17 00:00:00 2001 From: Beep6581 Date: Mon, 30 Jan 2017 22:47:27 +0100 Subject: [PATCH 08/10] Unimportant typo fixed --- tools/generateReleaseInfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generateReleaseInfo b/tools/generateReleaseInfo index b7480e875..fa71638bd 100755 --- a/tools/generateReleaseInfo +++ b/tools/generateReleaseInfo @@ -72,5 +72,5 @@ printf '%s\n' "Git information extracted:" \ " Commit date: ${gitCommitDate}" \ " Commits since tag: ${gitCommitsSinceTag}" \ " Commits since branch: ${gitCommitsSinceBranch}" \ - " Unreliable verison: ${gitVersionNumericBS}" \ + " Unreliable version: ${gitVersionNumericBS}" \ "" From 03919242b1407dbc36ba5587b85f90b5c2300734 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 30 Jan 2017 22:50:21 +0100 Subject: [PATCH 09/10] Consistency between generateReleaseInfo and UpdateInfo.cmake --- tools/generateReleaseInfo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/generateReleaseInfo b/tools/generateReleaseInfo index fa71638bd..ee3493e70 100755 --- a/tools/generateReleaseInfo +++ b/tools/generateReleaseInfo @@ -65,12 +65,12 @@ set(GIT_COMMITS_SINCE_BRANCH $gitCommitsSinceBranch) set(GIT_VERSION_NUMERIC_BS $gitVersionNumericBS) EOF -printf '%s\n' "Git information extracted:" \ - " Description: ${gitDescribe}" \ +printf '%s\n' "Git checkout information:" \ + " Commit description: ${gitDescribe}" \ " Branch: ${gitBranch}" \ " Commit: ${gitCommit}" \ " Commit date: ${gitCommitDate}" \ " Commits since tag: ${gitCommitsSinceTag}" \ " Commits since branch: ${gitCommitsSinceBranch}" \ - " Unreliable version: ${gitVersionNumericBS}" \ + " Version (unreliable): ${gitVersionNumericBS}" \ "" From 06c820ea8ab15a8d7e2254c6eaa5895d029fd0b2 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 30 Jan 2017 23:11:14 +0100 Subject: [PATCH 10/10] Release notes Package Maintainers section updated. --- RELEASE_NOTES.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index bfb32545d..38f8f82bc 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -37,9 +37,10 @@ New Features: News Relevant to Package Maintainers ------------------------------------ -- Branch "master" uses GTK2, branch "gtk3" requires GTK+ >=3.16. -- There are known bugs using GTK+ versions 3.20-3.22 where scrollbars may appear stuck (issue #3545) and where the Retinex tool's "Gain and Offset" panel may appear under the "Transmission" panel (issue #3525) until the user hovers the mouse cursor over a curve button. For this reason we recommend using GTK+ 3.16-3.18 if possible. +- Branch "master" uses GTK2, branch "gtk3" requires GTK+ >=3.16. There are known bugs using GTK+ versions 3.20-3.22 where scrollbars may appear stuck (issue #3545) and where the Retinex tool's "Gain and Offset" panel may appear under the "Transmission" panel (issue #3525) until the user hovers the mouse cursor over a curve button. For this reason we recommend using GTK+ 3.16-3.18 if possible. - RawTherapee 5 requires GCC-4.9 or higher, or Clang. +- Do not use -ffast-math +- Use -o3 - Use -DCMAKE_CXX_FLAGS="-std=c++11" - For stable builds (RT5) use -DCACHE_NAME_SUFFIX="" - For development builds use -DCACHE_NAME_SUFFIX="5-dev"