]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob - meta/recipes-connectivity/openssl/openssl/reproducibility.patch
kernel-fitimage: allow overriding FIT configuration prefix
[thirdparty/openembedded/openembedded-core-contrib.git] / meta / recipes-connectivity / openssl / openssl / reproducibility.patch
1 Using localtime() means the output can depend on the timezone of the build machine.
2 Using gmtime() is safer. For complete reproducibility use SOURCE_DATE_EPOCH if set.
3
4 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 Upstream-Status: Pending [should be suitable]
6
7 Index: openssl-3.0.1/apps/progs.pl
8 ===================================================================
9 --- openssl-3.0.1.orig/apps/progs.pl
10 +++ openssl-3.0.1/apps/progs.pl
11 @@ -21,7 +21,10 @@ die "Unrecognised option, must be -C or
12 my %commands = ();
13 my $cmdre = qr/^\s*int\s+([a-z_][a-z0-9_]*)_main\(\s*int\s+argc\s*,/;
14 my $apps_openssl = shift @ARGV;
15 -my $YEAR = [localtime()]->[5] + 1900;
16 +my $YEAR = [gmtime()]->[5] + 1900;
17 +if (defined($ENV{SOURCE_DATE_EPOCH}) && $ENV{SOURCE_DATE_EPOCH} !~ /\D/) {
18 + $YEAR = [gmtime($ENV{SOURCE_DATE_EPOCH})]->[5] + 1900;
19 +}
20
21 # because the program apps/openssl has object files as sources, and
22 # they then have the corresponding C files as source, we need to chain