Browse Source

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
Nicolas Goaziou 10 months ago
parent
commit
de54bbd759
3 changed files with 11 additions and 27 deletions
  1. 6 15
      lisp/ox-odt.el
  2. 1 1
      mk/default.mk
  3. 4 11
      mk/org-fixup.el

+ 6 - 15
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

+ 1 - 1
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) \

+ 4 - 11
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))))