Commit 4a2ad014 authored by boklm's avatar boklm Committed by Matthew Finkel
Browse files

Bug 33535: Patch openssl to use SOURCE_DATE_EPOCH for copyright year

parent af17fda1
......@@ -15,6 +15,7 @@ export CC='gcc -m32'
[% END -%]
[% IF c("var/windows") -%]
patch -p1 < $rootdir/escape-openssldir.patch
patch -p1 < $rootdir/use-SOURCE_DATE_EPOCH.patch
[% END -%]
export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
./Configure [% c('var/configure_opts') %]
......
......@@ -31,3 +31,5 @@ input_files:
sha256sum: 1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
- filename: escape-openssldir.patch
enable: '[% c("var/windows") %]'
- filename: use-SOURCE_DATE_EPOCH.patch
enable: '[% c("var/windows") %]'
From a1625535fc5127ab8e94043280ef7a983bcfc161 Mon Sep 17 00:00:00 2001
From: Nicolas Vigier <boklm@torproject.org>
Date: Thu, 5 Mar 2020 20:39:05 +0100
Subject: [PATCH] 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/
---
util/mkrc.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/mkrc.pl b/util/mkrc.pl
index 6762bc4a56..e15c071af7 100755
--- a/util/mkrc.pl
+++ b/util/mkrc.pl
@@ -46,7 +46,7 @@ if ( $filename =~ /openssl/i ) {
$vft = "VFT_APP";
}
-my $YEAR = [localtime()]->[5] + 1900;
+my $YEAR = [localtime($ENV{SOURCE_DATE_EPOCH} || time())]->[5] + 1900;
print <<___;
#include <winver.h>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment