From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 01 14:26:36 2022 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 To: 53257@debbugs.gnu.org Subject: [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS 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-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53257 Cc: Kevin Boulain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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