From patchwork Tue Jan 2 19:39:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 58332 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 1840C27BBE2; Tue, 2 Jan 2024 19:41:38 +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=ham 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 20F5D27BBEC for ; Tue, 2 Jan 2024 19:41:35 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKkdK-0006T5-OT; Tue, 02 Jan 2024 14:41:02 -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 1rKkdJ-0006SU-3d for guix-patches@gnu.org; Tue, 02 Jan 2024 14:41:01 -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 1rKkdI-0006f7-Rc for guix-patches@gnu.org; Tue, 02 Jan 2024 14:41:00 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rKkdL-0001ki-0V; Tue, 02 Jan 2024 14:41:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68180] [PATCH v3 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 19:41: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.17042244276642 (code B ref 68180); Tue, 02 Jan 2024 19:41:02 +0000 Received: (at 68180) by debbugs.gnu.org; 2 Jan 2024 19:40:27 +0000 Received: from localhost ([127.0.0.1]:51309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKkck-0001j3-F3 for submit@debbugs.gnu.org; Tue, 02 Jan 2024 14:40:26 -0500 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:55731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKkci-0001ic-Fz for 68180@debbugs.gnu.org; Tue, 02 Jan 2024 14:40:25 -0500 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-4283665650dso103911cf.3 for <68180@debbugs.gnu.org>; Tue, 02 Jan 2024 11:40:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704224416; x=1704829216; 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=oUKlSH6c18dJHO2zp1jgPuz295eCQNmHtK1sLLI9zIc=; b=XD8QmT82/TmhMChJrjr9tVHI5ggcUyC67quqT3t2fSRKjF0yyYjOIVe+VeLE3NIrf+ gT1H9/Dx48PIdJXu9lACzDfiOIvMWXQCUl2+XH8p6HnBEiWuFVuKsVrmbdj+uyDbEhvE G9kAgMBFaeTF10aNYE1M5mH2IjNwLKmCYX589/Vff9oHLvqU3kL/3rRW9O+f24eUOxK7 Jx3ubpKHxqNKDtZag29cyoXxACjHaq0XcMNOdwQs3po5xtZkpkbnkjfSGHRGrTuMSFwr R4aUUd2PStPMqqmOcy3TQmyWc4pcqe+B4RjWMd99Qx/L9VAvfMh+OrERTwZRObyZVAHC ZIvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704224416; x=1704829216; 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=oUKlSH6c18dJHO2zp1jgPuz295eCQNmHtK1sLLI9zIc=; b=aWHqUXNON8tAQ80RyF7phxBEUrlLdiTp/+zLhthh9mmjGG2RrSWvdwmqlB+1I8P1dQ ftRGq8bBC8zuzgIzQyR2y8fNzgNzpwLfdmbahlp5Srwl7+/9DU9xJjGteO4jtDP+nrYw jEZyMk34btbKq6rtcI2hwnUEZ7ooFyKCtaG/j2Np6w/C5+eg6jBM7wJ6rJHDLmF5pKw/ K8/BAXk4gCKMMGzZCgX+5Ueq9me21Nl8PTWsK8KRftpNaC3a548mAR8bMcaL3Plv0I7m qhrLSzkpTxCexLII6WLdsz1M5Bk5NAKKWq9ISJsorYq7AW/8WC1mu7lV7c4txBJp8dB+ 1S8g== X-Gm-Message-State: AOJu0YzqYA7E+lDTuy3CgTTfg82Jm+EgAgz24fgj3CuBhNp4RptUtGN5 NYSJUcTrE3zZk61VutJsL00Z2NP8hGc= X-Google-Smtp-Source: AGHT+IEqVxsQL97thTf6mLsVUSJNuBOiuvJ2uK4/8xmHaxjUOb4VuhWk8MKLIdoPj/2fQOgh+wRo4w== X-Received: by 2002:a05:622a:302:b0:428:3266:1616 with SMTP id q2-20020a05622a030200b0042832661616mr1101695qtw.129.1704224415924; Tue, 02 Jan 2024 11:40:15 -0800 (PST) Received: from localhost.localdomain (dsl-10-132-1.b2b2c.ca. [72.10.132.1]) by smtp.gmail.com with ESMTPSA id ge7-20020a05622a5c8700b0042836231a8asm100107qtb.45.2024.01.02.11.40.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 11:40:15 -0800 (PST) From: Maxim Cournoyer Date: Tue, 2 Jan 2024 14:39:25 -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. * gnu/packages/emacs.scm (emacs-minimal) [arguments]: Extend the patch-program-file-names phase. [inputs]: Add findutils, gawk and sed. Change-Id: Ifb4fe2fc12ddc9eae387adb3da3f7821fab78e65 --- (no changes since v2) 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)")