use-SOURCE_DATE_EPOCH.patch 842 B

1234567891011121314151617181920212223242526
  1. From a1625535fc5127ab8e94043280ef7a983bcfc161 Mon Sep 17 00:00:00 2001
  2. From: Nicolas Vigier <boklm@torproject.org>
  3. Date: Thu, 5 Mar 2020 20:39:05 +0100
  4. Subject: [PATCH] If SOURCE_DATE_EPOCH is defined, use it for copyright year
  5. Using the date from SOURCE_DATE_EPOCH instead of the current date makes
  6. it possible to reproduce a build that was built on a different year:
  7. https://reproducible-builds.org/specs/source-date-epoch/
  8. ---
  9. util/mkrc.pl | 2 +-
  10. 1 file changed, 1 insertion(+), 1 deletion(-)
  11. diff --git a/util/mkrc.pl b/util/mkrc.pl
  12. index 6762bc4a56..e15c071af7 100755
  13. --- a/util/mkrc.pl
  14. +++ b/util/mkrc.pl
  15. @@ -46,7 +46,7 @@ if ( $filename =~ /openssl/i ) {
  16. $vft = "VFT_APP";
  17. }
  18. -my $YEAR = [localtime()]->[5] + 1900;
  19. +my $YEAR = [localtime($ENV{SOURCE_DATE_EPOCH} || time())]->[5] + 1900;
  20. print <<___;
  21. #include <winver.h>