Skip to content

Commit

Permalink
Support specifying arbitrary shell command in recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Sep 5, 2024
1 parent 4432847 commit b806f6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions package-build.el
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ Note that Melpa leaves this disabled."
:group 'package-build
:type 'boolean)

(defcustom package-build-run-recipe-shell-command nil
"Whether to run the shell command from the `:shell-command' recipe slot.
Note that Melpa leaves this disabled."
:group 'package-build
:type 'boolean)

(defcustom package-build-run-recipe-make-targets nil
"Whether to run the make targets from the `:make-targets' recipe slot.
Note that Melpa leaves this disabled."
Expand Down Expand Up @@ -1478,6 +1484,11 @@ in `package-build-archive-dir'."
(unwind-protect
(progn
(funcall package-build-checkout-function rcp)
(when-let* ((package-build-run-recipe-shell-command)
(command (oref rcp shell-command)))
(package-build--message "Running %s" command)
(package-build--call-sandboxed
rcp shell-file-name shell-command-switch command))
(when-let ((package-build-run-recipe-make-targets)
(targets (oref rcp make-targets)))
(package-build--message "Running make %s" (string-join targets " "))
Expand Down
4 changes: 3 additions & 1 deletion package-recipe.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
(time :initform nil)
(version :initform nil)
(version-regexp :initarg :version-regexp :initform nil)
(shell-command :initarg :shell-command :initform nil)
(make-targets :initarg :make-targets :initform nil)
(org-exports :initarg :org-exports :initform nil)
(old-names :initarg :old-names :initform nil))
Expand Down Expand Up @@ -171,7 +172,8 @@ file is invalid, then raise an error."
name ident)
(cl-assert plist)
(let* ((symbol-keys '(:fetcher))
(string-keys '(:url :repo :commit :branch :version-regexp))
(string-keys '( :url :repo :commit :branch
:version-regexp :shell-command))
(list-keys '(:files :make-targets :org-exports :old-names))
(all-keys (append symbol-keys string-keys list-keys)))
(dolist (thing plist)
Expand Down

0 comments on commit b806f6d

Please sign in to comment.