From patchwork Sun Dec 31 16:59:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 58266 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 946AD27BBE9; Sun, 31 Dec 2023 17:01:34 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C8DA427BBE2 for ; Sun, 31 Dec 2023 17:01:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJzAT-0001IE-Ig; Sun, 31 Dec 2023 12:00:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJzAQ-0001HV-H4 for guix-patches@gnu.org; Sun, 31 Dec 2023 12:00:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJzAQ-0005Ck-6e for guix-patches@gnu.org; Sun, 31 Dec 2023 12:00:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJzAQ-0000V7-Tl; Sun, 31 Dec 2023 12:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68180] [PATCH 1/4] gnu: emacs: Add awk, find, sed and sh to PATH wrapper. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, guix-patches@gnu.org Resent-Date: Sun, 31 Dec 2023 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68180@debbugs.gnu.org Cc: Maxim Cournoyer , Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler X-Debbugs-Original-Xcc: Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler Received: via spool by 68180-submit@debbugs.gnu.org id=B68180.17040419841834 (code B ref 68180); Sun, 31 Dec 2023 17:00:02 +0000 Received: (at 68180) by debbugs.gnu.org; 31 Dec 2023 16:59:44 +0000 Received: from localhost ([127.0.0.1]:46958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJzA8-0000TR-6x for submit@debbugs.gnu.org; Sun, 31 Dec 2023 11:59:44 -0500 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]:45209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJzA5-0000TB-Up for 68180@debbugs.gnu.org; Sun, 31 Dec 2023 11:59:42 -0500 Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-67f8d9fe99fso64062466d6.2 for <68180@debbugs.gnu.org>; Sun, 31 Dec 2023 08:59:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704041975; x=1704646775; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dAN0drCmaN/D4cfuawsBPKwMOxpOynhCpakag9gUIWg=; b=k/n0MMBiDEW5xMewLRa5hmfBONS/Ehu685/rnv25RlJMLbkoFkKVBplyhKm0y/RXy6 iN2D0SL1XnkDfmhp5XkJTKyMD/rsVQZobA6jB38volR9NJF8cYI0kyvzwgyWevL5ijeS 1TYZY3g1GpaTGruSQGg/a1qTavkaqhMfk77Qb2Gf2FFpPZGS6NFqoWiyF+li5U9dlmT7 89bozjayHcIvlJG0m0FaKB2tru4Mi5GIRmGsv5T8ltmGhwkRi86Oaq572NLzm6FIBDQI +LZ1cSIt4/jxJPdR/Dg+qpNH5lHTlL2Z89+KIP0qYdG6Ntsl2mUBLOlG33Qx1oVN6yDp LD2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704041975; x=1704646775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dAN0drCmaN/D4cfuawsBPKwMOxpOynhCpakag9gUIWg=; b=bWD++4zySi/XIXpiwnPtjL5vRXnL6wzQvC+D22FFy9IgEpBmngBtf3EJC768v/qYi/ jxz73zmTMSjPGVX1Q8qeG2ixGDvfjes1fxCobJA/+KZtU3MgXQgplGJRQnGB0QxmLZXA KYcRASzSlRgFtTjyCcaASxh9pQGrOC7Pf6affqOZUacd/EQTa0PHKK+pQh1EWKq8kFBN 2Ufo4f9z+T7HFe1PhurnzkQR1W0kQZ4j+ouffDmRakoSq6DMRsp3d0dDpJiv+FP3Mxtu G2rOhWjLaitO6lSYfH+pyho2b0t3bd2nOT3e48pSBcY5t+8hwtgDChPqo0nI40HuknsP eeAw== X-Gm-Message-State: AOJu0Yx6wn5qbf/moGV7KUzQrPju0qEMZEuS699bz0ISTnEPndT30ptK uMg5wUhmQe5hf3xcQ4bSGXEjAppyXLM= X-Google-Smtp-Source: AGHT+IEKBLLv9+Du1Qjd7MZlGH6KbQzDQvBYzcGK47iuhFY78xOb5cpQfTTT+C456yd6GZSrim6SQw== X-Received: by 2002:a05:6214:226d:b0:67f:494b:c1f8 with SMTP id gs13-20020a056214226d00b0067f494bc1f8mr19971376qvb.32.1704041974722; Sun, 31 Dec 2023 08:59:34 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-187.b2b2c.ca. [72.10.141.187]) by smtp.gmail.com with ESMTPSA id o8-20020a0cecc8000000b0067f37d9196esm8794075qvq.93.2023.12.31.08.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 08:59:34 -0800 (PST) From: Maxim Cournoyer Date: Sun, 31 Dec 2023 11:59:06 -0500 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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] : 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 ;;; Copyright © 2016 Nikita ;;; Copyright © 2017 Marius Bakke -;;; Copyright © 2017, 2019, 2020 Maxim Cournoyer +;;; Copyright © 2017, 2019, 2020, 2023 Maxim Cournoyer ;;; Copyright © 2017 Alex Vong ;;; Copyright © 2017, 2018 Ricardo Wurmus ;;; Copyright © 2017, 2023 Janneke Nieuwenhuizen @@ -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)")