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
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-05-28 18:04:32 +0000
3+++ CMakeLists.txt 2016-05-31 18:55:35 +0000
4@@ -19,8 +19,8 @@
5 ########### Project name ###########
6 PROJECT(Stellarium)
7 SET(STELLARIUM_MAJOR "0")
8-SET(STELLARIUM_MINOR "15")
9-SET(STELLARIUM_PATCH "0")
10+SET(STELLARIUM_MINOR "14")
11+SET(STELLARIUM_PATCH "90")
12 SET(VERSION "${STELLARIUM_MAJOR}.${STELLARIUM_MINOR}.${STELLARIUM_PATCH}")
13 SET(PACKAGE stellarium)
14 SET(COPYRIGHT_YEARS "2000-2016")
15@@ -39,6 +39,11 @@
16 SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None Debug GProf Valgrind Release RelWithDebInfo MinSizeRel." FORCE)
17 ENDIF()
18
19+SET(STELLARIUM_RELEASE_BUILD 0 CACHE BOOL "Set 1 to build as an official release (0 for development snapshots).")
20+IF(STELLARIUM_RELEASE_BUILD)
21+ ADD_DEFINITIONS(-DSTELLARIUM_RELEASE_BUILD)
22+ENDIF()
23+
24 # 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?
25 # Hint from http://public.kitware.com/Bug/view.php?id=14292. Actually fixed with CMake 2.8.12, but maybe we have other effects?
26 if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
27@@ -135,10 +140,6 @@
28 ADD_DEFINITIONS(-DENABLE_NLS)
29 ENDIF()
30
31-SET(STELLARIUM_RELEASE_BUILD 1 CACHE BOOL "Flag this build as an official release.")
32-IF(STELLARIUM_RELEASE_BUILD)
33- ADD_DEFINITIONS(-DSTELLARIUM_RELEASE_BUILD)
34-ENDIF()
35
36 # Activate media support
37 SET(ENABLE_MEDIA 1 CACHE BOOL "Define whether media support should be activated.")
38@@ -287,11 +288,15 @@
39
40 ########### Get revision number for non-release builds ###########
41 IF(NOT STELLARIUM_RELEASE_BUILD)
42- #Hack until CMake detection for Bazaar is finished
43+ # Hack until CMake detection for Bazaar is finished
44+ EXECUTE_PROCESS(COMMAND bzr revno WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} TIMEOUT 30 OUTPUT_VARIABLE BZR_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
45+ 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)
46 IF(BZR_REVISION)
47- SET(PACKAGE_VERSION "bzr${BZR_REVISION}")
48+ SET(PACKAGE_VERSION "${VERSION}.${BZR_REVISION}")
49 ADD_DEFINITIONS(-DBZR_REVISION="${BZR_REVISION}")
50+ ADD_DEFINITIONS(-DBZR_BRANCH="${BZR_BRANCH}")
51 ENDIF()
52+# MESSAGE(STATUS "Branch: ${BZR_BRANCH}; Revision: ${BZR_REVISION}")
53 IF(STELLARIUM_VERSION)
54 SET(PACKAGE_VERSION "${STELLARIUM_VERSION}")
55 ADD_DEFINITIONS(-DSTELLARIUM_VERSION="${STELLARIUM_VERSION}")
56@@ -301,6 +306,16 @@
57
58 IF(WIN32)
59 #######################################################
60+ ### Generate icon file name ###
61+ #######################################################
62+
63+ IF(STELLARIUM_RELEASE_BUILD)
64+ SET(PACKAGE_ICON "stellarium")
65+ ELSE()
66+ SET(PACKAGE_ICON "stellarium-gray")
67+ ENDIF()
68+
69+ #######################################################
70 ### Generate a VersionInfo file ###
71 #######################################################
72
73
74=== modified file 'cmake/stellarium.iss.cmake'
75--- cmake/stellarium.iss.cmake 2016-05-28 18:04:32 +0000
76+++ cmake/stellarium.iss.cmake 2016-05-31 18:55:35 +0000
77@@ -19,7 +19,7 @@
78 AppUpdatesURL=http://www.stellarium.org/
79 VersionInfoVersion=@PACKAGE_VERSION@
80 MinVersion=0,@MIN_VERSION@
81-SetupIconFile=@CMAKE_SOURCE_DIR@\data\stellarium.ico
82+SetupIconFile=@CMAKE_SOURCE_DIR@\data\@PACKAGE_ICON@.ico
83 OutputBaseFilename=stellarium-@PACKAGE_VERSION@-@ISS_PACKAGE_PLATFORM@
84 OutputDir=@CMAKE_SOURCE_DIR@\installers
85 ; In 64-bit mode, {pf} is equivalent to {pf64},
86
87=== modified file 'cmake/stellarium.rc.cmake'
88--- cmake/stellarium.rc.cmake 2016-05-28 18:04:32 +0000
89+++ cmake/stellarium.rc.cmake 2016-05-31 18:55:35 +0000
90@@ -1,4 +1,4 @@
91-stellarium-icon ICON "@CMAKE_SOURCE_DIR@/data/stellarium.ico"
92+stellarium-icon ICON "@CMAKE_SOURCE_DIR@/data/@PACKAGE_ICON@.ico"
93 1 VERSIONINFO
94 FILEVERSION @PACKAGE_VERSION_RC@
95 PRODUCTVERSION @PACKAGE_VERSION_RC@
96
97=== modified file 'data/CMakeLists.txt'
98--- data/CMakeLists.txt 2016-05-28 18:04:32 +0000
99+++ data/CMakeLists.txt 2016-05-31 18:55:35 +0000
100@@ -1,6 +1,56 @@
101+
102 ########### install files ###############
103-
104-INSTALL(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)
105+INSTALL(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)
106+
107+########### splash target ##############
108+ADD_CUSTOM_TARGET(splash ALL)
109+SET(_splashFile splash.png)
110+SET(_splashDstFile ${CMAKE_CURRENT_BINARY_DIR}/${_splashFile})
111+
112+IF(NOT STELLARIUM_RELEASE_BUILD)
113+ GET_FILENAME_COMPONENT(_splashSrcFile splash-gray.png ABSOLUTE)
114+ELSE()
115+ GET_FILENAME_COMPONENT(_splashSrcFile splash.png ABSOLUTE)
116+ENDIF()
117+
118+ADD_CUSTOM_COMMAND(
119+ TARGET splash
120+ COMMAND ${CMAKE_COMMAND} -E copy ${_splashSrcFile} ${_splashDstFile}
121+)
122+
123+########### icon target ###############
124+ADD_CUSTOM_TARGET(icon ALL)
125+IF(MACOSX)
126+ SET(_iconFile Icon.icns)
127+ IF(NOT STELLARIUM_RELEASE_BUILD)
128+ GET_FILENAME_COMPONENT(_iconSrcFile IconGray.icns ABSOLUTE)
129+ ELSE()
130+ GET_FILENAME_COMPONENT(_iconSrcFile Icon.icns ABSOLUTE)
131+ ENDIF()
132+ELSE()
133+ SET(_iconFile stellarium.ico)
134+ IF(NOT STELLARIUM_RELEASE_BUILD)
135+ GET_FILENAME_COMPONENT(_iconSrcFile stellarium-gray.ico ABSOLUTE)
136+ ELSE()
137+ GET_FILENAME_COMPONENT(_iconSrcFile stellarium.ico ABSOLUTE)
138+ ENDIF()
139+ENDIF()
140+
141+SET(_iconDstFile ${CMAKE_CURRENT_BINARY_DIR}/${_iconFile})
142+ADD_CUSTOM_COMMAND(
143+ TARGET icon
144+ COMMAND ${CMAKE_COMMAND} -E copy ${_iconSrcFile} ${_iconDstFile}
145+)
146+
147+# install splash and icon
148+IF(MACOSX)
149+ INSTALL(FILES ${_iconDstFile} DESTINATION share RENAME ${_iconFile})
150+ INSTALL(FILES ${_splashDstFile} DESTINATION share/data RENAME ${_splashFile})
151+ INSTALL(FILES Info.plist PkgInfo DESTINATION .)
152+ELSE()
153+ INSTALL(FILES ${_iconDstFile} DESTINATION share/${PACKAGE}/data RENAME ${_iconFile})
154+ INSTALL(FILES ${_splashDstFile} DESTINATION share/${PACKAGE}/data RENAME ${_splashFile})
155+ENDIF()
156
157 # install Scenery3d shaders
158 INSTALL(DIRECTORY shaders/ DESTINATION share/${PACKAGE}/data/shaders FILES_MATCHING
159@@ -29,8 +79,3 @@
160 INSTALL(FILES icons/512x512/stellarium.png DESTINATION share/icons/hicolor/512x512/apps)
161 ENDIF()
162
163-IF(MACOSX)
164- INSTALL(FILES Icon.icns DESTINATION share )
165- INSTALL(FILES Info.plist PkgInfo DESTINATION . )
166-ENDIF(MACOSX)
167-
168
169=== added file 'data/IconGray.icns'
170Binary files data/IconGray.icns 1970-01-01 00:00:00 +0000 and data/IconGray.icns 2016-05-31 18:55:35 +0000 differ
171=== modified file 'data/mainRes.qrc'
172--- data/mainRes.qrc 2015-08-19 09:53:29 +0000
173+++ data/mainRes.qrc 2016-05-31 18:55:35 +0000
174@@ -4,6 +4,5 @@
175 </qresource>
176 <qresource prefix="/">
177 <file>shaders/xyYToRGB.glsl</file>
178- <file>splash.png</file>
179 </qresource>
180 </RCC>
181
182=== added file 'data/splash-gray.png'
183Binary 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
184=== modified file 'data/splash.bmp'
185Binary files data/splash.bmp 2006-12-16 13:24:58 +0000 and data/splash.bmp 2016-05-31 18:55:35 +0000 differ
186=== modified file 'src/core/StelUtils.cpp'
187--- src/core/StelUtils.cpp 2016-04-23 15:55:46 +0000
188+++ src/core/StelUtils.cpp 2016-05-31 18:55:35 +0000
189@@ -47,16 +47,12 @@
190 //! Return the version of stellarium, i.e. "0.9.0"
191 QString getApplicationVersion()
192 {
193-#ifdef STELLARIUM_RELEASE_BUILD
194+#if defined(STELLARIUM_VERSION)
195+ return QString(STELLARIUM_VERSION);
196+#elif defined(BZR_REVISION)
197+ return QString("%1.%2 [%3]").arg(PACKAGE_VERSION).arg(BZR_REVISION).arg(BZR_BRANCH);
198+#else
199 return QString(PACKAGE_VERSION);
200-#else
201- #ifdef BZR_REVISION
202- return QString(PACKAGE_VERSION)+" (BZR r"+BZR_REVISION+")";
203- #elif defined(STELLARIUM_VERSION)
204- return QString(STELLARIUM_VERSION);
205- #else
206- return QString(PACKAGE_VERSION)+QChar(0x03B2);
207- #endif
208 #endif
209 }
210
211
212=== modified file 'src/main.cpp'
213--- src/main.cpp 2016-03-29 23:08:37 +0000
214+++ src/main.cpp 2016-05-31 18:55:35 +0000
215@@ -151,10 +151,6 @@
216 QGuiApplication::setDesktopSettingsAware(false);
217 QGuiApplication app(argc, argv);
218 #endif
219- QPixmap pixmap(":/splash.png");
220- QSplashScreen splash(pixmap);
221- splash.show();
222- app.processEvents();
223
224 // QApplication sets current locale, but
225 // we need scanf()/printf() and friends to always work in the C locale,
226@@ -164,6 +160,12 @@
227 // Init the file manager
228 StelFileMgr::init();
229
230+ QPixmap pixmap(StelFileMgr::findFile("data/splash.png"));
231+ QSplashScreen splash(pixmap);
232+ splash.show();
233+ splash.showMessage(StelUtils::getApplicationVersion() , Qt::AlignLeft, Qt::white);
234+ app.processEvents();
235+
236 // Log command line arguments.
237 QString argStr;
238 QStringList argList;