From: Alexandr Vityazev <avityazev@posteo.org>
To: 50709@debbugs.gnu.org
Subject: [bug#50709] [PATCH] v2 gnu: Add zsh-syntax-highlighting.
Date: Sat, 02 Oct 2021 18:52:00 +0000 [thread overview]
Message-ID: <8735pj5kfj.fsf@posteo.org> (raw)
In-Reply-To: <87sfxy4zpa.fsf@posteo.org>
* gnu/packages/shellutils.scm (zsh-syntax-highlighting): New variable.
---
gnu/packages/shellutils.scm | 56 ++++++++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 94b5536df7..8726020ab3 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -10,6 +10,8 @@
;;; Copyright © 2020 aecepoglu <aecepoglu@fastmail.fm>
;;; Copyright © 2020 Dion Mendel <guix@dm9.info>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 Alexandr Vityazev <avityazev@posteo.org>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -46,7 +48,8 @@
#:use-module (gnu packages readline)
#:use-module (gnu packages ruby)
#:use-module (gnu packages shells)
- #:use-module (gnu packages tmux))
+ #:use-module (gnu packages tmux)
+ #:use-module (ice-9 regex))
(define-public boxes
(package
@@ -138,6 +141,57 @@ text.")
as you type.")
(license license:expat)))
+(define-public zsh-syntax-highlighting
+ (package
+ (name "zsh-syntax-highlighting")
+ (version "0.7.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/zsh-users/zsh-syntax-highlighting")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "039g3n59drk818ylcyvkciv8k9mf739cv6v4vis1h9fv9whbcmwl"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("zsh" ,zsh)))
+ (arguments
+ ;; FIXME: Tests fail when running test regexp
+ ;; there is no pcre module in the Guix zsh package
+ `(#:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'patch-paths
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "Makefile"
+ (("/usr/local") out)
+ ((,(regexp-quote "share/$(NAME)")) "share/zsh/plugins/$(NAME)")))))
+ (add-after 'patch-paths 'make-writable
+ (lambda _
+ (for-each make-file-writable
+ '("docs/highlighters.md"
+ "README.md"))))
+ (add-before 'build 'add-all-md
+ (lambda _
+ (invoke "make" "all")))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "make" "test")
+ (invoke "make" "perf")))))))
+ (home-page "https://github.com/zsh-users/zsh-syntax-highlighting")
+ (synopsis "Fish shell-like syntax highlighting for Zsh")
+ (description
+ "This package provides syntax highlighting for Zsh. It enables
+highlighting of commands whilst they are typed at a Zsh prompt into an
+interactive terminal. This helps in reviewing commands before running them,
+particularly in catching syntax errors.")
+ (license license:bsd-3)))
+
(define-public sh-z
(package
(name "sh-z")
--
2.33.0
--
Alexandr Vityazev
next prev parent reply other threads:[~2021-10-02 18:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-20 23:03 [bug#50709] [PATCH] gnu: Add zsh-syntax-highlighting Alexandr Vityazev
2021-09-20 23:25 ` [bug#50709] [PATCH] gnu: shellutils: Add copyright Alexandr Vityazev
2021-09-26 10:12 ` [bug#50709] [PATCH] gnu: Add zsh-syntax-highlighting Xinglu Chen
2021-09-27 14:09 ` Alexandr Vityazev
2021-10-02 15:18 ` Ludovic Courtès
2021-10-02 18:54 ` Alexandr Vityazev
2021-10-02 18:52 ` Alexandr Vityazev [this message]
2021-10-13 8:40 ` bug#50709: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735pj5kfj.fsf@posteo.org \
--to=avityazev@posteo.org \
--cc=50709@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).