From de54bbd7596f25795fce84b4555715381d71df3b Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 9 Feb 2019 12:28:15 +0100 Subject: [PATCH] reproducibility: Remove absolute file names in ox-odt.elc * lisp/ox-odt.el (org-odt-schema-dir-list): (org-odt-styles-dir-list): Remove `eval-when-compile'. * mk/org-fixup.el (org-make-org-version): Change signature. Do not hard-code ODT style directory at build time. Fixes: bug#34323 --- lisp/ox-odt.el | 21 ++++++--------------- mk/default.mk | 2 +- mk/org-fixup.el | 15 ++++----------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index d450d5003..497488ef4 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -148,8 +148,7 @@ Use this to infer values of `org-odt-styles-dir' and `org-odt-schema-dir'.") -(defvar org-odt-data-dir - (expand-file-name "../../etc/" org-odt-lib-dir) +(defvar org-odt-data-dir (expand-file-name "../../etc/" org-odt-lib-dir) "Data directory for ODT exporter. Use this to infer values of `org-odt-styles-dir' and `org-odt-schema-dir'.") @@ -162,25 +161,17 @@ Use this to infer values of `org-odt-styles-dir' and "Regular expressions for special string conversion.") (defconst org-odt-schema-dir-list - (list - (and org-odt-data-dir - (expand-file-name "./schema/" org-odt-data-dir)) ; bail out - (eval-when-compile - (and (boundp 'org-odt-data-dir) org-odt-data-dir ; see make install - (expand-file-name "./schema/" org-odt-data-dir)))) + (list (expand-file-name "./schema/" org-odt-data-dir)) "List of directories to search for OpenDocument schema files. -Use this list to set the default value of -`org-odt-schema-dir'. The entries in this list are -populated heuristically based on the values of `org-odt-lib-dir' -and `org-odt-data-dir'.") +Use this list to set the default value of `org-odt-schema-dir'. +The entries in this list are populated heuristically based on the +values of `org-odt-lib-dir' and `org-odt-data-dir'.") (defconst org-odt-styles-dir-list (list (and org-odt-data-dir (expand-file-name "./styles/" org-odt-data-dir)) ; bail out - (eval-when-compile - (and (boundp 'org-odt-data-dir) org-odt-data-dir ; see make install - (expand-file-name "./styles/" org-odt-data-dir))) + (expand-file-name "./styles/" org-odt-data-dir) (expand-file-name "../etc/styles/" org-odt-lib-dir) ; git (expand-file-name "./etc/styles/" org-odt-lib-dir) ; elpa (expand-file-name "./org/" data-directory) ; system diff --git a/mk/default.mk b/mk/default.mk index 50d037db2..17b1cb60f 100644 --- a/mk/default.mk +++ b/mk/default.mk @@ -115,7 +115,7 @@ MAKE_ORG_INSTALL = $(BATCHL) \ MAKE_ORG_VERSION = $(BATCHL) \ --eval '(load "org-compat.el")' \ --eval '(load "../mk/org-fixup.el")' \ - --eval '(org-make-org-version "$(ORGVERSION)" "$(GITVERSION)" "'$(datadir)'")' + --eval '(org-make-org-version "$(ORGVERSION)" "$(GITVERSION)")' # How to byte-compile the whole source directory ELCDIR = $(BATCHL) \ diff --git a/mk/org-fixup.el b/mk/org-fixup.el index d2bdf9c70..439e6e7f7 100644 --- a/mk/org-fixup.el +++ b/mk/org-fixup.el @@ -34,7 +34,7 @@ (find-file manual) (org-texinfo-export-to-texinfo))) -(defun org-make-org-version (org-release org-git-version odt-dir) +(defun org-make-org-version (org-release org-git-version) "Make the file org-version.el in the current directory. This function is internally used by the build system and should be used by foreign build systems or installers to produce this @@ -58,9 +58,6 @@ Inserted by installing Org mode or when a release is made.\" Inserted by installing Org or when a release is made.\" (let ((org-git-version \"" org-git-version "\")) org-git-version)) -;;;\#\#\#autoload -\(defvar org-odt-data-dir \"" odt-dir "\" - \"The location of ODT styles.\") \f\n\(provide 'org-version\) \f\n;; Local Variables:\n;; version-control: never ;; no-byte-compile: t @@ -93,17 +90,13 @@ Finds the install directory by looking for library \"org\". Optionally byte-compile lisp files in the install directory or force re-compilation. This function is provided for easier manual install when the build system can't be used." - (let* ((origin default-directory) - (dirlisp (org-find-library-dir "org")) - (dirorg (concat dirlisp "../" )) - (dirodt (if (boundp 'org-odt-data-dir) - org-odt-data-dir - (concat dirorg "etc/")))) + (let ((origin default-directory) + (dirlisp (org-find-library-dir "org"))) (unwind-protect (progn (cd dirlisp) (org-fixup) - (org-make-org-version (org-release) (org-git-version) dirodt) + (org-make-org-version (org-release) (org-git-version)) (org-make-org-loaddefs) (when compile (byte-recompile-directory dirlisp 0 force))) (cd origin))))