summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrewsh@debian.org>2016-07-19 11:15:48 +0200
committerAndrew Shadura <andrewsh@debian.org>2016-07-19 11:17:59 +0200
commitb679236567de758b56c71d554a792ed2e97607af (patch)
treebab8f11eab7f85b6d0a0d92e90884553d0338957
parent43e0ea95a9817a41afd80e2cbaca9bb6ee3d166b (diff)
Add the patch to make the build reproducible (Closes: #831570).
-rw-r--r--debian/patches/reproducible_build.patch38
-rw-r--r--debian/patches/series1
2 files changed, 39 insertions, 0 deletions
diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
new file mode 100644
index 0000000..bb3f9c7
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,38 @@
+From: Chris Lamb <lamby@debian.org>
+Date: 2016-07-17 13:48:59.441176704 +0200
+Subject: Build reproducibly.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -47,7 +47,17 @@
+
+ set (NST_VERSION_FULL "${PROJECT_NAME} ${NST_VERSION} (${CMAKE_BUILD_TYPE})")
+
+-string (TIMESTAMP COMPILATION_DATE "%Y-%m-%d")
++if (DEFINED ENV{SOURCE_DATE_EPOCH})
++ execute_process(
++ COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d"
++ OUTPUT_VARIABLE COMPILATION_DATE
++ OUTPUT_STRIP_TRAILING_WHITESPACE)
++else ()
++ execute_process(
++ COMMAND "date" "+%Y-%m-%d"
++ OUTPUT_VARIABLE TIMESTAMP
++ OUTPUT_STRIP_TRAILING_WHITESPACE)
++endif ()
+
+ include_directories (src)
+
+--- a/src/controller/build_info.h.in
++++ b/src/controller/build_info.h.in
+@@ -29,9 +29,7 @@
+ @NST_V_MAJOR@ * 1000 + @NST_V_MINOR@ * 100 + @NST_V_PATCH@;
+
+ constexpr char PROGRAM_BUILD_INFO[]=
+- "@NST_VERSION_FULL@\n"
+- "built on @CMAKE_SYSTEM@\n"
+- "by C++ compiler @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@";
++ "@NST_VERSION_FULL@";
+
+ constexpr char MODULES_DIRECTORY_PATH[] = "@CMAKE_INSTALL_PREFIX@/lib/nfstrace/";
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b2026fe
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible_build.patch