* [bug#67942] [PATCH] gnu: Add liquidprompt.
@ 2023-12-20 15:50 Romain GARBAGE
2023-12-22 16:38 ` bug#67942: " Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Romain GARBAGE @ 2023-12-20 15:50 UTC (permalink / raw)
To: 67942; +Cc: Romain GARBAGE
* gnu/packages/shellutils.scm (liquidprompt): New variable.
Change-Id: I0004568df6dd6011f5e65c9894ce97a8c2533f84
---
gnu/packages/shellutils.scm | 62 +++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 671848fd27..4288d5362a 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -791,3 +791,65 @@ (define-public grc
@end example
")
(license license:gpl2)))
+
+(define-public liquidprompt
+ (package
+ (name "liquidprompt")
+ (version "2.1.2")
+ (home-page "https://github.com/liquidprompt/liquidprompt")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/liquidprompt/liquidprompt")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0ljlq97mh84d6g6r3abb254vrwrdan5v74b69fpd62d7p9ffnsgf"))))
+ (build-system copy-build-system)
+ (arguments
+ (list
+ #:install-plan #~'(("liquidpromptrc-dist" "etc/liquidpromptrc")
+ ("example.bashrc" "share/liquidprompt/examples/")
+ ("liquid.ps1" "share/liquidprompt/examples/")
+ ("liquidprompt" "share/liquidprompt/")
+ ("contrib" "share/liquidprompt/")
+ ("themes" "share/liquidprompt/")
+ ("liquidprompt.plugin.zsh"
+ "share/zsh/plugins/liquidprompt/")
+ ("docs" #$(string-append "share/doc/" name "-"
+ version "/")))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-plugin
+ (lambda _
+ (substitute* "liquidprompt.plugin.zsh"
+ (("source(.*)$")
+ (string-append "source "
+ #$output
+ "/share/liquidprompt/liquidprompt")))))
+ (add-after 'fix-plugin 'fix-tput-path
+ (lambda _
+ (substitute* "liquidprompt"
+ (("([ (])tput " all beg) (string-append beg #$ncurses "/bin/tput "))))))))
+ (synopsis "Full-featured prompt for Bash & Zsh")
+ (description
+ "Liquidprompt is an adaptive prompt for Bash and Zsh that gives
+you a nicely displayed prompt with useful information when you need it. It
+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}:
+@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)))
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#67942: [PATCH] gnu: Add liquidprompt.
2023-12-20 15:50 [bug#67942] [PATCH] gnu: Add liquidprompt Romain GARBAGE
@ 2023-12-22 16:38 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2023-12-22 16:38 UTC (permalink / raw)
To: Romain GARBAGE; +Cc: 67942-done
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
Hello! :-)
Romain GARBAGE <romain.garbage@inria.fr> 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’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2639 bytes --]
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+)))
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-22 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 15:50 [bug#67942] [PATCH] gnu: Add liquidprompt Romain GARBAGE
2023-12-22 16:38 ` bug#67942: " Ludovic Courtès
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).