Source: emacs24
Version: 24.5+1-6
Severity: wishlist
Tags: patch upstream
Usertags: toolchain

Dear Maintainer,

autoloads files embed a timestamp. To get a reproducible build [1] for
software packages that build-depend on emacs (including emacs24), it
would be great to make this timestamp honoring the SOURCE_DATE_EPOCH
environment variable [2], that is set to the last debian/changelog entry
date when building binary debian packages.

Please find attached a proposed patch for this.

Alexis Bienvenüe.


Description: Make autoloads honour SOURCE_DATE_EPOCH
Author: Alexis Bienvenüe <>

Index: emacs24-24.5+1/lisp/emacs-lisp/autoload.el
--- emacs24-24.5+1.orig/lisp/emacs-lisp/autoload.el
+++ emacs24-24.5+1/lisp/emacs-lisp/autoload.el
@@ -604,7 +604,10 @@ Return non-nil if and only if FILE adds
                               ;; We'd really want to just use
                               ;; `emacs-internal' instead.
                               nil nil 'emacs-mule-unix)
-                       (nth 5 (file-attributes relfile))))
+                       (let ((source-date-epoch (getenv "SOURCE_DATE_EPOCH")))
+                         (if (null source-date-epoch)
+                             (nth 5 (file-attributes relfile))
+                           (seconds-to-time (string-to-number source-date-epoch))))))
                     (insert ";;; Generated autoloads from " relfile "\n")))
                 (insert generate-autoload-section-trailer))))
           (message "Generating autoloads for %s...done" file))
@@ -740,7 +743,10 @@ write its autoloads into the specified f
 						  t files-re))
          (done ())
-	 (this-time (current-time))
+	 (this-time (let ((source-date-epoch (getenv "SOURCE_DATE_EPOCH")))
+                      (if (null source-date-epoch)
+                          (current-time)
+                        (seconds-to-time (string-to-number source-date-epoch)))))
          ;; Files with no autoload cookies or whose autoloads go to other
          ;; files because of file-local autoload-generated-file settings.
 	 (no-autoloads nil)
Reproducible-builds mailing list

Reply via email to