Package: limesuite / 18.06.0+dfsg-1

override-build-timestamp Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Substitute changelog entry time for build time
 Upstream compiles a build time string into the program, which breaks
 build reproducibility. This patch adds an override option to
 CMakeLists.txt and the debian/rules uses this to pass in the date of
 the latest debian/changelog entry.
Author: Andreas Bombe <aeb@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,7 +52,14 @@
 
 set(LIME_SUITE_LIBVER "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 set(LIME_SUITE_VERSION "${LIME_SUITE_LIBVER}-${LIME_SUITE_EXTVER}")
-string(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d")
+
+if (NOT $ENV{SOURCE_DATE_EPOCH})
+    message(FATAL_ERROR "SOURCE_DATE_EPOCH not set")
+else (NOT $ENV{SOURCE_DATE_EPOCH})
+    execute_process(COMMAND date --date=@$ENV{SOURCE_DATE_EPOCH} -I
+	OUTPUT_VARIABLE BUILD_TIMESTAMP
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif (NOT $ENV{SOURCE_DATE_EPOCH})
 
 #LIME_SUITE_ROOT is compiled into the library to locate the install base.
 #By default, the LIME_SUITE_ROOT is set to the CMAKE_INSTALL_PREFIX.