File: openbios-use-source_date_epoch-in-makefile.patch

package info (click to toggle)
qemu 1%3A10.1.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 416,048 kB
  • sloc: ansic: 4,763,284; pascal: 115,134; python: 105,712; asm: 68,689; sh: 53,146; makefile: 27,519; perl: 18,864; cpp: 11,442; xml: 3,629; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (35 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download | duplicates (5)
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
35
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.
Forwarded: no

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