From 3f54ff95d8bc6346e4697f91cf82add6c61f2bf1 Mon Sep 17 00:00:00 2001 From: David Fussner Date: Thu, 13 Nov 2025 11:10:05 +0000 Subject: [PATCH] Fix package-vc to find the GNU "make" executable * lisp/emacs-lisp/package-vc.el (package-vc--make): Improve heuristic for finding the name of GNU "make" on the system. (package-vc-make-program): New defcustom to allow the user to specify the name of GNU "make" in case auto-detection doesn't work. (Bug#79729) --- lisp/emacs-lisp/package-vc.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 6642522d11e..bab69420642 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -321,6 +321,16 @@ asynchronously." "\n") nil pkg-file nil 'silent)))) +(defcustom package-vc-make-program nil + "Name of the GNU \"make\" executable on the system. + +If the name of the GNU \"make\" executable on the current system is +neither \"make\" nor \"gmake\" then you will need to customize this +variable in order to build some VC packages." + :type '(choice (const :tag "Auto-detect" nil) + (string :tag "Name of GNU 'make' on current system")) + :version "31.1") + (defcustom package-vc-allow-build-commands nil "Whether to run extra build commands when installing VC packages. @@ -353,13 +363,15 @@ PKG-DESC is the package descriptor for the package that is being prepared." (let ((target (plist-get pkg-spec :make)) (cmd (plist-get pkg-spec :shell-command)) - (buf (format " *package-vc make %s*" (package-desc-name pkg-desc)))) + (buf (format " *package-vc make %s*" (package-desc-name pkg-desc))) + (makexe (or package-vc-make-program + (seq-find #'executable-find '("gmake" "make"))))) (when (or cmd target) (with-current-buffer (get-buffer-create buf) (erase-buffer) (when (and cmd (/= 0 (call-process shell-file-name nil t nil shell-command-switch cmd))) (warn "Failed to run %s, see buffer %S" cmd (buffer-name))) - (when (and target (/= 0 (apply #'call-process "make" nil t nil (if (consp target) target (list target))))) + (when (and target (/= 0 (apply #'call-process makexe nil t nil (ensure-list target)))) (warn "Failed to make %s, see buffer %S" target (buffer-name))))))) (declare-function org-export-to-file "ox" (backend file))