From 2accee47359ccf5c9616bda404fbce66e8adfa76 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Thu, 23 Jul 2026 11:59:12 -0400 Subject: gnu: emacs-minimal: Patch tramp-encoding-shell. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was already done in our emacs-tramp package but not in Emacs proper. Also move tramp configurations to their own phase so we can later duplicate them in the emacs-tramp package. * gnu/packages/emacs.scm (emacs-minimal)[#:phases]: Move all tramp related changes to ‘patch-tramp’. Patch “/bin/sh” in tramp.el to patch “tramp-encoding-shell”. Signed-off-by: Liliana Marie Prikler --- gnu/packages/emacs.scm | 53 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 7f36745ff51..559dd92646d 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -334,19 +334,6 @@ (if replacement (string-append "\"" replacement "\"") all)))) - ;; Make sure Tramp looks for binaries in the right places on - ;; remote Guix System machines, where 'getconf PATH' returns - ;; something bogus. - (substitute* "lisp/net/tramp.el" - ;; Patch the line after "(defcustom tramp-remote-path". - (("\\(tramp-default-remote-path") - (format - #f "(tramp-default-remote-path ~s ~s ~s ~s ~s ~s ~s " - "/run/privileged/bin" - "~/.guix-profile/bin" "~/.guix-profile/sbin" - "~/.guix-home/bin" "~/.guix-home/sbin" - "/run/current-system/profile/bin" - "/run/current-system/profile/sbin"))) ;; Make sure Man and ffap looks for C header files in the right ;; places. @@ -357,14 +344,38 @@ "\"~/.guix-profile/include\"" "\"~/.guix-home/include\"" "\"/run/current-system/profile/include\"") - " "))) - - ;; match ".gvfs-fuse-daemon-real" and ".gvfsd-fuse-real" - ;; respectively when looking for GVFS processes. - (substitute* "lisp/net/tramp-gvfs.el" - (("\\(tramp-process-running-p \"(.*)\"\\)" all process) - (format #f "(or ~a (tramp-process-running-p ~s))" - all (string-append "." process "-real")))))) + " "))))) + (add-after 'patch-program-file-names 'patch-tramp + ;; This phase is duplicated in the emacs-tramp package. Please + ;; ensure they stay in sync + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "lisp/net" + ;; All but one "/bin/" directory refer to remote + ;; environments, which may not be Guix. Do not patch them + ;; blindly. However, tramp-encoding-shell has to be patched. + (substitute* "tramp.el" + (("\"/bin/sh\"") + (format #f "~s" (search-input-file inputs "bin/sh"))) + + ;; Make sure Tramp looks for binaries in the right places on + ;; remote Guix System machines, where 'getconf PATH' returns + ;; something bogus. + ;; Patch the line after "(defcustom tramp-remote-path". + (("\\(tramp-default-remote-path") + (format + #f "(tramp-default-remote-path ~s ~s ~s ~s ~s ~s ~s " + "/run/privileged/bin" + "~/.guix-profile/bin" "~/.guix-profile/sbin" + "~/.guix-home/bin" "~/.guix-home/sbin" + "/run/current-system/profile/bin" + "/run/current-system/profile/sbin"))) + + ;; match ".gvfs-fuse-daemon-real" and ".gvfsd-fuse-real" + ;; respectively when looking for GVFS processes. + (substitute* "tramp-gvfs.el" + (("\\(tramp-process-running-p \"(.*)\"\\)" all process) + (format #f "(or ~a (tramp-process-running-p ~s))" + all (string-append "." process "-real"))))))) (add-before 'configure 'fix-/bin/pwd (lambda _ ;; Use `pwd', not `/bin/pwd'. -- cgit v1.2.3