From 911118227cba1dd66e066bdbf78224193b3a8de9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 9 Nov 2020 21:37:23 -0500 Subject: [PATCH] lang/org: refactor org recipe Now that straight (and package) now support a :build property. Relevant to #4243 --- modules/lang/org/packages.el | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index f18cf52ae..a2606d09d 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -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