File allow-reproducible-builds.patch of Package rigsofrods
diff -Nur rigs-of-rods-0.4.7.0/cmake/GenerateVersionInfo.cmake new/cmake/GenerateVersionInfo.cmake
index aa9ec22..f052677 100644
--- rigs-of-rods-0.4.7.0/cmake/GenerateVersionInfo.cmake
+++ new/cmake/GenerateVersionInfo.cmake
@@ -90,6 +90,25 @@ if( BUILD_DEV_VERSION )
endif()
+# This whole if and else can replaced, when using cmake >= 3.8 (as it then uses environment variable SOURCE_DATE_EPOCH), with this:
+# STRING(TIMESTAMP BUILD_DATE "%b %d %Y" UTC)
+# STRING(TIMESTAMP BUILD_TIME "%H:%M" UTC)
+if (DEFINED ENV{SOURCE_DATE_EPOCH})
+ execute_process(
+ COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%b %e %Y"
+ OUTPUT_VARIABLE BUILD_DATE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ execute_process(
+ COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%R"
+ OUTPUT_VARIABLE BUILD_TIME
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+else ()
+ string(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC) # more correct would be "%b %d %Y" but this is only supported from cmake >= 3.7
+ string(TIMESTAMP BUILD_TIME "%H:%M" UTC)
+endif ()
+
# Fill in the actual version information in the provided template
configure_file( ${VERSION_FILE_INPUT} ${VERSION_FILE_OUTPUT} @ONLY )
diff -Nur rigs-of-rods-0.4.7.0/source/configurator/Configurator.cpp new/source/configurator/Configurator.cpp
--- rigs-of-rods-0.4.7.0/source/configurator/Configurator.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/configurator/Configurator.cpp 2017-03-04 00:03:34.306817147 +0100
@@ -1101,7 +1101,7 @@
//dText = new wxStaticText(aboutPanel, -1, wxString::Format(_("Full revision: %s"), wxT(SVN_ID)), wxPoint(x_row1 + 15, y));
//y += dText->GetSize().GetHeight() + 2;
- dText = new wxStaticText(aboutPanel, -1, wxString::Format(_("Build time: %s, %s"), wxT(__DATE__), wxT(__TIME__)), wxPoint(x_row1 + 15, y));
+ dText = new wxStaticText(aboutPanel, -1, wxString::Format(_("Build time: %s, %s"), ROR_BUILD_DATE, ROR_BUILD_TIME), wxPoint(x_row1 + 15, y));
y += dText->GetSize().GetHeight() + 2;
diff -Nur rigs-of-rods-0.4.7.0/source/main/gui/panels/GUI_GameAbout.cpp new/source/main/gui/panels/GUI_GameAbout.cpp
--- rigs-of-rods-0.4.7.0/source/main/gui/panels/GUI_GameAbout.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/gui/panels/GUI_GameAbout.cpp 2017-03-04 00:03:34.310817175 +0100
@@ -53,7 +53,7 @@
m_backbtn->eventMouseButtonClick += MyGUI::newDelegate(this, &CLASS::eventMouseButtonClickBackButton);
m_ror_version->setCaption(Ogre::String(ROR_VERSION_STRING));
m_net_version->setCaption(Ogre::String(RORNET_VERSION));
- m_build_time->setCaption(Ogre::String(__DATE__) + ", " + Ogre::String(__TIME__));
+ m_build_time->setCaption(Ogre::String(ROR_BUILD_DATE) + ", " + Ogre::String(ROR_BUILD_TIME));
initMisc();
CenterToScreen();
diff -Nur rigs-of-rods-0.4.7.0/source/main/gui/panels/GUI_GameConsole.cpp new/source/main/gui/panels/GUI_GameConsole.cpp
--- rigs-of-rods-0.4.7.0/source/main/gui/panels/GUI_GameConsole.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/gui/panels/GUI_GameConsole.cpp 2017-03-04 00:03:34.310817175 +0100
@@ -378,7 +378,7 @@
putMessage(CONSOLE_MSGTYPE_INFO, CONSOLE_TITLE, "Rigs of Rods:", "information.png");
putMessage(CONSOLE_MSGTYPE_INFO, CONSOLE_SYSTEM_REPLY, " Version: " + String(ROR_VERSION_STRING), "information.png");
putMessage(CONSOLE_MSGTYPE_INFO, CONSOLE_SYSTEM_REPLY, " Protocol version: " + String(RORNET_VERSION), "information.png");
- putMessage(CONSOLE_MSGTYPE_INFO, CONSOLE_SYSTEM_REPLY, " build time: " + String(__DATE__) + ", " + String(__TIME__), "information.png");
+ putMessage(CONSOLE_MSGTYPE_INFO, CONSOLE_SYSTEM_REPLY, " build time: " + String(ROR_BUILD_DATE) + ", " + String(ROR_BUILD_TIME), "information.png");
return;
}
diff -Nur rigs-of-rods-0.4.7.0/source/main/main.cpp new/source/main/main.cpp
--- rigs-of-rods-0.4.7.0/source/main/main.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/main.cpp 2017-03-04 00:03:34.318817233 +0100
@@ -98,8 +98,8 @@
crAddProperty("Version", ROR_VERSION_STRING);
crAddProperty("protocol_version", RORNET_VERSION);
- crAddProperty("build_date", __DATE__);
- crAddProperty("build_time", __TIME__);
+ crAddProperty("build_date", ROR_BUILD_DATE);
+ crAddProperty("build_time", ROR_BUILD_TIME);
crAddProperty("System_GUID", SSETTING("GUID", "None").c_str());
crAddProperty("Multiplayer", RoR::App::GetActiveMpState() ? "1" : "0");
diff -Nur rigs-of-rods-0.4.7.0/source/main/utils/Utils.cpp new/source/main/utils/Utils.cpp
--- rigs-of-rods-0.4.7.0/source/main/utils/Utils.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/utils/Utils.cpp 2017-03-04 00:03:34.318817233 +0100
@@ -158,10 +158,10 @@
" version: %s\n"
" protocol version: %s\n"
" build time: %s, %s\n"
- , ROR_VERSION_STRING, RORNET_VERSION, __DATE__, __TIME__);
+ , ROR_VERSION_STRING, RORNET_VERSION, ROR_BUILD_DATE, ROR_BUILD_TIME);
} else
{
- sprintf(tmp, "Rigs of Rods version %s, protocol version: %s, build time: %s, %s", ROR_VERSION_STRING, RORNET_VERSION, __DATE__, __TIME__);
+ sprintf(tmp, "Rigs of Rods version %s, protocol version: %s, build time: %s, %s", ROR_VERSION_STRING, RORNET_VERSION, ROR_BUILD_DATE, ROR_BUILD_TIME);
}
return String(tmp);
diff -Nur rigs-of-rods-0.4.7.0/source/version_info/RoRVersion.cpp.in new/source/version_info/RoRVersion.cpp.in
--- rigs-of-rods-0.4.7.0/source/version_info/RoRVersion.cpp.in 2016-11-20 17:08:00.000000000 +0100
+++ new/source/version_info/RoRVersion.cpp.in 2017-03-04 01:06:47.514212026 +0100
@@ -5,4 +5,5 @@
const char* const ROR_VERSION_STRING_SHORT = "@VERSION_MAJOR@.@VERSION_MINOR@";
const char* const ROR_VERSION_STRING = "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@.@VERSION_TWEAK@@VERSION_SUFFIX@";
-
+const char* const ROR_BUILD_DATE = "@BUILD_DATE@";
+const char* const ROR_BUILD_TIME = "@BUILD_TIME@";
diff -Nur rigs-of-rods-0.4.7.0/source/version_info/RoRVersion.h new/source/version_info/RoRVersion.h
--- rigs-of-rods-0.4.7.0/source/version_info/RoRVersion.h 2016-11-20 17:08:00.000000000 +0100
+++ new/source/version_info/RoRVersion.h 2017-03-04 01:05:36.821702234 +0100
@@ -22,3 +22,5 @@
extern const char* const ROR_VERSION_STRING_SHORT;
extern const char* const ROR_VERSION_STRING;
+extern const char* const ROR_BUILD_DATE;
+extern const char* const ROR_BUILD_TIME;