unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Boulain <kevinboulain@gmail.com>
To: 53257@debbugs.gnu.org
Cc: Kevin Boulain <kevinboulain@gmail.com>
Subject: [bug#53257] [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS
Date: Tue,  1 Mar 2022 20:28:08 +0100	[thread overview]
Message-ID: <20220301192808.14411-1-kevinboulain@gmail.com> (raw)
In-Reply-To: <811cc55626870dbf37af3418e8effe191948541a.1642168254.git.florhizome@posteo.net>

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 <http://www.gnu.org/licenses/>.
 
 (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





  parent reply	other threads:[~2022-03-01 19:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 14:02 [bug#53257] [PATCH] gnu: foot: expose terminfo dirs via native-search-paths florhizome
2022-01-14 19:02 ` Maxime Devos
2022-01-14 22:52   ` Florian
2022-01-15 11:45     ` Maxime Devos
2022-01-15 11:48     ` Maxime Devos
2022-01-15 12:30     ` Maxime Devos
2022-01-15 15:19       ` Florian
2022-01-15 15:38         ` Maxime Devos
2022-01-15 18:46           ` Florian
2022-01-23 21:26             ` Maxime Devos
2022-01-15 15:46         ` Maxime Devos
2022-01-15 15:46         ` Maxime Devos
2022-01-15 14:24     ` Maxime Devos
2022-01-28 22:34       ` Ludovic Courtès
2022-02-08 12:46         ` Maxime Devos
2022-02-10 20:30           ` Ludovic Courtès
2022-02-10 21:45             ` Maxime Devos
2022-02-12 21:49               ` Ludovic Courtès
2022-02-27 18:34 ` [bug#53257] [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS Kevin Boulain
2022-02-27 18:41   ` Kevin Boulain
2022-02-27 19:22   ` Maxime Devos
2022-02-28 20:29     ` Kevin Boulain
2022-03-01 19:34     ` Kevin Boulain
2022-03-01 19:28 ` Kevin Boulain [this message]
2022-06-19  5:27   ` Tom Fitzhenry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220301192808.14411-1-kevinboulain@gmail.com \
    --to=kevinboulain@gmail.com \
    --cc=53257@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).