Package: qemu / 1:7.2+dfsg-7+deb12u13

openbios-use-source_date_epoch-in-makefile.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sun, 21 Jun 2020 19:27:11 +0000
X-Dgit-Generated: 1:5.0-6~0~20200621~20 0b5923e6cc49abffd582177ba8558cfb6c7f10ce
Subject: roms/openbios: Use SOURCE_DATE_EPOCH in Makefile.

Embedding the build time breaks reproducibility. Instead, use the date
specified by the SOURCE_DATE_EPOCH environment variable:

  https://reproducible-builds.org/docs/source-date-epoch/

This patch relies on features of GNU date, and will need further
changes for portability to other systems.

---

--- qemu-5.0.orig/roms/openbios/Makefile.target
+++ qemu-5.0/roms/openbios/Makefile.target
@@ -54,14 +54,14 @@ versions: $(ODIR)/target/include/openbio
 
 $(ODIR)/forth/version.fs:
 	$(call quiet-command,true, "  GEN   $(TARGET_DIR)$@")
-	@DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ;  \
+	@DATE="$(shell echo `LC_ALL=C date --utc --date=@$(SOURCE_DATE_EPOCH) +'%b %e %Y %H:%M'`)" ;  \
 		( echo ": builddate \" $$DATE\" ; " ;     \
 		  echo ": version \" $(VERSION)\" ; " ; ) \
 		  > $(dir $@)/version.fs
 
 $(ODIR)/target/include/openbios-version.h:
 	$(call quiet-command,true, "  GEN   $(TARGET_DIR)$@")
-	@DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
+	@DATE="$(shell echo `LC_ALL=C date --utc --date=@$(SOURCE_DATE_EPOCH) +'%b %e %Y %H:%M'`)" ; \
           ( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \
            echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; ) \
          > $(dir $@)/openbios-version.h