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
|
(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
|
||||||
(with-temp-file "org-version.el"
|
(progn
|
||||||
(let ((version
|
(with-temp-file "org-loaddefs.el")
|
||||||
(with-temp-buffer
|
(with-temp-file "org-version.el"
|
||||||
(insert-file-contents (doom-path "lisp/org.el") nil 0 1024)
|
(let ((version
|
||||||
(if (re-search-forward "^;; Version: \\([^\n-]+\\)" nil t)
|
(with-temp-buffer
|
||||||
(match-string-no-properties 1)
|
(insert-file-contents (doom-path "lisp/org.el") nil 0 1024)
|
||||||
"Unknown"))))
|
(if (re-search-forward "^;; Version: \\([^\n-]+\\)" nil t)
|
||||||
(insert (format "(defun org-release () %S)\n" version)
|
(match-string-no-properties 1)
|
||||||
(format "(defun org-git-version (&rest _) \"%s-??-%s\")\n"
|
"Unknown"))))
|
||||||
version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD")))
|
(insert (format "(defun org-release () %S)\n" version)
|
||||||
"(provide 'org-version)\n"))))
|
(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")
|
:pin "fe92a3cedba541482d5954eacb2b13e6f57a39c4")
|
||||||
(package! org-contrib
|
(package! org-contrib
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue