all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 68180@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	Andrew Tropin <andrew@trop.in>,
	Katherine Cox-Buday <cox.katherine.e+guix@gmail.com>,
	Liliana Marie Prikler <liliana.prikler@gmail.com>
Subject: [bug#68180] [PATCH 1/4] gnu: emacs: Add awk, find, sed and sh to PATH wrapper.
Date: Sun, 31 Dec 2023 11:59:06 -0500	[thread overview]
Message-ID: <e91dcea9f480d8e855d87b47fae844e5cdb831d7.1704041948.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <cover.1704041948.git.maxim.cournoyer@gmail.com>

Before this change, using Emacs in a pure environment, e.g. 'guix shell --pure
emacs', would cause problems such as:

  jka-compr-insert-file-contents: Uncompression program ‘sh’ not found

And other problems were found requiring the other tools.  While the above
could be patched in place for 'sh', it seems more robust and universally
useful to have the commands appear on PATH, should other Elisp modules want to
call to these directly as well.

* gnu/packages/emacs.scm (emacs-minimal) [arguments] <phases>: Adjust the
wrap-emacs-paths phase to wrap additional inputs.
[inputs]: Add findutils, gawk and sed.
(%emacs-modules): Add (srfi srfi-26).

Change-Id: Ifb4fe2fc12ddc9eae387adb3da3f7821fab78e65
---

 gnu/packages/emacs.scm | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index b9d9e2b891..85d40d01de 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2016 David Thompson <dthompson2@worcester.edu>
 ;;; Copyright © 2016 Nikita <nikita@n0.is>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017, 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2017, 2019, 2020, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
@@ -59,6 +59,7 @@ (define-module (gnu packages emacs)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages fribidi)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gd)
   #:use-module (gnu packages gettext)
@@ -94,6 +95,7 @@ (define (%emacs-modules build-system)
     `((guix build ,(symbol-append which '-build-system))
       (guix build utils)
       (srfi srfi-1)
+      (srfi srfi-26)
       (ice-9 ftw))))
 
 (define-public emacs-minimal
@@ -231,12 +233,17 @@ (define-public emacs-minimal
                    (wrap-program prog
                      ;; Some variants rely on uname being in PATH for Tramp.
                      ;; Tramp paths can't be hardcoded, because they need to
-                     ;; be portable.
+                     ;; be portable.  "sh", "find", "awk" and "sed" are also
+                     ;; needed by common Elisp modules e.g., for reading
+                     ;; documentation, so have them on PATH.
                      `("PATH" suffix
-                       ,(map dirname
-                             (list (search-input-file inputs "/bin/gzip")
-                                   ;; for coreutils
-                                   (search-input-file inputs "/bin/yes"))))
+                       ,(map (compose dirname (cut search-input-file inputs <>))
+                             (list "bin/awk"
+                                   "bin/find" ;findutils
+                                   "bin/gzip"
+                                   "bin/sed"
+                                   "bin/sh"     ;bash
+                                   "bin/yes"))) ;coreutils
                      `("EMACSLOADPATH" suffix ,lisp-dirs)))
                  (find-files (string-append out "/bin")
                              ;; Matches versioned and unversioned emacs binaries.
@@ -254,7 +261,7 @@ (define-public emacs-minimal
                 (copy-file
                  (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$"))
                  "bin/emacs")))))))
-    (inputs (list bash-minimal coreutils gzip ncurses))
+    (inputs (list bash-minimal coreutils findutils gawk gzip ncurses sed))
     (native-inputs (list autoconf pkg-config texinfo))
     (home-page "https://www.gnu.org/software/emacs/")
     (synopsis "The extensible text editor (minimal build for byte-compilation)")
-- 
2.41.0





       reply	other threads:[~2023-12-31 17:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1704041948.git.maxim.cournoyer@gmail.com>
2023-12-31 16:59 ` Maxim Cournoyer [this message]
2023-12-31 19:13   ` [bug#68180] [PATCH 1/4] gnu: emacs: Add awk, find, sed and sh to PATH wrapper Liliana Marie Prikler
2023-12-31 21:10     ` Maxim Cournoyer
2024-01-01  7:33       ` Andrew Tropin via Guix-patches via
2024-01-02  2:07         ` Maxim Cournoyer
2024-01-02  7:00           ` Andrew Tropin via Guix-patches via
2024-01-02 16:34             ` Maxim Cournoyer
2024-01-19  3:17               ` bug#68180: " Maxim Cournoyer
2023-12-31 16:59 ` [bug#68180] [PATCH 2/4] build: perl: Accept Gexps for #:module-build-flags Maxim Cournoyer
2023-12-31 16:59 ` [bug#68180] [PATCH 3/4] gnu: perl-b-keywords: Update to 1.26 Maxim Cournoyer
2023-12-31 16:59 ` [bug#68180] [PATCH 4/4] gnu: Add emacs-pde Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e91dcea9f480d8e855d87b47fae844e5cdb831d7.1704041948.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=68180@debbugs.gnu.org \
    --cc=andrew@trop.in \
    --cc=cox.katherine.e+guix@gmail.com \
    --cc=liliana.prikler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.