If SOURCE_DATE_EPOCH is defined, use it for copyright year

Using the date from SOURCE_DATE_EPOCH instead of the current date makes
it possible to reproduce a build that was built on a different year:
https://reproducible-builds.org/specs/source-date-epoch/

This is fixing an issue we had while building Tor Browser:
https://trac.torproject.org/projects/tor/ticket/33535

CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/11296)
This commit is contained in:
Nicolas Vigier 2020-03-05 20:39:05 +01:00 committed by Matt Caswell
parent d30ef63964
commit 11d7d90344
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ if ( $filename =~ /openssl/i ) {
$vft = "VFT_APP";
}
my $YEAR = [localtime()]->[5] + 1900;
my $YEAR = [gmtime($ENV{SOURCE_DATE_EPOCH} || time())]->[5] + 1900;
print <<___;
#include <winver.h>