Skip to content

Commit

Permalink
enhance
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 29, 2023
1 parent e258fa7 commit b990e4f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/workflows/exec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
- 26.3
- 27.2
- 28.2
- 29.1
Expand Down
27 changes: 17 additions & 10 deletions lisp/_prepare.el
Original file line number Diff line number Diff line change
Expand Up @@ -483,15 +483,18 @@ Arguments FNC and ARGS are used for advice `:around'."
;;
;;; Package

(defun eask-install-package-build ()
"Correct way to install the package `package-build'."
(cond ((version< emacs-version "27.1")
(add-to-list 'load-path
(format "%sextern/package-build/%s/" eask-lisp-root
emacs-major-version)
t))
(t (eask-with-archives "melpa"
(eask-package-install 'package-build)))))
(defun eask-load-legacy-package-build ()
"Load the legacy `package-build' package."
(eask-with-progress
(let ((name (ansi-green"package-build"))
(version (ansi-yellow (eask-2str emacs-major-version))))
(format " - %sInstalling legacy %s (%s)... " eask--action-prefix name version))
(add-to-list 'load-path
(format "%sextern/package-build/%s/"
eask-lisp-root
emacs-major-version)
t)
"done ✓"))

(defun eask--update-exec-path ()
"Add all bin directory to the variable `exec-path'."
Expand Down Expand Up @@ -547,7 +550,8 @@ scope of the dependencies (it's either `production' or `development')."
(eask-defvc< 27 (eask-pkg-init)) ; XXX: remove this after we drop 26.x
(when eask-depends-on-recipe-p
(eask-log "Installing required external packages...")
(eask-install-package-build)
(eask-with-archives "melpa"
(eask-package-install 'package-build))
(eask-with-progress
"Building temporary archives (this may take a while)... "
(eask-with-verbosity 'debug (github-elpa-build))
Expand Down Expand Up @@ -642,6 +646,9 @@ Argument BODY are forms for execution."
(eask-defvc< 27 (eask-pkg-init)) ; XXX: remove this after we drop 26.x
(eask--pkg-process pkg
(cond
((and (equal (eask-2str pkg) "package-build")
(version< emacs-version "27.1"))
(eask-load-legacy-package-build))
((package-installed-p pkg)
(eask-msg " - %sSkipping %s (%s)... already installed ✗"
eask--action-prefix
Expand Down
3 changes: 2 additions & 1 deletion lisp/core/package.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ Argument VERSION is a string represent the version number of this package."
(ignore-errors (make-directory eask-dist-path t))

(eask-defvc< 27 (eask-pkg-init)) ; XXX: remove this after we drop 26.x
(eask-install-package-build)
(eask-with-archives "melpa"
(eask-package-install 'package-build))
(eask-load "extern/package-build") ; override

(let* ((version (eask-package-version))
Expand Down
2 changes: 1 addition & 1 deletion lisp/init/cask.el
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ Optional argument CONTENTS is used for nested directives. e.g. development."

(eask-start
;; Preparation
(eask-install-package-build)
(eask-with-archives `("jcs-elpa" "melpa")
(eask-package-install 'package-build)
(eask-package-install 'cask))

;; Start Converting
Expand Down

0 comments on commit b990e4f

Please sign in to comment.