Subject: [PATCH 03/33] gnu: emacs: Patch more program file names.

From: Leo Prikler <[email-masked]>
Date: Thu, 8 Apr 2021 19:49:37 +0200

* gnu/packages/emacs.scm (patch-program-file-names): Patch "ls", "sh" and
"gzip".
---
 gnu/packages/emacs.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index e1b01ac22b..93db9fa242 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -136,6 +136,15 @@
                             "lisp/progmodes/sh-script.el")
                (("\"/bin/sh\"")
                 (format #f "~s" (which "sh"))))
+             (substitute* "lisp/files.el"
+               (("\\(purecopy \"ls\"\\)")
+                (format #f "(purecopy ~s)" (which "ls"))))
+             (substitute* '("src/filelock.c"
+                            "lisp/dired-aux.el"
+                            "lisp/jka-compr.el"
+                            "lisp/jka-cmpr-hook.el")
+               (("\"(sh\|gzip)\"" all cmd)
+                (format #f "~s" (which cmd))))
              #t))
          (add-before 'configure 'fix-/bin/pwd
            (lambda _
@@ -231,6 +240,10 @@
      `(("gnutls" ,gnutls)
        ("ncurses" ,ncurses)
 
+       ;; Required for "core" functionality, such as dired and compression.
+       ("coreutils" ,coreutils)
+       ("gzip" ,gzip)
+
        ;; Avoid Emacs's limited movemail substitute that retrieves POP3 email
        ;; only via insecure channels.  This is not needed for (modern) IMAP.
        ("mailutils" ,mailutils)
@@ -361,7 +374,9 @@ also enabled and works without glitches even on X server."))))
            (delete 'strip-double-wrap)))))
     (inputs
      `(("guix-emacs.el" ,(search-auxiliary-file "emacs/guix-emacs.el"))
-       ("ncurses" ,ncurses)))
+       ("ncurses" ,ncurses)
+       ("coreutils" ,coreutils)
+       ("gzip" ,gzip)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))))
 
-- 
2.31.1