From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wA9lG6/PG2JbyQAAgWs5BA (envelope-from ) for ; Sun, 27 Feb 2022 20:23:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EP7eF6/PG2JqhQAAauVa8A (envelope-from ) for ; Sun, 27 Feb 2022 20:23:27 +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 27F5A3D19E for ; Sun, 27 Feb 2022 20:23:27 +0100 (CET) Received: from localhost ([::1]:35296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOP8f-0001pB-GX for larch@yhetil.org; Sun, 27 Feb 2022 14:23:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOP8I-0001Vy-GR for guix-patches@gnu.org; Sun, 27 Feb 2022 14:23:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOP8I-0003uK-81 for guix-patches@gnu.org; Sun, 27 Feb 2022 14:23:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOP8I-00056Y-05 for guix-patches@gnu.org; Sun, 27 Feb 2022 14:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53257] [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 19:23: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: Kevin Boulain , 53257@debbugs.gnu.org Received: via spool by 53257-submit@debbugs.gnu.org id=B53257.164598975819576 (code B ref 53257); Sun, 27 Feb 2022 19:23:01 +0000 Received: (at 53257) by debbugs.gnu.org; 27 Feb 2022 19:22:38 +0000 Received: from localhost ([127.0.0.1]:59233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOP7u-00055g-Cm for submit@debbugs.gnu.org; Sun, 27 Feb 2022 14:22:38 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:52820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOP7s-00055V-7o for 53257@debbugs.gnu.org; Sun, 27 Feb 2022 14:22:37 -0500 Received: from [192.168.158.254] ([178.119.10.153]) by albert.telenet-ops.be with bizsmtp id 0KNa2700A3J72EA06KNa4n; Sun, 27 Feb 2022 20:22:34 +0100 Message-ID: <8372c3d084580f785710cdc8c0ebdcb92f45ee51.camel@telenet.be> From: Maxime Devos Date: Sun, 27 Feb 2022 20:22:28 +0100 In-Reply-To: <20220227183415.12487-1-kevinboulain@gmail.com> References: <811cc55626870dbf37af3418e8effe191948541a.1642168254.git.florhizome@posteo.net> <20220227183415.12487-1-kevinboulain@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-EAFwVf5ZUdtVvOhWbpan" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1645989754; bh=d+5lH8fNXj0WM2EZKLQtKlXGnYj4bXFlP3JJZPzfKz0=; h=Subject:From:To:Date:In-Reply-To:References; b=QiBOF9ogXmYXVNKqicB9lLryXzfWo+NS+LSRjgbYlfalqqjXQJpXK1vbtlsJlYGeQ 7vp/cPhNq1191eXbFQxkWI2R4Rn7QwUaxSUlZjn58MaFgakjMgMECVdFRbuuZe8MwD z9XyUMuyPToK6pPxSFlBWflOXpvi5wJpsXuXRcAnMS+cP1YkUk+na7AOX2Kq+9v2bX bVr8JcBo/oSu7br4PMQg9orAkJCDdNgIPE4mHu2msbHmL+tfxf1CDHordwfwslsO8u LisDQts65melL3r/U1Di0oCuvwMLD5zW3HEfun1WWOH66py63jxDXJAz3Qm74AQnsE 7r8umEbrzW8hg== 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=1645989807; 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=d+5lH8fNXj0WM2EZKLQtKlXGnYj4bXFlP3JJZPzfKz0=; b=qCBbcE1+sZIZ1dNtOpvfQKpsmWX6L9g8MpIWS4ahR+W1shHzuEUYGc/2Ct7O03Uux8L9Uv 2vZwt4hUS7rvi5ADvYDeETh6YBn8FwyYwmhrqwvnPcWqp5A1D1VTRo26HWh09e41B5AvlG 2S9HZoync4rmp4uaFf5FAVYP0Evp7iAC1Slqj3EzgPhGjhskMkB37cLjkonlJUrxM7/0q2 crb8p13mJdfwELstq7fKCqFKDtprQ5n2HhQGxVvpoPHhDIKagIL7fSVIeq7XQERwrnGg4W Q7HIHjSbdGoEQ4xLiWh4oo4V7yeGe6cqQNE3dK1IPtLwN/9SluI9nctuO/k2yw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645989807; a=rsa-sha256; cv=none; b=lTVCX2/ujIMhtUARv6KykwacsSUxD4jywKxBUDL6Yqbcam9epjJVULu9dZl2IfXRXm1UyO SpfrffoG7l5lZ7WM+xM+PVUt5xPhUC5l3sUaPWhmDu8PEiNTlLDp5ZdLoK7vkX87k4TN1/ 1tXoxUiXfXuJe9ljKN1W1f7G3g4Wfwk8OYASh3FFLBIlvGz6AK2LxmXjOptSfKd49qsBMo 62xnraGj08JykB60aUjKVBelEswUwH+x8BS40FEcZ+YK9m2ROKx9g85GTtPmOMnimwiurx rYRBoy/hbGYTxCJymp9WBaLUtzo14IxykyWZJvrqCTKXYCsvNM0o3VR3y83BGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=QiBOF9og; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 2.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=QiBOF9og; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 27F5A3D19E X-Spam-Score: 2.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: jNroJvA20GT9 --=-EAFwVf5ZUdtVvOhWbpan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Kevin Boulain schreef op zo 27-02-2022 om 19:34 [+0100]: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (modify-phases %standard-phases > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-after 'install 'wr= ap-program > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (lambda* (#= :key inputs outputs #:allow-other-keys) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (let* ((out (assoc-ref outputs "out"))) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ;; footclient executes programs under the server process, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ;; there is no need to wrap it too. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (wrap-program (string-append out "/bin/foot") > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 `("TERMINFO_DIRS" ":" prefix > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (,(string-append out "/share/terminfo")))= ))))))) You'll need to add 'bash-minimal' to 'inputs', such that this works even when cross-compiling. I think "./pre-inst-env guix lint foot" would warn about this. Also, this can be simplified a bit, to ,#(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"))))))= )))) or, reducing the whitespace: ,#(modify-phases %standard-phases (add-after 'install 'wrap-program (lambda _ (define 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"))))))))= ) (you'll need to add (guix gexp) to the list of imports to do this) YMMV on whether this is an improvement. 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? Yes, this was the idea, though to be 100% sure it would need to be tested (= by running "guix shell --pure foot -- foot" and then running ~/.guix-profile/bin/SOME-NCURSES-APP in the terminal, or something like tha= t. If yes, should I send another patch to fix the other terminals (e.g.: =20 https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/terminals.scm?= id=3D85a5110de79f4fe9fd822ede3915654ee699d6c5#n220 )? That would be nice, but keep in mind that this might not be needed for every terminal app -- some apps set TERMINFODIR automatically (I forgot= which) and hence don't need any wrapping. Greetings, Maxime. --=-EAFwVf5ZUdtVvOhWbpan Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYhvPdBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uILAP43efpOmGnn55IIB5ewDfQhbc6O sqSZxucVPw6IJs19rQD/TNRVgYgX5upMdRy6JXUr3tAolWqdbn9iu9LrY9pRJAg= =Oiz0 -----END PGP SIGNATURE----- --=-EAFwVf5ZUdtVvOhWbpan--