Merge lp:~stellarium/stellarium/splash-icon into lp:stellarium

Proposed by Alexander Wolf
Status: Superseded
Proposed branch: lp:~stellarium/stellarium/splash-icon
Merge into: lp:stellarium
Diff against target: 238 lines (+88/-31)
7 files modified
CMakeLists.txt (+23/-8)
cmake/stellarium.iss.cmake (+1/-1)
cmake/stellarium.rc.cmake (+1/-1)
data/CMakeLists.txt (+52/-7)
data/mainRes.qrc (+0/-1)
src/core/StelUtils.cpp (+5/-9)
src/main.cpp (+6/-4)
To merge this branch: bzr merge lp:~stellarium/stellarium/splash-icon
Reviewer Review Type Date Requested Status
gzotti Approve
Review via email: mp+296129@code.launchpad.net

This proposal supersedes a proposal from 2016-05-30.

This proposal has been superseded by a proposal from 2016-05-31.

Description of the change

This feature is introducing cosmetic difference between releases and packages for testing.

To post a comment you must log in.
Revision history for this message
gzotti (georg-zotti) wrote : Posted in a previous version of this proposal

Do I see it right: You would have to specify BZR_REVISION at cmake configure time, manually? This is far from really applicable. In most cases when building with qtcreator, you don't even see the cmake options.

Is it possible to call bzr in the configuration phase (in the cmake script) to create a header? E.g.

http://doc.bazaar.canonical.com/latest/en/user-guide/version_info.html

indicates the following:

bzr version-info --custom \
     --template="#define VERSION_INFO \"Project 1.2.3 (r{revno})\"\n" \
     > version_info.h

This could be included then in main.cpp and StelUtils.cpp.

In addition, for this scenario (and IMHO this should be done in any case), STELLARIUM_RELEASE_BUILD should be 0 by default and only set to 1 for real builds.

review: Needs Information
Revision history for this message
Alexander Wolf (alexwolf) wrote : Posted in a previous version of this proposal

1) EXECUTE_PROCESS available since CMake 3.0.2 and previous version of determination of revision number will cause a broken compile of source code

2) Windows installer will never install release 0.15.0.0 because any snapshot has more high version, e.g. 0.15.0.8410

Revision history for this message
gzotti (georg-zotti) wrote : Posted in a previous version of this proposal

(1) You mean, we should not use execute_process to keep cmake 2.8 compatibility? Sorry.
(2) Oops, I never saw the installer checks this. (I can install whatever version I want!) Maybe Stellarium dev.version should not be called 0.15.0.x before release of 0.15.0? Something like 0.14.9?
In any case, PACKAGE_VERSION_RC with a bzr string in front breaks compilation on Windows, the components must be integers.

Revision history for this message
Alexander Wolf (alexwolf) wrote : Posted in a previous version of this proposal

(1) I added support of both versions now, it's fixed already
(2) Wrong place of editing :)

I changed of numbering of versions now. And we need a new rule for numbering of versions at the moment.

Revision history for this message
gzotti (georg-zotti) wrote :

Good! It builds, and I think this numbering system with keeping high 0.14.X is better. Even a release could have a bzr number IMHO, but I don't insist on that.
What about showing branch name (i.e. name of branch directory) on the dev splash? It may be extracted as last part of CMAKE_CURRENT_SOURCE_DIR. Only releases should not show branch names.

But I came to one thought: Is there a scenario of building without BZR connection? Do we offer Tarball downloads? There would have to be a workaround. (The execute_process line can be enriched with fallbacks, or BZR_REVISION must be tested.) Or some header/config must be created before wrapping the tar. :-(

review: Needs Information
8413. By Alexander Wolf

Added branch info

Revision history for this message
Alexander Wolf (alexwolf) wrote :

Forced set CMAKE_BUILD_TYPE=Release and STELLARIUM_RELEASE_BUILD=1 in tarball of source code and no problems

Revision history for this message
gzotti (georg-zotti) wrote :

Ah right. Perfect, and thanks for the branch name :-)

