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

The buildid differs in in various binaries when build a different build
path:

  
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/bible-kjv.html

The attached patches fix this by patching the upstream Makefile to pass
-ffile-prefix-map and patching debian/rules to pass -ffile-prefix-map to
a CC call.

According to my local tests, with these patches applied bible-kjv should
build reproducibly on tests.reproducible-builds.org!

Thanks for maintaining bible-kjv!

live well,
  vagrant
From d5d57c09389cd4e5205c4f9aaa560dfc2ffbbebd Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Tue, 27 Sep 2022 01:14:43 +0000
Subject: [PATCH 1/2] Makefile: Add -ffile-prefix-map to CFLAGS to avoid
 embedding build paths.

https://reproducible-builds.org/docs/build-path/
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3b998b8..6365c54 100644
--- a/Makefile
+++ b/Makefile
@@ -88,7 +88,7 @@ DESTMAN1      = $(DESTMAN)/man1
 
 # I use environment variables for these...
 #CFLAGS	      = -g
-CFLAGS	      = -Wall -Wformat -Werror -Wshadow -W -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wbad-function-cast -Wpointer-arith -g2 -ggdb -DDESTLIB=\"$(DESTLIB)\"
+CFLAGS	      = -Wall -Wformat -Werror -Wshadow -W -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wbad-function-cast -Wpointer-arith -g2 -ggdb -DDESTLIB=\"$(DESTLIB)\" -ffile-prefix-map=$(CURDIR)=.
 LDFLAGS       = 
 LDADD         = -lreadline
 
-- 
2.37.2

From 270b47fdbe2fd7ada4814438d4059fe383398cb7 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Tue, 27 Sep 2022 01:15:16 +0000
Subject: [PATCH 2/2] debian/rules: Add -ffile-prefix-map to CC call to avoid
 embedding build paths.

https://reproducible-builds.org/docs/build-path/
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 64fdebb..57e8174 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,7 +23,7 @@ build:
 	dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_build --no-parallel -- bible-index.c bible.data bible.data.conc 'LD=$$(CC)'
 	rm -f *.o
 	dh_auto_build --no-parallel -- bible 'LD=$$(CC)'
-	cd debian && $(CC) -g -O2 -o randverse randverse.c
+	cd debian && $(CC) -g -O2 -ffile-prefix-map=$(CURDIR)=. -o randverse randverse.c
 	touch build
 
 build-arch: build
-- 
2.37.2

Attachment: signature.asc
Description: PGP signature

Reply via email to