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
This commit is contained in:
Nicolas Goaziou 2019-02-09 12:28:15 +01:00
parent 19baf228c0
commit de54bbd759
3 changed files with 11 additions and 27 deletions

View File

@ -148,8 +148,7 @@
Use this to infer values of `org-odt-styles-dir' and Use this to infer values of `org-odt-styles-dir' and
`org-odt-schema-dir'.") `org-odt-schema-dir'.")
(defvar org-odt-data-dir (defvar org-odt-data-dir (expand-file-name "../../etc/" org-odt-lib-dir)
(expand-file-name "../../etc/" org-odt-lib-dir)
"Data directory for ODT exporter. "Data directory for ODT exporter.
Use this to infer values of `org-odt-styles-dir' and Use this to infer values of `org-odt-styles-dir' and
`org-odt-schema-dir'.") `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.") "Regular expressions for special string conversion.")
(defconst org-odt-schema-dir-list (defconst org-odt-schema-dir-list
(list (list (expand-file-name "./schema/" org-odt-data-dir))
(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 of directories to search for OpenDocument schema files. "List of directories to search for OpenDocument schema files.
Use this list to set the default value of Use this list to set the default value of `org-odt-schema-dir'.
`org-odt-schema-dir'. The entries in this list are The entries in this list are populated heuristically based on the
populated heuristically based on the values of `org-odt-lib-dir' values of `org-odt-lib-dir' and `org-odt-data-dir'.")
and `org-odt-data-dir'.")
(defconst org-odt-styles-dir-list (defconst org-odt-styles-dir-list
(list (list
(and org-odt-data-dir (and org-odt-data-dir
(expand-file-name "./styles/" org-odt-data-dir)) ; bail out (expand-file-name "./styles/" org-odt-data-dir)) ; bail out
(eval-when-compile (expand-file-name "./styles/" org-odt-data-dir)
(and (boundp 'org-odt-data-dir) org-odt-data-dir ; see make install
(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) ; git
(expand-file-name "./etc/styles/" org-odt-lib-dir) ; elpa (expand-file-name "./etc/styles/" org-odt-lib-dir) ; elpa
(expand-file-name "./org/" data-directory) ; system (expand-file-name "./org/" data-directory) ; system

View File

@ -115,7 +115,7 @@ MAKE_ORG_INSTALL = $(BATCHL) \
MAKE_ORG_VERSION = $(BATCHL) \ MAKE_ORG_VERSION = $(BATCHL) \
--eval '(load "org-compat.el")' \ --eval '(load "org-compat.el")' \
--eval '(load "../mk/org-fixup.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 # How to byte-compile the whole source directory
ELCDIR = $(BATCHL) \ ELCDIR = $(BATCHL) \

View File

@ -34,7 +34,7 @@
(find-file manual) (find-file manual)
(org-texinfo-export-to-texinfo))) (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. "Make the file org-version.el in the current directory.
This function is internally used by the build system and should This function is internally used by the build system and should
be used by foreign build systems or installers to produce this 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.\" Inserted by installing Org or when a release is made.\"
(let ((org-git-version \"" org-git-version "\")) (let ((org-git-version \"" 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\(provide 'org-version\)
\f\n;; Local Variables:\n;; version-control: never \f\n;; Local Variables:\n;; version-control: never
;; no-byte-compile: t ;; 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 Optionally byte-compile lisp files in the install directory or
force re-compilation. This function is provided for easier force re-compilation. This function is provided for easier
manual install when the build system can't be used." manual install when the build system can't be used."
(let* ((origin default-directory) (let ((origin default-directory)
(dirlisp (org-find-library-dir "org")) (dirlisp (org-find-library-dir "org")))
(dirorg (concat dirlisp "../" ))
(dirodt (if (boundp 'org-odt-data-dir)
org-odt-data-dir
(concat dirorg "etc/"))))
(unwind-protect (unwind-protect
(progn (progn
(cd dirlisp) (cd dirlisp)
(org-fixup) (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) (org-make-org-loaddefs)
(when compile (byte-recompile-directory dirlisp 0 force))) (when compile (byte-recompile-directory dirlisp 0 force)))
(cd origin)))) (cd origin))))