Source: rdiff-backup-fs
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The build path is embedded in /usr/bin/rdiff-backup-fs:

  
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/rdiff-backup-fs.html

  /build/1st/rdiff-backup-fs-1.0.0/rdiff-backup-fs.c:43
  vs.
  /build/2/rdiff-backup-fs-1.0.0/2nd/rdiff-backup-fs.c:43

The attached patches fix this by updating to using debhelper compat 13
which sets various compiler flags by default, patching configure.ac to
take EXTRA_CFLAGS, and passing EXTRA_CFLAGS to configure in
debian/rules.


With these patches applied, rdiff-backup-fs should build reproducibly on
tests.reproducible-builds.org!


live well,
  vagrant
From cc979a98912da5099859c5337d2c7de5bb7aac9d Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Mon, 11 Jul 2022 23:13:08 +0000
Subject: [PATCH 1/3] Update to debhelper compat 13.

---
 debian/compat  | 1 -
 debian/control | 2 +-
 debian/rules   | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
 delete mode 100644 debian/compat

diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7f8f011..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/debian/control b/debian/control
index c6d57ea..b4fa00f 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: rdiff-backup-fs
 Section: utils
 Priority: extra
 Maintainer: Debian QA Group <packa...@qa.debian.org>
-Build-Depends: debhelper (>= 7.0.50~), autotools-dev, libz-dev, libfuse-dev, pkg-config, dh-autoreconf
+Build-Depends: debhelper-compat (= 13), libz-dev, libfuse-dev, pkg-config
 Standards-Version: 3.9.2
 Homepage: http://code.google.com/p/rdiff-backup-fs/
 
diff --git a/debian/rules b/debian/rules
index 21dfdfb..955dd78 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,4 +10,4 @@
 #export DH_VERBOSE=1
 
 %:
-	dh --with autoreconf $@ 
+	dh $@
-- 
2.36.1

From 20475bdd718c6baca6bd832dc92ef37821bec195 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Mon, 11 Jul 2022 23:13:49 +0000
Subject: [PATCH 2/3] configure.ac: Support passing EXTRA_CFLAGS when setting
 LIBS and CFLAGS variables.

---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7f7482a..ae26bde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,8 +46,8 @@ AC_TYPE_SIZE_T
 dnl checking type of system to provide proper compile and linking flags
 
 case ${host} in
-    *-*-linux-*|*-*-k*bsd*-*)	AC_SUBST(CFLAGS, ["-Wall -g -O3 `pkg-config --cflags fuse`"])
-			AC_SUBST(LIBS, ["$LIBS `pkg-config --cflags --libs fuse` -lz"]);;
+    *-*-linux-*|*-*-k*bsd*-*)	AC_SUBST(CFLAGS, ["$EXTRA_CFLAGS -Wall -g -O3 `pkg-config --cflags fuse`"])
+			AC_SUBST(LIBS, ["$LIBS $EXTRA_CFLAGS `pkg-config --cflags --libs fuse` -lz"]);;
     *-*-bsd-*)		AC_SUBST(CFLAGS, ["-Wall -g -O3 `pkg-config --cflags fuse`"])
 			AC_SUBST(LIBS, ["$LIBS `pkg-config --cflags --libs fuse` -lz"]);;
     *-*-darwin*)	AC_SUBST(CFLAGS, ["-Wall -g -O3 `pkg-config --cflags fuse`"])
-- 
2.36.1

From 8f52af0fa9e957c8eff1797aaf57d8bb9233af47 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Mon, 11 Jul 2022 23:15:45 +0000
Subject: [PATCH 3/3] debian/rules: Set EXTRA_CFLAGS in dh_auto_configure
 override.

This allows passing the default compiler flags, such as
-ffile-prefix-map which is used to avoid embedding the build path.
---
 debian/rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index 955dd78..608d0b6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,3 +11,6 @@
 
 %:
 	dh $@
+
+override_dh_auto_configure:
+	EXTRA_CFLAGS="$(CFLAGS)" dh_auto_configure
-- 
2.36.1

Attachment: signature.asc
Description: PGP signature

Reply via email to