[Reproducible-builds] Bug#831570: nfstrace: please make the build reproducible

Chris Lamb lamby at debian.org
Sun Jul 17 12:14:27 UTC 2016


Source: nfstrace
Version: 0.4.1-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org

Hi,

Whilst working on the "reproducible builds" effort [0], we noticed
that nfstrace could not be built reproducibly.

Patch attached.

 [0] https://wiki.debian.org/ReproducibleBuilds


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible_build.patch	1970-01-01 02:00:00.000000000 +0200
--- b/debian/patches/reproducible_build.patch	2016-07-17 13:48:59.441176704 +0200
@@ -0,0 +1,37 @@
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2016-07-17
+
+--- nfstrace-0.4.1.orig/CMakeLists.txt
++++ nfstrace-0.4.1/CMakeLists.txt
+@@ -47,7 +47,17 @@ list (GET VERSION_LIST 2 NST_V_PATCH)
+ 
+ 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)
+ 
+--- nfstrace-0.4.1.orig/src/controller/build_info.h.in
++++ nfstrace-0.4.1/src/controller/build_info.h.in
+@@ -29,9 +29,7 @@ constexpr unsigned int NST_VERSION =
+     @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/";
+ 
--- a/debian/patches/series	1970-01-01 02:00:00.000000000 +0200
--- b/debian/patches/series	2016-07-17 13:48:51.233106268 +0200
@@ -0,0 +1 @@
+reproducible_build.patch


More information about the Reproducible-builds mailing list