Bug#920592: roaraudio: please make the build reproducible

Chris Lamb lamby at debian.org
Sun Jan 27 09:03:09 GMT 2019


Source: roaraudio
Version: 1.0~beta12-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: environment
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that roaraudio could not be built reproducibly.

This is because it captured the current build time, hostname and
uname in the binaries and in the shipped config.h:

  #ifdef __RABS_COMMENT__
 -/* uname:  Linux profitbricks-build15-amd64 4.19.0-0.bpo.1-amd64 #1 SMP Debian 4.19.12-1~bpo9+1 (2018-12-30) x86_64 GNU/Linux */
 -/* Date :  Fri Feb 28 21:12:02 UTC 2020 */
 +/* uname:  Linux i-capture-the-hostname 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux */
 +/* Date :  Sat Jan 26 15:00:18 UTC 2019 */

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch	2019-01-27 09:20:43.266786381 +0100
@@ -0,0 +1,54 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2019-01-27
+
+--- roaraudio-1.0~beta12.orig/build-system/configure.lib
++++ roaraudio-1.0~beta12/build-system/configure.lib
+@@ -549,8 +549,13 @@ write_header_configlog() {
+  */
+ 
+ EOF
+-  echo '/* uname: ' $(uname -a) '*/'
+-  echo '/* Date : ' $(LC_ALL=C date --utc)  '*/'
++  echo '/* Date : ' $(LC_ALL=C date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}")  '*/'
++  if [ "$SOURCE_DATE_EPOCH" = '' ]
++  then
++    echo '/* uname: ' $(uname -a) '*/'
++  else
++    echo '/* uname: (reproducible) */'
++  fi
+   echo
+ 
+   echo
+@@ -588,8 +593,13 @@ write_header_configh() {
+   echo "#define $1"
+   echo
+   echo '#ifdef __RABS_COMMENT__'
+-  echo '/* uname: ' $(uname -a) '*/'
+-  echo '/* Date : ' $(LC_ALL=C date --utc)  '*/'
++  echo '/* Date : ' $(LC_ALL=C date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}")  '*/'
++  if [ "$SOURCE_DATE_EPOCH" = '' ]
++  then
++    echo '/* uname: ' $(uname -a) '*/'
++  else
++    echo '/* uname: (reproducible) */'
++  fi
+   echo '#endif'
+   echo
+  } >&3
+--- roaraudio-1.0~beta12.orig/build-system/configure.tests
++++ roaraudio-1.0~beta12/build-system/configure.tests
+@@ -52,7 +52,12 @@ test_pkgversion() {
+ 
+ test_buildstamp() {
+  echo -n "checking for build stamp of this package... "
+- BUILD_STAMP="`LC_ALL=C date --utc +'%F %X'` (`id -un`@`uname -n`)"
++ if [ "$SOURCE_DATE_EPOCH" = '' ]
++ then
++   BUILD_STAMP="`LC_ALL=C date --utc +'%F %X'` (`id -un`@`uname -n`)"
++ else
++   BUILD_STAMP="`LC_ALL=C date --utc +'%F %X' --date=@$SOURCE_DATE_EPOCH` (reproducuble)"
++ fi
+  echo "$BUILD_STAMP"
+  return 0
+ }
--- a/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series	2019-01-27 09:03:06.721045620 +0100
@@ -0,0 +1 @@
+reproducible-build.patch


More information about the Reproducible-bugs mailing list