gnu: nsis: Respect SOURCE-DATE-EPOCH for reproducibility
[jackhill/guix/guix.git] / gnu / packages / patches / nsis-source-date-epoch.patch
1 Honour SOURCE_DATE_EPOCH for VERSION default
2
3 Merged upstream as cd3f1024a37a332f1d4fa96a817ca80dfa2a478c, but not yet in a
4 release. GitHub PR: https://github.com/kichik/nsis/pull/13
5
6 Python snippet from: https://reproducible-builds.org/docs/source-date-epoch/#python
7
8
9 diff --git a/SConstruct b/SConstruct
10 index e8252c9..41786f2 100755
11 --- a/SConstruct
12 +++ b/SConstruct
13 @@ -95,8 +95,8 @@ default_doctype = 'html'
14 if defenv.WhereIs('hhc', os.environ['PATH']):
15 default_doctype = 'chm'
16
17 -from time import strftime, gmtime
18 -cvs_version = strftime('%d-%b-%Y.cvs', gmtime())
19 +import time
20 +cvs_version = time.strftime('%d-%b-%Y.cvs', time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
21
22 opts = Variables()
23