review: Approve

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-05-28 18:04:32 +0000
+++ CMakeLists.txt 2016-05-31 18:55:35 +0000
@@ -19,8 +19,8 @@
19########### Project name ###########19########### Project name ###########
20PROJECT(Stellarium)20PROJECT(Stellarium)
21SET(STELLARIUM_MAJOR "0")21SET(STELLARIUM_MAJOR "0")
22SET(STELLARIUM_MINOR "15")22SET(STELLARIUM_MINOR "14")
23SET(STELLARIUM_PATCH "0")23SET(STELLARIUM_PATCH "90")
24SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}")24SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}")
25SET(PACKAGE stellarium)25SET(PACKAGE stellarium)
26SET(COPYRIGHT_YEARS "2000-2016")26SET(COPYRIGHT_YEARS "2000-2016")
@@ -39,6 +39,11 @@
39 SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None Debug GProf Valgrind Release RelWithDebInfo MinSizeRel." FORCE)39 SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None Debug GProf Valgrind Release RelWithDebInfo MinSizeRel." FORCE)
40ENDIF()40ENDIF()
4141
42SET(STELLARIUM_RELEASE_BUILD 0 CACHE BOOL "Set 1 to build as an official release (0 for development snapshots).")
43IF(STELLARIUM_RELEASE_BUILD)
44 ADD_DEFINITIONS(-DSTELLARIUM_RELEASE_BUILD)
45ENDIF()
46
42# GZ I had seen that some releases (e.g. 0.13.3 Ubuntu/ARM) were not compiled with NDEBUG defined. Maybe a bug in compilatation setup? 47# GZ I had seen that some releases (e.g. 0.13.3 Ubuntu/ARM) were not compiled with NDEBUG defined. Maybe a bug in compilatation setup?
43# Hint from http://public.kitware.com/Bug/view.php?id=14292. Actually fixed with CMake 2.8.12, but maybe we have other effects?48# Hint from http://public.kitware.com/Bug/view.php?id=14292. Actually fixed with CMake 2.8.12, but maybe we have other effects?
44if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")49if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -135,10 +140,6 @@
135 ADD_DEFINITIONS(-DENABLE_NLS)140 ADD_DEFINITIONS(-DENABLE_NLS)
136ENDIF()141ENDIF()
137142
138SET(STELLARIUM_RELEASE_BUILD 1 CACHE BOOL "Flag this build as an official release.")
139IF(STELLARIUM_RELEASE_BUILD)
140 ADD_DEFINITIONS(-DSTELLARIUM_RELEASE_BUILD)
141ENDIF()
142143
143# Activate media support144# Activate media support
144SET(ENABLE_MEDIA 1 CACHE BOOL "Define whether media support should be activated.")145SET(ENABLE_MEDIA 1 CACHE BOOL "Define whether media support should be activated.")
@@ -287,11 +288,15 @@
287288
288########### Get revision number for non-release builds ###########289########### Get revision number for non-release builds ###########
289IF(NOT STELLARIUM_RELEASE_BUILD)290IF(NOT STELLARIUM_RELEASE_BUILD)
290 #Hack until CMake detection for Bazaar is finished291 # Hack until CMake detection for Bazaar is finished
292 EXECUTE_PROCESS(COMMAND bzr revno WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} TIMEOUT 30 OUTPUT_VARIABLE BZR_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
293 EXECUTE_PROCESS(COMMAND bzr version-info --custom --template={branch_nick} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} TIMEOUT 30 OUTPUT_VARIABLE BZR_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)
291 IF(BZR_REVISION)294 IF(BZR_REVISION)
292 SET(PACKAGE_VERSION "bzr${BZR_REVISION}")295 SET(PACKAGE_VERSION "${VERSION}.${BZR_REVISION}")
293 ADD_DEFINITIONS(-DBZR_REVISION="${BZR_REVISION}")296 ADD_DEFINITIONS(-DBZR_REVISION="${BZR_REVISION}")
297 ADD_DEFINITIONS(-DBZR_BRANCH="${BZR_BRANCH}")
294 ENDIF()298 ENDIF()
299# MESSAGE(STATUS "Branch: ${BZR_BRANCH}; Revision: ${BZR_REVISION}")
295 IF(STELLARIUM_VERSION)300 IF(STELLARIUM_VERSION)
296 SET(PACKAGE_VERSION "${STELLARIUM_VERSION}")301 SET(PACKAGE_VERSION "${STELLARIUM_VERSION}")
297 ADD_DEFINITIONS(-DSTELLARIUM_VERSION="${STELLARIUM_VERSION}")302 ADD_DEFINITIONS(-DSTELLARIUM_VERSION="${STELLARIUM_VERSION}")
@@ -301,6 +306,16 @@
301306
302IF(WIN32)307IF(WIN32)
303 #######################################################308 #######################################################
309 ### Generate icon file name ###
310 #######################################################
311
312 IF(STELLARIUM_RELEASE_BUILD)
313 SET(PACKAGE_ICON "stellarium")
314 ELSE()
315 SET(PACKAGE_ICON "stellarium-gray")
316 ENDIF()
317
318 #######################################################
304 ### Generate a VersionInfo file ###319 ### Generate a VersionInfo file ###
305 #######################################################320 #######################################################
306321
307322
=== modified file 'cmake/stellarium.iss.cmake'
--- cmake/stellarium.iss.cmake 2016-05-28 18:04:32 +0000
+++ cmake/stellarium.iss.cmake 2016-05-31 18:55:35 +0000
@@ -19,7 +19,7 @@
19AppUpdatesURL=http://www.stellarium.org/19AppUpdatesURL=http://www.stellarium.org/
20VersionInfoVersion=@PACKAGE_VERSION@20VersionInfoVersion=@PACKAGE_VERSION@
21MinVersion=0,@MIN_VERSION@21MinVersion=0,@MIN_VERSION@
22SetupIconFile=@CMAKE_SOURCE_DIR@\data\stellarium.ico22SetupIconFile=@CMAKE_SOURCE_DIR@\data\@PACKAGE_ICON@.ico
23OutputBaseFilename=stellarium-@PACKAGE_VERSION@-@ISS_PACKAGE_PLATFORM@23OutputBaseFilename=stellarium-@PACKAGE_VERSION@-@ISS_PACKAGE_PLATFORM@
24OutputDir=@CMAKE_SOURCE_DIR@\installers24OutputDir=@CMAKE_SOURCE_DIR@\installers
25; In 64-bit mode, {pf} is equivalent to {pf64},25; In 64-bit mode, {pf} is equivalent to {pf64},
2626
=== modified file 'cmake/stellarium.rc.cmake'
--- cmake/stellarium.rc.cmake 2016-05-28 18:04:32 +0000
+++ cmake/stellarium.rc.cmake 2016-05-31 18:55:35 +0000
@@ -1,4 +1,4 @@
1stellarium-icon ICON "@CMAKE_SOURCE_DIR@/data/stellarium.ico"1stellarium-icon ICON "@CMAKE_SOURCE_DIR@/data/@PACKAGE_ICON@.ico"
21 VERSIONINFO21 VERSIONINFO
3FILEVERSION @PACKAGE_VERSION_RC@3FILEVERSION @PACKAGE_VERSION_RC@
4PRODUCTVERSION @PACKAGE_VERSION_RC@4PRODUCTVERSION @PACKAGE_VERSION_RC@
55
=== modified file 'data/CMakeLists.txt'
--- data/CMakeLists.txt 2016-05-28 18:04:32 +0000
+++ data/CMakeLists.txt 2016-05-31 18:55:35 +0000
@@ -1,6 +1,56 @@
1
1########### install files ###############2########### install files ###############
23INSTALL(FILES ssystem.ini ssystem_1000comets.ini base_locations.bin.gz DejaVuSans.ttf default_config.ini DejaVuSansMono.ttf iso639-1.utf8 iso3166-1-alpha-2.utf8 countryCodes.dat constellations_boundaries.dat DESTINATION share/${PACKAGE}/data)
3INSTALL(FILES stellarium.ico ssystem.ini ssystem_1000comets.ini base_locations.bin.gz DejaVuSans.ttf default_config.ini DejaVuSansMono.ttf iso639-1.utf8 iso3166-1-alpha-2.utf8 countryCodes.dat constellations_boundaries.dat DESTINATION share/${PACKAGE}/data)4
5########### splash target ##############
6ADD_CUSTOM_TARGET(splash ALL)
7SET(_splashFile splash.png)
8SET(_splashDstFile ${CMAKE_CURRENT_BINARY_DIR}/${_splashFile})
9
10IF(NOT STELLARIUM_RELEASE_BUILD)
11 GET_FILENAME_COMPONENT(_splashSrcFile splash-gray.png ABSOLUTE)
12ELSE()
13 GET_FILENAME_COMPONENT(_splashSrcFile splash.png ABSOLUTE)
14ENDIF()
15
16ADD_CUSTOM_COMMAND(
17 TARGET splash
18 COMMAND ${CMAKE_COMMAND} -E copy ${_splashSrcFile} ${_splashDstFile}
19)
20
21########### icon target ###############
22ADD_CUSTOM_TARGET(icon ALL)
23IF(MACOSX)
24 SET(_iconFile Icon.icns)
25 IF(NOT STELLARIUM_RELEASE_BUILD)
26 GET_FILENAME_COMPONENT(_iconSrcFile IconGray.icns ABSOLUTE)
27 ELSE()
28 GET_FILENAME_COMPONENT(_iconSrcFile Icon.icns ABSOLUTE)
29 ENDIF()
30ELSE()
31 SET(_iconFile stellarium.ico)
32 IF(NOT STELLARIUM_RELEASE_BUILD)
33 GET_FILENAME_COMPONENT(_iconSrcFile stellarium-gray.ico ABSOLUTE)
34 ELSE()
35 GET_FILENAME_COMPONENT(_iconSrcFile stellarium.ico ABSOLUTE)
36 ENDIF()
37ENDIF()
38
39SET(_iconDstFile ${CMAKE_CURRENT_BINARY_DIR}/${_iconFile})
40ADD_CUSTOM_COMMAND(
41 TARGET icon
42 COMMAND ${CMAKE_COMMAND} -E copy ${_iconSrcFile} ${_iconDstFile}
43)
44
45# install splash and icon
46IF(MACOSX)
47 INSTALL(FILES ${_iconDstFile} DESTINATION share RENAME ${_iconFile})
48 INSTALL(FILES ${_splashDstFile} DESTINATION share/data RENAME ${_splashFile})
49 INSTALL(FILES Info.plist PkgInfo DESTINATION .)
50ELSE()
51 INSTALL(FILES ${_iconDstFile} DESTINATION share/${PACKAGE}/data RENAME ${_iconFile})
52 INSTALL(FILES ${_splashDstFile} DESTINATION share/${PACKAGE}/data RENAME ${_splashFile})
53ENDIF()
454
5# install Scenery3d shaders55# install Scenery3d shaders
6INSTALL(DIRECTORY shaders/ DESTINATION share/${PACKAGE}/data/shaders FILES_MATCHING 56INSTALL(DIRECTORY shaders/ DESTINATION share/${PACKAGE}/data/shaders FILES_MATCHING
@@ -29,8 +79,3 @@
29 INSTALL(FILES icons/512x512/stellarium.png DESTINATION share/icons/hicolor/512x512/apps)79 INSTALL(FILES icons/512x512/stellarium.png DESTINATION share/icons/hicolor/512x512/apps)
30ENDIF()80ENDIF()
3181
32IF(MACOSX)
33 INSTALL(FILES Icon.icns DESTINATION share )
34 INSTALL(FILES Info.plist PkgInfo DESTINATION . )
35ENDIF(MACOSX)
36
3782
=== added file 'data/IconGray.icns'
38Binary files data/IconGray.icns 1970-01-01 00:00:00 +0000 and data/IconGray.icns 2016-05-31 18:55:35 +0000 differ83Binary files data/IconGray.icns 1970-01-01 00:00:00 +0000 and data/IconGray.icns 2016-05-31 18:55:35 +0000 differ
=== modified file 'data/mainRes.qrc'
--- data/mainRes.qrc 2015-08-19 09:53:29 +0000
+++ data/mainRes.qrc 2016-05-31 18:55:35 +0000
@@ -4,6 +4,5 @@
4 </qresource>4 </qresource>
5 <qresource prefix="/">5 <qresource prefix="/">
6 <file>shaders/xyYToRGB.glsl</file>6 <file>shaders/xyYToRGB.glsl</file>
7 <file>splash.png</file>
8 </qresource>7 </qresource>
9</RCC>8</RCC>
109
=== added file 'data/splash-gray.png'
11Binary files data/splash-gray.png 1970-01-01 00:00:00 +0000 and data/splash-gray.png 2016-05-31 18:55:35 +0000 differ10Binary files data/splash-gray.png 1970-01-01 00:00:00 +0000 and data/splash-gray.png 2016-05-31 18:55:35 +0000 differ
=== modified file 'data/splash.bmp'
12Binary files data/splash.bmp 2006-12-16 13:24:58 +0000 and data/splash.bmp 2016-05-31 18:55:35 +0000 differ11Binary files data/splash.bmp 2006-12-16 13:24:58 +0000 and data/splash.bmp 2016-05-31 18:55:35 +0000 differ
=== modified file 'src/core/StelUtils.cpp'
--- src/core/StelUtils.cpp 2016-04-23 15:55:46 +0000
+++ src/core/StelUtils.cpp 2016-05-31 18:55:35 +0000
@@ -47,16 +47,12 @@
47//! Return the version of stellarium, i.e. "0.9.0"47//! Return the version of stellarium, i.e. "0.9.0"
48QString getApplicationVersion()48QString getApplicationVersion()
49{49{
50#ifdef STELLARIUM_RELEASE_BUILD50#if defined(STELLARIUM_VERSION)
51 return QString(STELLARIUM_VERSION);
52#elif defined(BZR_REVISION)
53 return QString("%1.%2 [%3]").arg(PACKAGE_VERSION).arg(BZR_REVISION).arg(BZR_BRANCH);
54#else
51 return QString(PACKAGE_VERSION);55 return QString(PACKAGE_VERSION);
52#else
53 #ifdef BZR_REVISION
54 return QString(PACKAGE_VERSION)+" (BZR r"+BZR_REVISION+")";
55 #elif defined(STELLARIUM_VERSION)
56 return QString(STELLARIUM_VERSION);
57 #else
58 return QString(PACKAGE_VERSION)+QChar(0x03B2);
59 #endif
60#endif56#endif
61}57}
6258
6359
=== modified file 'src/main.cpp'
--- src/main.cpp 2016-03-29 23:08:37 +0000
+++ src/main.cpp 2016-05-31 18:55:35 +0000
@@ -151,10 +151,6 @@
151 QGuiApplication::setDesktopSettingsAware(false);151 QGuiApplication::setDesktopSettingsAware(false);
152 QGuiApplication app(argc, argv);152 QGuiApplication app(argc, argv);
153#endif153#endif
154 QPixmap pixmap(":/splash.png");
155 QSplashScreen splash(pixmap);
156 splash.show();
157 app.processEvents();
158154
159 // QApplication sets current locale, but155 // QApplication sets current locale, but
160 // we need scanf()/printf() and friends to always work in the C locale,156 // we need scanf()/printf() and friends to always work in the C locale,
@@ -164,6 +160,12 @@
164 // Init the file manager160 // Init the file manager
165 StelFileMgr::init();161 StelFileMgr::init();
166162
163 QPixmap pixmap(StelFileMgr::findFile("data/splash.png"));
164 QSplashScreen splash(pixmap);
165 splash.show();
166 splash.showMessage(StelUtils::getApplicationVersion() , Qt::AlignLeft, Qt::white);
167 app.processEvents();
168
167 // Log command line arguments.169 // Log command line arguments.
168 QString argStr;170 QString argStr;
169 QStringList argList;171 QStringList argList;