Skip to content

Commit a91c46c

Browse files
committed
guix: Make nsis reproducible by respecting SOURCE-DATE-EPOCH
When building nsis, if VERSION is not specified, it defaults to cvs_version which is non-deterministic as it includes the current date. This patches nsis to default to SOURCE_DATE_EPOCH if it exists so that nsis is reproducible. Upstream change: NSIS-Dev/nsis#13
1 parent 7acda55 commit a91c46c

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

contrib/guix/manifest.scm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
(guix profiles)
2626
(guix utils))
2727

28+
(define-syntax-rule (search-our-patches file-name ...)
29+
"Return the list of absolute file names corresponding to each
30+
FILE-NAME found in ./patches relative to the current file."
31+
(parameterize
32+
((%patch-path (list (string-append (dirname (current-filename)) "/patches"))))
33+
(list (search-patch file-name) ...)))
34+
2835
(define (make-ssp-fixed-gcc xgcc)
2936
"Given a XGCC package, return a modified package that uses the SSP function
3037
from glibc instead of from libssp.so. Our `symbol-check' script will complain if
@@ -150,6 +157,10 @@ chain for " target " development."))
150157
(home-page (package-home-page pthreads-xgcc))
151158
(license (package-license pthreads-xgcc)))))
152159

160+
(define (make-nsis-with-sde-support base-nsis)
161+
(package-with-extra-patches base-nsis
162+
(search-our-patches "nsis-SConstruct-sde-support.patch")))
163+
153164

154165
(packages->manifest
155166
(append
@@ -189,7 +200,9 @@ chain for " target " development."))
189200
(let ((target (getenv "HOST")))
190201
(cond ((string-suffix? "-mingw32" target)
191202
;; Windows
192-
(list zip (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32") nsis-x86_64))
203+
(list zip
204+
(make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
205+
(make-nsis-with-sde-support nsis-x86_64)))
193206
((string-contains target "riscv64-linux-")
194207
(list (make-bitcoin-cross-toolchain "riscv64-linux-gnu"
195208
#:base-gcc-for-libc gcc-7)))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/SConstruct b/SConstruct
2+
index e8252c9..41786f2 100755
3+
--- a/SConstruct
4+
+++ b/SConstruct
5+
@@ -95,8 +95,8 @@ default_doctype = 'html'
6+
if defenv.WhereIs('hhc', os.environ['PATH']):
7+
default_doctype = 'chm'
8+
9+
-from time import strftime, gmtime
10+
-cvs_version = strftime('%d-%b-%Y.cvs', gmtime())
11+
+import time
12+
+cvs_version = time.strftime('%d-%b-%Y.cvs', time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
13+
14+
opts = Variables()
15+

0 commit comments

Comments
 (0)