summary refs log tree commit diff
path: root/gnu/packages/patches/emacs-source-date-epoch.patch
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-01-28 07:29:13 -0500
committerMark H Weaver <mhw@netris.org>2016-01-28 07:29:13 -0500
commit593c366bded5d5f6638a3e80edb1c6e473149fce (patch)
treeeb58d26a878a22c79931fd8cfc2479dea28ab0a6 /gnu/packages/patches/emacs-source-date-epoch.patch
parent133056bd743e4a3d534a4e4ba9ed83dbbfbfbd19 (diff)
parent29a780147d066d5ce218d1fa2678a0a36a1145e3 (diff)
downloadguix-593c366bded5d5f6638a3e80edb1c6e473149fce.tar.gz
Merge branch 'core-updates'
Diffstat (limited to 'gnu/packages/patches/emacs-source-date-epoch.patch')
-rw-r--r--gnu/packages/patches/emacs-source-date-epoch.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/gnu/packages/patches/emacs-source-date-epoch.patch b/gnu/packages/patches/emacs-source-date-epoch.patch
new file mode 100644
index 0000000000..41c03ef514
--- /dev/null
+++ 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.