From patchwork Tue Jan 2 01:58:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 58301 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 1916927BBE9; Tue, 2 Jan 2024 02:02:31 +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 5660827BBE2 for ; Tue, 2 Jan 2024 02:02:29 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKU4w-0000Fr-LN; Mon, 01 Jan 2024 21:00:29 -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 1rKU4X-00084Y-Kw for guix-patches@gnu.org; Mon, 01 Jan 2024 21: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 1rKU4X-0007If-CW for guix-patches@gnu.org; Mon, 01 Jan 2024 21:00:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rKU4Z-0008RS-Bl; Mon, 01 Jan 2024 21:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68180] [PATCH v2 1/4] gnu: emacs: Patch awk, find, sed and sh commands. 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: Tue, 02 Jan 2024 02:00:03 +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.170416077332256 (code B ref 68180); Tue, 02 Jan 2024 02:00:03 +0000 Received: (at 68180) by debbugs.gnu.org; 2 Jan 2024 01:59:33 +0000 Received: from localhost ([127.0.0.1]:49080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKU3u-0008Nr-Ub for submit@debbugs.gnu.org; Mon, 01 Jan 2024 20:59:33 -0500 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:43347) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKU3r-0008NI-DJ for 68180@debbugs.gnu.org; Mon, 01 Jan 2024 20:59:20 -0500 Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-680b1335af6so7622366d6.1 for <68180@debbugs.gnu.org>; Mon, 01 Jan 2024 17:59:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704160751; x=1704765551; 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=X2x2Vhpo8C+bpXC85YpuvG6rRyLc0aYmqJOW+Ut1+g8=; b=h2x3Ag7uXn0kc9Z/yVTjtaJ+gjTMzYzvkNbib6C7chZ7ls6KKHadHFDfZzeC6YOsHw RQ0kPUyBSy6hC9QFQy5Q5kbxBZQrFCzuHRxRd3kDHYhUyX1qLHn3WgwwCpqdAh1YqrqS bkvYCJo+b/DVV15ZUKibiLsRegzG0k9spY97EXv12J0zYtq7H0/n/tpdCisI7LZQBfmb ROlR8P57FVU7Djm/PJfuf8kSLqyJi40V/CymO+dMryMaMU70LVGs2t9WLATAvIQyn0KG kxF91wTI5C39B3jN3S2RwJz4RiuGfDzDHG5j7f0MOwXw3i7cclUDUUGr3fuaz1X0kUTD JQQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704160751; x=1704765551; 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=X2x2Vhpo8C+bpXC85YpuvG6rRyLc0aYmqJOW+Ut1+g8=; b=dsbdOfcTm54QXQScKti0z7NdQ87FIcM1qTs/74ZiTQgktObqEStIviX5B01Io+0fO8 y2jYggiGhM1vgjUmQlGkiSgYMojeeHCEFAKn23loBA+uW4WbDIk+BeWcW78GGlVfhm3T SY39HCbYidy+Hbt+muXc3NYEQ0Ihfn6w1bcnxJ7iL4eMvt17r7Ff7dFSZVifCOIBfxcH ZrILh3WAyt7Tknqy7ePXLcmbiEIJJhnZYVVyLGhdEQR3fkK8j1UBwj36KfMYc5IxA3Xm DuTSdFhg7Dw5nMMqPyLv8jQisFfHRoOig053B8dRKrGDkcuEuCZEZNV0pjiZr7cAfRns P9WQ== X-Gm-Message-State: AOJu0YwY7ackw7IDUNwckLfSF4cWEIDc69EB9SHPEkFhDT48+HjslT5J 3AexH90+zd2OJNOt78ALXR5vD8byTUk= X-Google-Smtp-Source: AGHT+IFiyA6ujj38++BijXBx9Y04z8FVavlfpSQaQVNDA+XiqoqP/DASzVoYNLPs0Cz+hPkSLNBK4w== X-Received: by 2002:a05:6214:769:b0:67f:824b:99b3 with SMTP id f9-20020a056214076900b0067f824b99b3mr26911377qvz.38.1704160751391; Mon, 01 Jan 2024 17:59:11 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-187.b2b2c.ca. [72.10.141.187]) by smtp.gmail.com with ESMTPSA id ec17-20020ad44e71000000b0067f90426698sm9082956qvb.23.2024.01.01.17.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 17:59:11 -0800 (PST) From: Maxim Cournoyer Date: Mon, 1 Jan 2024 20:58:24 -0500 Message-ID: <5de95e91832b56eb05175e9022c77b57a266b373.1704160706.git.maxim.cournoyer@gmail.com> 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. * gnu/packages/emacs.scm (emacs-minimal) [arguments]: Extend the patch-program-file-names phase. [inputs]: Add findutils, gawk and sed. Change-Id: Ifb4fe2fc12ddc9eae387adb3da3f7821fab78e65 --- Changes in v2: - Patch references in place instead of wrapping via PATH gnu/packages/emacs.scm | 56 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index b9d9e2b891..3e8de3c2e0 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, 2024 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) @@ -157,13 +158,60 @@ (define-public emacs-minimal (delete-file "configure")))) (add-after 'unpack 'patch-program-file-names (lambda* (#:key inputs #:allow-other-keys) + ;; Substitute "sh" command. (substitute* '("src/callproc.c" "lisp/term.el" "lisp/htmlfontify.el" + "lisp/mail/feedmail.el" + "lisp/obsolete/pgg-pgp.el" + "lisp/obsolete/pgg-pgp5.el" + "lisp/obsolete/terminal.el" + "lisp/org/ob-eval.el" "lisp/textmodes/artist.el" - "lisp/progmodes/sh-script.el") + "lisp/progmodes/sh-script.el" + "lisp/textmodes/artist.el" + "lisp/htmlfontify.el" + "lisp/term.el") (("\"/bin/sh\"") - (format #f "~s" (search-input-file inputs "/bin/sh")))) + (format #f "~s" (search-input-file inputs "bin/sh")))) + (substitute* '("lisp/gnus/mm-uu.el" + "lisp/gnus/nnrss.el" + "lisp/mail/blessmail.el") + (("\"#!/bin/sh\\\n\"") + (format #f "\"#!~a~%\"" (search-input-file inputs "bin/sh")))) + (substitute* '("lisp/jka-compr.el" + "lisp/man.el") + (("\"sh\"") + (format #f "~s" (search-input-file inputs "bin/sh")))) + + ;; Substitute "awk" command. + (substitute* '("lisp/gnus/nnspool.el" + "lisp/org/ob-awk.el" + "lisp/man.el") + (("\"awk\"") + (format #f "~s" (search-input-file inputs "bin/awk")))) + + ;; Substitute "find" command. + (substitute* '("lisp/gnus/gnus-search.el" + "lisp/obsolete/nnir.el" + "lisp/progmodes/executable.el" + "lisp/progmodes/grep.el" + "lisp/filecache.el" + "lisp/ldefs-boot.el" + "lisp/mpc.el") + (("\"find\"") + (format #f "~s" (search-input-file inputs "bin/find")))) + + ;; Substitute "sed" command. + (substitute* "lisp/org/ob-sed.el" + (("org-babel-sed-command \"sed\"") + (format #f "org-babel-sed-command ~s" + (search-input-file inputs "bin/sed")))) + (substitute* "lisp/man.el" + (("Man-sed-command \"sed\"") + (format #f "Man-sed-command ~s" + (search-input-file inputs "bin/sed")))) + (substitute* "lisp/doc-view.el" (("\"(gs|dvipdf|ps2pdf|pdftotext)\"" all what) (let ((replacement (false-if-exception @@ -254,7 +302,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)")