Alex Kost <alez...@gmail.com> skribis: > I like the idea to honor SOURCE_DATE_EPOCH, so I'm attaching a patch for > this. But now I don't know how to make Guix set this variable during > the build process :-( Need help.
Ahem, eventually, we’ll have to set it in ‘gnu-build’ in (guix build gnu-build-system) in the next ‘core-updates’ cycle. In the interim, we can set it in a phase of ‘emacs-build-system’, which would entail few rebuilds. WDYT? > From b8dc19a65980690a636ad7f9f39b3c84991f4975 Mon Sep 17 00:00:00 2001 > From: Alex Kost <alez...@gmail.com> > Date: Wed, 21 Oct 2015 15:59:23 +0300 > Subject: [PATCH] gnu: emacs: Honor 'SOURCE_DATE_EPOCH'. > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > Suggested by Ludovic Courtès <l...@gnu.org>. > > * gnu/packages/patches/emacs-source-date-epoch.patch: New patch. > * gnu-system.am (dist_patch_DATA): Add it. > * gnu/packages/emacs.scm (emacs)[source]: Use it. LGTM. > +++ b/gnu/packages/patches/emacs-source-date-epoch.patch > @@ -0,0 +1,20 @@ > +Honor SOURCE_DATE_EPOCH variable to avoid non-determinism in generated > +"autoloads" files. > + > +--- a/lisp/emacs-lisp/autoload.el > ++++ b/lisp/emacs-lisp/autoload.el > +@@ -378,8 +378,12 @@ > + "Insert the section-header line, > + which lists the file name and which functions are in it, etc." > + (insert generate-autoload-section-header) > +- (prin1 `(autoloads ,autoloads ,load-name ,file ,time) > +- outbuf) > ++ (let* ((env (getenv "SOURCE_DATE_EPOCH")) > ++ (time (if env > ++ (seconds-to-time (string-to-number env)) > ++ time))) > ++ (prin1 `(autoloads ,autoloads ,load-name ,file ,time) > ++ outbuf)) > + (terpri outbuf) > + ;; Break that line at spaces, to avoid very long lines. > + ;; Make each sub-line into a comment. Could you also submit it upstream, Cc’ing guix-devel and reproducible-bui...@lists.alioth.debian.org? Hopefully that is acceptable. (I searched a bit but didn’t find a similar patch by the Debian Reproducible team, but patch-tracker.debian.org is unreachable.) Thanks! Ludo’.