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:
parent
719716cf20
commit
81f5a8f052
1 changed files with 21 additions and 17 deletions
|
@ -3,30 +3,34 @@
|
|||
|
||||
(package! org
|
||||
: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
|
||||
;; shallow clone support.
|
||||
:repo "emacs-straight/org-mode"
|
||||
:files (:defaults "etc")
|
||||
:depth 1
|
||||
;; HACK Org requires a post-install compilation step to generate a
|
||||
;; org-version.el with org-release and org-git-version functions,
|
||||
;; using a 'git describe ...' call. This won't work in a sparse
|
||||
;; clone and I value smaller network burdens on users over
|
||||
;; non-essential variables so we fake it:
|
||||
;; HACK: Org has a post-install step that generates org-version.el
|
||||
;; and org-loaddefs.el, but Straight doesn't invoke this step, and
|
||||
;; the former doesn't work if the Org repo is a shallow clone.
|
||||
;; Rather than impose the network burden of a full clone (and other
|
||||
;; 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
|
||||
:pre-build
|
||||
(with-temp-file "org-version.el"
|
||||
(let ((version
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (doom-path "lisp/org.el") nil 0 1024)
|
||||
(if (re-search-forward "^;; Version: \\([^\n-]+\\)" nil t)
|
||||
(match-string-no-properties 1)
|
||||
"Unknown"))))
|
||||
(insert (format "(defun org-release () %S)\n" version)
|
||||
(format "(defun org-git-version (&rest _) \"%s-??-%s\")\n"
|
||||
version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD")))
|
||||
"(provide 'org-version)\n"))))
|
||||
(progn
|
||||
(with-temp-file "org-loaddefs.el")
|
||||
(with-temp-file "org-version.el"
|
||||
(let ((version
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (doom-path "lisp/org.el") nil 0 1024)
|
||||
(if (re-search-forward "^;; Version: \\([^\n-]+\\)" nil t)
|
||||
(match-string-no-properties 1)
|
||||
"Unknown"))))
|
||||
(insert (format "(defun org-release () %S)\n" version)
|
||||
(format "(defun org-git-version (&rest _) \"%s-??-%s\")\n"
|
||||
version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD")))
|
||||
"(provide 'org-version)\n")))))
|
||||
:pin "fe92a3cedba541482d5954eacb2b13e6f57a39c4")
|
||||
(package! org-contrib
|
||||
:recipe (:host github
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue