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 CFCBMGbGG2IInwAAgWs5BA (envelope-from ) for ; Sun, 27 Feb 2022 19:43:50 +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 yARfKWbGG2LlQwEAG6o9tA (envelope-from ) for ; Sun, 27 Feb 2022 19:43:50 +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 6341788BB for ; Sun, 27 Feb 2022 19:43:50 +0100 (CET) Received: from localhost ([::1]:47594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOOWJ-0003Ls-LJ for larch@yhetil.org; Sun, 27 Feb 2022 13:43:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOOVa-0003Kn-AI for guix-patches@gnu.org; Sun, 27 Feb 2022 13:43:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOOVZ-0007LK-WF for guix-patches@gnu.org; Sun, 27 Feb 2022 13:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOOVZ-00048G-UT for guix-patches@gnu.org; Sun, 27 Feb 2022 13:43:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53257] [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS Resent-From: Kevin Boulain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 18:43: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 Received: via spool by 53257-submit@debbugs.gnu.org id=B53257.164598735715853 (code B ref 53257); Sun, 27 Feb 2022 18:43:01 +0000 Received: (at 53257) by debbugs.gnu.org; 27 Feb 2022 18:42:37 +0000 Received: from localhost ([127.0.0.1]:59202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOOVA-00047d-J3 for submit@debbugs.gnu.org; Sun, 27 Feb 2022 13:42:36 -0500 Received: from mail-lj1-f175.google.com ([209.85.208.175]:39877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOOV9-00047Q-0M for 53257@debbugs.gnu.org; Sun, 27 Feb 2022 13:42:35 -0500 Received: by mail-lj1-f175.google.com with SMTP id bn33so14529376ljb.6 for <53257@debbugs.gnu.org>; Sun, 27 Feb 2022 10:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=xwx+JbP+dNvHpleylJp94YW2WfPI9bsJhvvjHYzXfWU=; b=d9WzTNhHGCZPku2ro8w7wae5of/h9eD9eoo0ORcyhonGutnEdhFlaaUSl/fClGcOjK XGPNPuaKdHspmeylUxe8255pyIa5sAEelGASy3fTOTdEACDVrFXmqFWiMbWlAKrl02M+ 2ufpRB0bq59shAx9iGT6hhvNNUqAbkE1Zx6acBOPPUce6VtX8DMaeRYFeJRIx6h7LjXN gZbxhHssBVa8rqq0bWmFL28Rp9DMKQC/t7ADfbdh791X+ereCSS6GuYZElthM6i6qldR r5Ux5vgIF0zt5ykefrbzZcltQ6U51v1r1o+OVhmx9HqBcG/3mMx2ooTrM4guhP6vwdSy Nulw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=xwx+JbP+dNvHpleylJp94YW2WfPI9bsJhvvjHYzXfWU=; b=avXymJfa+BvmskTi72skAQGgEV4WpAOoz363IyTvJU5qZtko0HWxm4wglzg9TK1hQ1 4ddY3Ouf031IS4PsDazkZz81l1yxELz3kJeCIig7TMWhrPSggR0k1pMQGXw/7+NHWx75 pd+d5Tu6dJlQbFRr+kKjTGHBrIDOF0/3Ha8jV3bPhDKVNomJ++WdWQvlJtIvvdK4HRlf uaBoAwM9w+KmLaYFOPProNaU4cfaMhtj70v79gorUoyU/ZP+8c9YIobJBm2bj7Pq3Pzr 9v+484oorf/1NGLc/qfjbw2rzzZW0JAu2/ZPP4Rhglsx7+BtVL5g526Cbz1IefUMETSo MSNQ== X-Gm-Message-State: AOAM532yLIVVOjEnlTV3E6ABPNr//dyNNSWnUSAqca6DznbCvyM8eYfs szv0qkaqsZpT5osKha3c8rqJtKU2gz2go9jhtgGmoeudnjM= X-Google-Smtp-Source: ABdhPJxO9ZtunZdWSvemfLCW6Wop3bKasL90udUmt0WcToYDQrbrad2nI/1/Sl30j2hs+Onukaq2R+YMsSG59dCBSLg= X-Received: by 2002:a05:651c:14f:b0:23d:8a2a:456d with SMTP id c15-20020a05651c014f00b0023d8a2a456dmr12250425ljd.196.1645987348440; Sun, 27 Feb 2022 10:42:28 -0800 (PST) MIME-Version: 1.0 References: <20220227183415.12487-1-kevinboulain@gmail.com> In-Reply-To: <20220227183415.12487-1-kevinboulain@gmail.com> From: Kevin Boulain Date: Sun, 27 Feb 2022 19:41:52 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" 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=1645987430; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: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=xwx+JbP+dNvHpleylJp94YW2WfPI9bsJhvvjHYzXfWU=; b=fw2E5eZNF+1OKPfErAerudKhgCdKALEMKeEqzObxjaUz8V9nwgMPkGvffZs406Inzg7dUh AZlmIRsEeawEBQoHboNZ1l09iXh00Jb4lcEJqDbvBthelKVHu2jpzkWqlVnjGm32vfxtvO fj3B6MOF1vQvNdNRZnXdfvzaqifMtEB5DkU0df98ESxbkXPagOmgR4qpp7TI+tQbygAHh0 xE/T1Mi4WkCwXAjEkvg86QfmkpOJsOyl1H3lxs12ItMuFrw9tAHsUy5ML105yS3b7gHQMt L6Eo6FzvDzG6M3YvcKFMb1EAx915NMi/0oRdKFJnt0xHjPhPka+uKQrV1NqRzg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645987430; a=rsa-sha256; cv=none; b=Uyg4UymMS6GDHTCVfODKWSnMbmpcoV7zak3Fdz2QhzAy4NmNilQfAmcW+/qTPi5fkGicUo T+q/IS83eOl35AE39KcT1y91iddpWwMkUpI0x7yPl1ru4tGKmzFtkaUDuP8FK+0ZcB2MoG zsYk/m6F6EUBLk10dJ4C+XF4UfNalqUOXrLMwO5v2DcsEqw48e8EUQledltxyf9riht1UI ricjxYEmDsdct5vaLCiols2QIOXJs2IzCHkyG1hcxYXoQpblXgIW7DpMxK7UYmQOl8mFbp 6k/gAe++U3QX+KPhuKLuh76GKpv6PUO/GhylTu3sWrv76sE7mOSC+E5nNOjTQA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=d9WzTNhH; 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: 5.39 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=d9WzTNhH; 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: 6341788BB X-Spam-Score: 5.39 X-Migadu-Scanner: scn0.migadu.com X-TUID: IhzSfv1Wl5Xo I hope you don't mind, I went ahead and used wrap-program as discussed (I was encountering this issue and had a very similar patch as the OP's). Did I get the idea that was discussed in this thread right? If yes, should I send another patch to fix the other terminals (e.g.: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/terminals.scm?id=85a5110de79f4fe9fd822ede3915654ee699d6c5#n220)? On Sun, 27 Feb 2022 at 19:32, Kevin Boulain wrote: > > 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 >