Source: emacs24
Version: 24.5+1-6
Severity: wishlist
Tags: patch upstream
User: reproducible-builds@lists.alioth.debian.org
Usertags: toolchain
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

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.

Regards,
Alexis Bienvenüe.

[1] https://wiki.debian.org/ReproducibleBuilds/
[2] https://reproducible-builds.org/specs/source-date-epoch/

Description: Make autoloads honour SOURCE_DATE_EPOCH
Author: Alexis Bienvenüe <p...@passoire.fr>

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))
 			       dirs)))
          (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
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to