Source: freetds
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

A build number derived from the build time is embedded in various
/usr/share/doc/freetds-doc/reference/*_source.html files:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/diffoscope-results/freetds.html

  #define·TDS_VERSION_BUILD_NUMBER·856
  vs.
  #define·TDS_VERSION_BUILD_NUMBER·1256

The attached patch to configure.ac fixes this by instead using the value of
SOURCE_DATE_EPOCH for the BUILD_NUMBER if it is set, and falling back to
the default behavior if it is not set.

Alternately, I tried instead passing --date=@$SOURCE_DATE_EPOCH to the
various date calls, but for some reason that was not sufficient.


According to my local tests, with this patch applied freetds should build
reproducibly on tests.reproducible-builds.org!

Thanks for maintaining freetds!


live well,
  vagrant
From 0130aad916458fa19aa7f7e5822203a48cf96b9f Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Fri, 9 Jun 2023 14:26:15 -0700
Subject: [PATCH 1/3] configure.ac: Use SOURCE_DATE_EPOCH as BUILD_NUMBER if
 set.

https://reproducible-builds.org/docs/source-date-epoch/
---
 configure.ac | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 73b6d725..a76dc6ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,8 +40,11 @@ fi
 MAJOR=[`echo $ver | sed "s,$match,\1,"`]
 MINOR=[`echo $ver | sed "s,$match,\2,"`]
 SUBVERSION=[`echo $ver | sed "s,$match,\3,"`]
-BUILD_NUMBER="`date +1%j` - 1000 + ( `date +%Y` - 2021 )"
-BUILD_NUMBER="`expr $BUILD_NUMBER \* 366`"
+BUILD_NUMBER=$SOURCE_DATE_EPOCH
+if test -z "$BUILD_NUMBER"; then
+   BUILD_NUMBER="`date +1%j` - 1000 + ( `date +%Y` - 2021 )"
+   BUILD_NUMBER="`expr $BUILD_NUMBER \* 366`"
+fi
 if test "$SUBVERSION" = "9999"; then
 	MINOR=`expr $MINOR - 1`
 fi
-- 
2.39.2

Attachment: signature.asc
Description: PGP signature

Reply via email to