GNU bug report logs - #53257
Setting TERMINFO_DIRS

Previous Next

Package: guix-patches;

Reported by: florhizome <florhizome <at> posteo.net>

Date: Fri, 14 Jan 2022 16:07:01 UTC

Severity: normal

Tags: patch

Full log


Message #61 received at 53257 <at> debbugs.gnu.org (full text, mbox):

From: Kevin Boulain <kevinboulain <at> gmail.com>
To: 53257 <at> debbugs.gnu.org
Cc: Kevin Boulain <kevinboulain <at> gmail.com>
Subject: [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS
Date: Sun, 27 Feb 2022 19:34:15 +0100
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.

Tested:
  ./pre-inst-env guix install foot
  cat "$(which foot)"
  #!/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash
  export TERMINFO_DIRS="/gnu/store/6dwhps0cgzk0z7c3q2q596l52ibzdl5c-foot-1.11.0/share/terminfo${TERMINFO_DIRS:+:}$TERMINFO_DIRS"
  exec -a "$0" "/gnu/store/6dwhps0cgzk0z7c3q2q596l52ibzdl5c-foot-1.11.0/bin/.foot-real" "$@"
---
 gnu/packages/terminals.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 06fa341472..65553ac295 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -852,7 +852,19 @@ (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* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               ;; 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))
-- 
2.34.0





This bug report was last modified 2 years and 361 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.