From patchwork Tue Mar 1 19:28:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Boulain X-Patchwork-Id: 37573 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 8CD8827BBEA; Tue, 1 Mar 2022 19:41:53 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 47F9927BBE9 for ; Tue, 1 Mar 2022 19:41:53 +0000 (GMT) Received: from localhost ([::1]:54516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nP8Nb-0000L4-DA for patchwork@mira.cbaines.net; Tue, 01 Mar 2022 14:41:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP89H-0001ie-97 for guix-patches@gnu.org; Tue, 01 Mar 2022 14:27:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nP89G-0007Ki-9w for guix-patches@gnu.org; Tue, 01 Mar 2022 14:27:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nP89G-0006Gv-0K for guix-patches@gnu.org; Tue, 01 Mar 2022 14:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53257] [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS References: <811cc55626870dbf37af3418e8effe191948541a.1642168254.git.florhizome@posteo.net> In-Reply-To: <811cc55626870dbf37af3418e8effe191948541a.1642168254.git.florhizome@posteo.net> Resent-From: Kevin Boulain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Mar 2022 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53257 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53257@debbugs.gnu.org Cc: Kevin Boulain Received: via spool by 53257-submit@debbugs.gnu.org id=B53257.164616279624063 (code B ref 53257); Tue, 01 Mar 2022 19:27:01 +0000 Received: (at 53257) by debbugs.gnu.org; 1 Mar 2022 19:26:36 +0000 Received: from localhost ([127.0.0.1]:38316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP88q-0006G3-87 for submit@debbugs.gnu.org; Tue, 01 Mar 2022 14:26:36 -0500 Received: from mail-ed1-f43.google.com ([209.85.208.43]:41643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP88o-0006Fr-Oc for 53257@debbugs.gnu.org; Tue, 01 Mar 2022 14:26:35 -0500 Received: by mail-ed1-f43.google.com with SMTP id w3so23345217edu.8 for <53257@debbugs.gnu.org>; Tue, 01 Mar 2022 11:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=V04gPdONKOGnMN9zZU6dfSxB9k1Tr863N+VZqL5tw0s=; b=CWQjCoNixfseeS81Uug4TLm0UHPOzkOc5PP8g/pUJENcQrcw3ekSVAXcIvrB0Ior3x EuAi22hF4PoWphhghZWM7kMQkwnmbSOYKqKI+Jcgu3QMlvP8D39v3sxWFXbKFa+f7I4G 2FdwUyjlFPR4wo8KhEpbCUsJpEdE9hQ/HTrwL9g5/AZOIQ08C38JWOTh4vtq0XA3H/c6 8cTsbwHvLodkwSd1F9d66VvuD5eYsQx23CXeW9n+yzoqBAnhW4ck5hRC4nJWnMCbu5nr 5CX68A5P2OnPi/c65iC/mBSHskgjV+73aKKDUjPT9IIXCNm7LzY2oUTdLgmaRloLxfwm RXag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=V04gPdONKOGnMN9zZU6dfSxB9k1Tr863N+VZqL5tw0s=; b=i1vlQ+42piYGI5S9755Z8WzWJ/L6UHAFIrjt4+0Rfw5H7ySL4wrM2dlyRycGo9VhyV K6mLh8LChiCayywSQRAXSl9LO9JAxvqhA7pXcfU13XgaJIya5gbwG25Rj2hC0sJwu8DZ fEAOHKewZ4UiIHaGFFMUs5FDulmEOPw9obU+LpqyRM2YH3H+FoU3YT1703+rKhi4gdrd TL4ZR1r53+RIUR5er4iIHbIKQJC9/3AXpZcOVBLWRzqVsmjxFXA2pj+Et+VOYLC/Z3Jc YNHSoOhBALv24PPU9mIHFFU8kXn6VaSAE96cNjCIvhfX7bcPCIYnFf3KwbVGGPj8DTpp qmFg== X-Gm-Message-State: AOAM531d8Ipz0fUwHb3WOT8cGtVKeVqq1ACbM6mQ5GiKTzlONpR0pQKU DFhxCPGpVMGLIfgk6fLGoZH6Un7wLAk= X-Google-Smtp-Source: ABdhPJxdLI9emhll7AS5OelLjizHKkPIpckfddzSbVUs3dT60WF71GJjNl+1pWdEPz+ajkl62WAQhw== X-Received: by 2002:a50:ed0c:0:b0:410:bbf:ec14 with SMTP id j12-20020a50ed0c000000b004100bbfec14mr25471745eds.116.1646162788472; Tue, 01 Mar 2022 11:26:28 -0800 (PST) Received: from localhost.localdomain ([51.154.70.17]) by smtp.gmail.com with ESMTPSA id vj23-20020a170907131700b006d583aff7easm5531499ejb.125.2022.03.01.11.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 11:26:27 -0800 (PST) From: Kevin Boulain Date: Tue, 1 Mar 2022 20:28:08 +0100 Message-Id: <20220301192808.14411-1-kevinboulain@gmail.com> X-Mailer: git-send-email 2.34.0 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" X-getmail-retrieved-from-mailbox: Patches As discussed in https://issues.guix.gnu.org/53257, it appears the preferred way to expose TERMINFO_DIRS to programs running under a terminal is to wrap the terminal with a script that sets TERMINFO_DIRS before exec'ing it. This is less invasive than unconditionally setting TERMINFO_DIRS in the profile (via native-search-paths) as this particular environment variable is only necessary when running the terminal itself. * gnu/packages/terminals.scm (foot): Export TERMINFO_DIRS. --- gnu/packages/terminals.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm index 06fa341472..558b91fa24 100644 --- a/gnu/packages/terminals.scm +++ b/gnu/packages/terminals.scm @@ -48,6 +48,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages terminals) + #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system cargo) #:use-module (guix build-system cmake) @@ -63,6 +64,7 @@ (define-module (gnu packages terminals) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) @@ -852,12 +854,24 @@ (define-public foot ;; also to address a GCC 10 issue when doing PGO builds. #:build-type "release" ;; Enable LTO as recommended by INSTALL.md. - #:configure-flags '("-Db_lto=true"))) + #:configure-flags '("-Db_lto=true") + ;; Ensure the terminfo database is available to programs spawned under + ;; the terminal. + #:phases + ,#~(modify-phases %standard-phases + (add-after 'install 'wrap-program + (lambda _ + (let ((out #$output)) + ;; footclient executes programs under the server process, + ;; there is no need to wrap it too. + (wrap-program (string-append out "/bin/foot") + `("TERMINFO_DIRS" ":" prefix + (,(string-append out "/share/terminfo")))))))))) (native-inputs (list ncurses ;for 'tic' pkg-config scdoc wayland-protocols)) (inputs - (list fcft libxkbcommon wayland)) + (list bash-minimal fcft libxkbcommon wayland)) (synopsis "Wayland-native terminal emulator") (description "@command{foot} is a terminal emulator for systems using the Wayland