From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iNWQLwR3HmKz6QAAgWs5BA (envelope-from ) for ; Tue, 01 Mar 2022 20:41:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kIxCKAR3HmIDWAAAG6o9tA (envelope-from ) for ; Tue, 01 Mar 2022 20:41:56 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 43A7B11069 for ; Tue, 1 Mar 2022 20:41:56 +0100 (CET) Received: from localhost ([::1]:54516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nP8Nd-0000L4-8c for larch@yhetil.org; Tue, 01 Mar 2022 14:41:53 -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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646163716; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=V04gPdONKOGnMN9zZU6dfSxB9k1Tr863N+VZqL5tw0s=; b=JxfKiMYgTIgr2vW4t7Yg8BsgkOpHegNFL+YTE4KM5jLn4cKiU5pGrtVnows5xkmcecsUrW BBZrv6NEWKoocJuntRPxtFlR67zFA78kvk/MOGUTd31OlbJ5+BfCdMzaCi1N+mfPqgUQzO rkrjm3d2OLND+SZ9KuMh8RHI1Wv5mMP0JiK9DtAk0zOwhdv6xwWXWu9oYNkA45j3aGp218 0+SAQO5iwAH45VrNkEjAaU+HafsE+mS7a4180bzGaqkPXnlQxkM72lW+L8i0Q7d6YCnaIG QtG9c1hbuDuvRhUHZ5Jkssr9JkmqdV9fHwi7LfHtbTluVl/dB+Mqbs4jn7Q4yg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646163716; a=rsa-sha256; cv=none; b=lMjcKPegSkZjAIfDqlsmNSabHTLjKsN9p14d7e6/zXCCGNBPPb8PZleXGMlgHA5OLCLGYS PVRSit98C+UnaOdkaXqUasKqjhBAhN29u+kJLg5swAB+9WLK57KOY9bYaFOjdmh7DU9g+o smcRAr6ALQp0KDsVEg2jXkJMfSFt/Vn3Mxsx/V//L9jGGKgiDdP3nigIx4e95h1Rlu1FvM ZZvoZJfkf1U25sxVtjKFITS/I/S4HouoipQ8glXH4E1tw7aG/Dx/D83uxcahyCwi/pA7xS S/45OtbPoy69MB+c893ZtgFn2HunPfSSxvOyUzRrdcU4QhC1y//QYG3rm+dd8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=CWQjCoNi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=CWQjCoNi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 43A7B11069 X-Spam-Score: 6.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: Aw1AXoKurtqF 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 -- 2.34.0