unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Carl Dong <contact@carldong.me>
To: ludo@gnu.org
Cc: 48726@debbugs.gnu.org, Carl Dong <contact@carldong.me>
Subject: [bug#48726] [PATCH v2] gnu: nsis: Respect SOURCE-DATE-EPOCH for reproducibility
Date: Thu,  3 Jun 2021 15:46:08 -0400	[thread overview]
Message-ID: <20210603194607.1101579-1-contact@carldong.me> (raw)
In-Reply-To: <87im2xz3j8.fsf@gnu.org>

Does this look correct?

* gnu/packages/patches/nsis-source-date-epoch.patch: New patch.
* gnu/packages/installers.scm (make-nsis)[source]: Apply it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/installers.scm                   |  3 ++-
 .../patches/nsis-source-date-epoch.patch      | 23 +++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/nsis-source-date-epoch.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 792ebac1e1..db96f55bf0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1464,6 +1464,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/network-manager-plugin-path.patch	\
   %D%/packages/patches/nginx-socket-cloexec.patch		\
   %D%/packages/patches/nsis-env-passthru.patch			\
+  %D%/packages/patches/nsis-source-date-epoch.patch		\
   %D%/packages/patches/nss-increase-test-timeout.patch		\
   %D%/packages/patches/nss-3.56-pkgconfig.patch			\
   %D%/packages/patches/ntfs-3g-CVE-2019-9755.patch		\
diff --git a/gnu/packages/installers.scm b/gnu/packages/installers.scm
index 775b91f0f7..c768a367aa 100644
--- a/gnu/packages/installers.scm
+++ b/gnu/packages/installers.scm
@@ -42,7 +42,8 @@
                 (sha256
                  (base32
                   "1sbwx5vzpddharkb7nj4q5z3i5fbg4lan63ng738cw4hmc4v7qdn"))
-                (patches (search-patches "nsis-env-passthru.patch"))))
+                (patches (search-patches "nsis-env-passthru.patch"
+                                         "nsis-source-date-epoch.patch"))))
       (build-system scons-build-system)
       (native-inputs `(("xgcc" ,xgcc)
                        ("xbinutils" ,xbinutils)
diff --git a/gnu/packages/patches/nsis-source-date-epoch.patch b/gnu/packages/patches/nsis-source-date-epoch.patch
new file mode 100644
index 0000000000..744c2a8011
--- /dev/null
+++ b/gnu/packages/patches/nsis-source-date-epoch.patch
@@ -0,0 +1,23 @@
+Honour SOURCE_DATE_EPOCH for VERSION default
+
+Merged upstream as cd3f1024a37a332f1d4fa96a817ca80dfa2a478c, but not yet in a
+release. GitHub PR: https://github.com/kichik/nsis/pull/13
+
+Python snippet from: https://reproducible-builds.org/docs/source-date-epoch/#python
+
+
+diff --git a/SConstruct b/SConstruct
+index e8252c9..41786f2 100755
+--- a/SConstruct
++++ b/SConstruct
+@@ -95,8 +95,8 @@ default_doctype = 'html'
+ if defenv.WhereIs('hhc', os.environ['PATH']):
+ 	default_doctype = 'chm'
+ 
+-from time import strftime, gmtime
+-cvs_version = strftime('%d-%b-%Y.cvs', gmtime())
++import time
++cvs_version = time.strftime('%d-%b-%Y.cvs', time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
+ 
+ opts = Variables()
+ 
-- 
2.31.1





  reply	other threads:[~2021-06-03 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-29  5:31 [bug#48726] [PATCH] gnu: nsis: Respect SOURCE-DATE-EPOCH for reproducibility Carl Dong
2021-05-29  8:59 ` Maxime Devos
2021-05-30 18:54   ` Carl Dong
2021-06-01 21:19 ` Ludovic Courtès
2021-06-03 19:46   ` Carl Dong [this message]
2021-06-04 15:39     ` [bug#48726] [PATCH v2] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210603194607.1101579-1-contact@carldong.me \
    --to=contact@carldong.me \
    --cc=48726@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).