Skip to content

Commit

Permalink
Add NonGNU ELPA support (radian-software#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
progfolio authored Jun 14, 2022
1 parent c64a1f6 commit 5fb04bc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bootstrap.el
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@
:local-repo "elpa"
:build nil)))

(straight-use-recipes
'(nongnu-elpa :type git
:repo "https://git.savannah.gnu.org/git/emacs/nongnu.git"
:local-repo "nongnu-elpa"
:build nil))

(straight-use-recipes '(el-get :type git :host github
:repo "dimitri/el-get"
:build nil))
Expand Down
39 changes: 39 additions & 0 deletions straight.el
Original file line number Diff line number Diff line change
Expand Up @@ -3346,6 +3346,45 @@ Otherwise, return nil."
"Return the current version of the GNU ELPA retriever."
2)

;;;;;; NonGNU ELPA

(defun straight-recipes-nongnu-elpa--translate (recipe)
"Translate RECIPE into straight.el-style recipe."
(unless (null recipe)
(let ((name (pop recipe)))
`( ,(intern name)
:repo ,(plist-get recipe :url)
,@(when-let ((ignored (plist-get recipe :ignored-files)))
`(:files (:defaults (:not ,@ignored))))))))

(defun straight-recipes-nongnu-elpa--recipes ()
"Return list of NonGNU ELPA style recipes."
(let ((f "elpa-packages"))
(when (file-exists-p f)
(with-temp-buffer
(condition-case err
(progn
(insert-file-contents f)
(goto-char (point-min))
(read (current-buffer)))
((error)
(error "Unable to read NonGNU ELPA packages: %S" err)))))))

(defun straight-recipes-nongnu-elpa-retrieve (package)
"Return NonGNU ELPA PACKAGE recipe, or nil if not found."
(straight-recipes-nongnu-elpa--translate
(cl-find package
(straight-recipes-nongnu-elpa--recipes)
:key (lambda (it) (intern (car it))))))

(defun straight-recipes-nongnu-elpa-list ()
"Return a list of NonGNU ELPA recipe names."
(mapcar #'car (straight-recipes-nongnu-elpa--recipes)))

(defun straight-recipes-nongnu-elpa-version ()
"Return the current version of the NonGNU ELPA retriever."
1)

;;;;;; Emacsmirror

(defcustom straight-recipes-emacsmirror-use-mirror t
Expand Down

0 comments on commit 5fb04bc

Please sign in to comment.