2022-08-24 19:20:19 -08:00
|
|
|
;;; elpaca-bootstrap.el --- Bootstrap the Elpaca package manager
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; Taken from https://github.com/progfolio/elpaca
|
|
|
|
|
|
|
|
;;; Code:
|
2023-03-22 19:10:40 -08:00
|
|
|
(defvar elpaca-installer-version 0.3)
|
2022-08-24 19:20:19 -08:00
|
|
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
2022-11-01 14:15:05 -08:00
|
|
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
2023-02-23 11:34:17 -09:00
|
|
|
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
|
2022-12-09 10:31:08 -09:00
|
|
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
|
|
|
:ref nil
|
2023-02-23 11:34:17 -09:00
|
|
|
:files (:defaults (:exclude "extensions"))
|
2022-12-09 10:31:08 -09:00
|
|
|
:build (:not elpaca--activate-package)))
|
2023-03-22 19:10:40 -08:00
|
|
|
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
|
|
|
|
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
|
|
|
(order (cdr elpaca-order))
|
|
|
|
(default-directory repo))
|
|
|
|
(add-to-list 'load-path (if (file-exists-p build) build repo))
|
|
|
|
(unless (file-exists-p repo)
|
|
|
|
(make-directory repo t)
|
|
|
|
(condition-case-unless-debug err
|
|
|
|
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
|
|
|
|
((zerop (call-process "git" nil buffer t "clone"
|
|
|
|
(plist-get order :repo) repo)))
|
|
|
|
((zerop (call-process "git" nil buffer t "checkout"
|
|
|
|
(or (plist-get order :ref) "--"))))
|
|
|
|
(emacs (concat invocation-directory invocation-name))
|
|
|
|
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
|
|
|
|
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
|
|
|
|
((require 'elpaca))
|
|
|
|
((elpaca-generate-autoloads "elpaca" repo)))
|
|
|
|
(kill-buffer buffer)
|
|
|
|
(error "%s" (with-current-buffer buffer (buffer-string))))
|
|
|
|
((error) (warn "%s" err) (delete-directory repo 'recursive))))
|
|
|
|
(unless (require 'elpaca-autoloads nil t)
|
|
|
|
(require 'elpaca)
|
|
|
|
(elpaca-generate-autoloads "elpaca" repo)
|
|
|
|
(load "./elpaca-autoloads")))
|
2022-08-24 19:20:19 -08:00
|
|
|
(add-hook 'after-init-hook #'elpaca-process-queues)
|
2022-12-09 10:31:08 -09:00
|
|
|
(elpaca `(,@elpaca-order))
|
2023-02-23 11:35:04 -09:00
|
|
|
|
|
|
|
(provide 'elpaca-bootstrap)
|
2022-08-24 19:20:19 -08:00
|
|
|
;;; elpaca-bootstrap.el ends here
|