fix(org): "No org-loaddefs.el file" errors

Org complains if org-loaddefs.el is missing, but Straight generates a
org-autoloads.el instead (and loads it separately), so we need only fool
Org it exists.
This commit is contained in:
Henrik Lissner 2023-03-09 18:16:10 -05:00
parent 719716cf20
commit 81f5a8f052
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -3,19 +3,23 @@
(package! org (package! org
:recipe (:host github :recipe (:host github
;; REVIEW I intentionally avoid git.savannah.gnu.org because of SSL ;; REVIEW: I intentionally avoid git.savannah.gnu.org because of SSL
;; issues (see #5655), uptime issues, download time, and lack of ;; issues (see #5655), uptime issues, download time, and lack of
;; shallow clone support. ;; shallow clone support.
:repo "emacs-straight/org-mode" :repo "emacs-straight/org-mode"
:files (:defaults "etc") :files (:defaults "etc")
:depth 1 :depth 1
;; HACK Org requires a post-install compilation step to generate a ;; HACK: Org has a post-install step that generates org-version.el
;; org-version.el with org-release and org-git-version functions, ;; and org-loaddefs.el, but Straight doesn't invoke this step, and
;; using a 'git describe ...' call. This won't work in a sparse ;; the former doesn't work if the Org repo is a shallow clone.
;; clone and I value smaller network burdens on users over ;; Rather than impose the network burden of a full clone (and other
;; non-essential variables so we fake it: ;; redundant work in Org's makefile), I'd rather fake these files
;; instead. Besides, Straight already produces a org-autoloads.el,
;; so org-loaddefs.el isn't needed.
:build t :build t
:pre-build :pre-build
(progn
(with-temp-file "org-loaddefs.el")
(with-temp-file "org-version.el" (with-temp-file "org-version.el"
(let ((version (let ((version
(with-temp-buffer (with-temp-buffer
@ -26,7 +30,7 @@
(insert (format "(defun org-release () %S)\n" version) (insert (format "(defun org-release () %S)\n" version)
(format "(defun org-git-version (&rest _) \"%s-??-%s\")\n" (format "(defun org-git-version (&rest _) \"%s-??-%s\")\n"
version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD"))) version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD")))
"(provide 'org-version)\n")))) "(provide 'org-version)\n")))))
:pin "fe92a3cedba541482d5954eacb2b13e6f57a39c4") :pin "fe92a3cedba541482d5954eacb2b13e6f57a39c4")
(package! org-contrib (package! org-contrib
:recipe (:host github :recipe (:host github