From patchwork Fri Dec 22 16:38:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 57987 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ADFD127BBE9; Fri, 22 Dec 2023 16:39:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 453C327BBE2 for ; Fri, 22 Dec 2023 16:39:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGiY7-0006XQ-R9; Fri, 22 Dec 2023 11:38:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGiY5-0006Wo-SD for guix-patches@gnu.org; Fri, 22 Dec 2023 11:38:57 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGiY5-00011w-Je for guix-patches@gnu.org; Fri, 22 Dec 2023 11:38:57 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGiY9-0008N0-TC for guix-patches@gnu.org; Fri, 22 Dec 2023 11:39:01 -0500 Subject: bug#67942: [PATCH] gnu: Add liquidprompt. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Fri, 22 Dec 2023 16:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 67942 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Romain GARBAGE Cc: 67942-done@debbugs.gnu.org Mail-Followup-To: 67942@debbugs.gnu.org, ludo@gnu.org, romain.garbage@inria.fr Received: via spool by 67942-done@debbugs.gnu.org id=D67942.170326310632121 (code D ref 67942); Fri, 22 Dec 2023 16:39:01 +0000 Received: (at 67942-done) by debbugs.gnu.org; 22 Dec 2023 16:38:26 +0000 Received: from localhost ([127.0.0.1]:47709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGiXZ-0008M0-J0 for submit@debbugs.gnu.org; Fri, 22 Dec 2023 11:38:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGiXW-0008Lm-0W for 67942-done@debbugs.gnu.org; Fri, 22 Dec 2023 11:38:24 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGiXJ-0008Mt-Qn; Fri, 22 Dec 2023 11:38:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=0mUBRf/lV1vImrgvFTu69YGGlL0HvjhOFj3e+XZLAJg=; b=O8euEjkW4oG+MbH5h9UM BAgbAGAPp1uGBWPuGCrBrPylQP6d3RdDW5ViJcKAjHweSmwJm5GN+Op/d/kdNqhhR+Oq6zjiWYNmP 4kyuVx2F+cV4Le7KOhNk1Yb1jSBhKzRzcQcIoO+XKkEToBywQXjwLTV3kFF8gUMnNVQm2vrE7pBbi ppj38upj4z37JU9B+m5gGKfGnAbNq3hFQXuo87x47z8llZnTQi6SUIdoA27Yz1Donbg1n7ZDJw9jE PY02Afr7Db6xwBMxXxGqSH45tccn7Hm922L0Ahw+z0nA8FKgslAnT7LCNJdVnKEP+fV7gSpFv7W/i 4QuHxSyW2Ykbtw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= In-Reply-To: <20231220155036.12229-1-romain.garbage@inria.fr> (Romain GARBAGE's message of "Wed, 20 Dec 2023 16:50:34 +0100") References: <20231220155036.12229-1-romain.garbage@inria.fr> Date: Fri, 22 Dec 2023 17:38:06 +0100 Message-ID: <87o7ei9or5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello! :-) Romain GARBAGE skribis: > * gnu/packages/shellutils.scm (liquidprompt): New variable. > > Change-Id: I0004568df6dd6011f5e65c9894ce97a8c2533f84 Nice! I took the liberty to make the changes below: license is AGPLv3+ because source code does not say otherwise, I change the direct reference to ‘ncurses’ to an input + ‘search-input-file’ (that way, users could inherit from the package, provided it a different ‘tput’-providing package, and it’d just work), and shrinked the synopsis. Thank you! Ludo’. diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index 4288d5362a..f010a50538 100644 --- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm @@ -828,9 +828,13 @@ (define-public liquidprompt #$output "/share/liquidprompt/liquidprompt"))))) (add-after 'fix-plugin 'fix-tput-path - (lambda _ + (lambda* (#:key inputs #:allow-other-keys) (substitute* "liquidprompt" - (("([ (])tput " all beg) (string-append beg #$ncurses "/bin/tput ")))))))) + (("([ (])tput " all beginning) + (string-append beginning + (search-input-file inputs "bin/tput") + " ")))))))) + (inputs (list ncurses)) (synopsis "Full-featured prompt for Bash & Zsh") (description "Liquidprompt is an adaptive prompt for Bash and Zsh that gives @@ -838,18 +842,17 @@ (define-public liquidprompt does this with a powerful theming engine and a large array of data sources. In order to use liquidprompt with Zsh, you should use the following snippet -with @code{guix home}: +with Guix Home: + @example -(services (list ;;... - (service home-zsh-service-type - (home-zsh-configuration - (zshrc (list ;;... - ;; This loads liquidprompt - (mixed-text-file \"liquidprompt\" - \"[[ $- = *i* ]] && source \" liquidprompt \"/share/liquidprompt/liquidprompt\") - ;; This loads the powerline theme available in liquidprompt - (mixed-text-file \"powerline-theme\" - \"source \" liquidprompt \"/share/liquidprompt/themes/powerline/powerline.theme\"))))))) -@end example -") - (license license:agpl3))) +(service home-zsh-service-type + (home-zsh-configuration + (zshrc (list ;;... + ;; This loads liquidprompt + (mixed-text-file \"liquidprompt\" + \"[[ $- = *i* ]] && source \" liquidprompt \"/share/liquidprompt/liquidprompt\") + ;; This loads the powerline theme available in liquidprompt + (mixed-text-file \"powerline-theme\" + \"source \" liquidprompt \"/share/liquidprompt/themes/powerline/powerline.theme\")))))) +@end example\n") + (license license:agpl3+)))