lang/org: refactor org recipe

Now that straight (and package) now support a :build property.

Relevant to #4243
This commit is contained in:
Henrik Lissner 2020-11-09 21:37:23 -05:00
parent 7d3a41567d
commit 911118227c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -1,26 +1,23 @@
;; -*- no-byte-compile: t; -*-
;;; lang/org/packages.el
;; HACK A necessary hack because org requires a compilation step after being
;; cloned, and during that compilation a org-version.el is generated with
;; these two functions, which return the output of a 'git describe ...'
;; call in the repo's root. Of course, this command won't work in a sparse
;; clone, and more than that, initiating these compilation step is a
;; hassle, so...
(add-hook! 'straight-use-package-pre-build-functions
(defun +org-fix-package-h (package &rest _)
(when (equal package "org-mode")
(with-temp-file (expand-file-name "org-version.el" (straight--repos-dir "org-mode"))
(insert "(fset 'org-release (lambda () \"9.4\"))\n"
"(fset 'org-git-version #'ignore)\n"
"(provide 'org-version)\n")))))
;; Install cutting-edge version of org-mode, and from a mirror, because
;; code.orgmode.org runs on a potato.
(package! org-mode
:recipe (:host github
:repo "emacs-straight/org-mode"
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el")
;; HACK A necessary hack because org requires a compilation step
;; after being cloned, and during that compilation a
;; org-version.el is generated with these two functions, which
;; return the output of a 'git describe ...' call in the repo's
;; root. Of course, this command won't work in a sparse clone,
;; and more than that, initiating these compilation step is a
;; hassle, so...
:build (with-temp-file (expand-file-name "org-version.el" (straight--repos-dir "org-mode"))
(insert "(fset 'org-release (lambda () \"9.5\"))\n"
"(fset 'org-git-version #'ignore)\n"
"(provide 'org-version)\n")))
:pin "a88806b554b15461a88a4e00c9e0e338fe59ac37"
;; Prevents built-in Org from sneaking into the byte-compilation of
;; `org-plus-contrib', and inform other packages that `org-mode' satisfies the