From patchwork Mon Sep 20 23:03:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandr Vityazev X-Patchwork-Id: 33222 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 CC3F927BBE3; Tue, 21 Sep 2021 00:11:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8493127BBE1 for ; Tue, 21 Sep 2021 00:11:32 +0100 (BST) Received: from localhost ([::1]:41502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSSRf-0006jU-FN for patchwork@mira.cbaines.net; Mon, 20 Sep 2021 19:11:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSSKQ-0008Q2-Qo for guix-patches@gnu.org; Mon, 20 Sep 2021 19:04:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSSKQ-0005vS-Jh for guix-patches@gnu.org; Mon, 20 Sep 2021 19:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSSKQ-0001wS-Dn for guix-patches@gnu.org; Mon, 20 Sep 2021 19:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50709] [PATCH] gnu: Add zsh-syntax-highlighting. Resent-From: Alexandr Vityazev Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 Sep 2021 23:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50709 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50709@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16321790057396 (code B ref -1); Mon, 20 Sep 2021 23:04:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Sep 2021 23:03:25 +0000 Received: from localhost ([127.0.0.1]:44260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSSJp-0001vE-Ck for submit@debbugs.gnu.org; Mon, 20 Sep 2021 19:03:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:50152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSSJo-0001v7-BR for submit@debbugs.gnu.org; Mon, 20 Sep 2021 19:03:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSSJm-0007ng-OX for guix-patches@gnu.org; Mon, 20 Sep 2021 19:03:24 -0400 Received: from mout02.posteo.de ([185.67.36.66]:40785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSSJk-0005MX-8U for guix-patches@gnu.org; Mon, 20 Sep 2021 19:03:22 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B6885240101 for ; Tue, 21 Sep 2021 01:03:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.org; s=2017; t=1632178995; bh=AD2g80CuwahhhTiHPc2Z0t0EjLNTj3TZ5/RGLbtXwC0=; h=From:To:Subject:Date:From; b=JGd3+AyW0RMb8dMo8ZGtNwEHAsBn0SqiZyR2U3lPVTnXMivpzvsh+JbPeckhYOtY6 LCEwG7szIGjx5XcLpw+N6xv8mrtw/+JeS4plGjOIzHAix7pp5k7ToaaunAOOS0iLp3 7AM6N74BOQbBoeKu7hI868BNhl5HOUzN38YcZPnlMKvL7053BAzqKladg4B3/h0Y3X 9RnnZGaeZbK8CQxAZWmdaLLhLRQahG0vKR2AK6bFuDS8TY4/vewXyny8etzO9h3/Ss 8uLxp2v6VfyWdZ+OI/pVY4035x1ZtdFkguxIhkaldWZ/s5UQIWsBb4z9PjQBDY/pPK hclh8pY+aM/gA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HD0TZ5zJYz9rxG for ; Tue, 21 Sep 2021 01:03:14 +0200 (CEST) From: Alexandr Vityazev Date: Mon, 20 Sep 2021 23:03:29 +0000 Message-ID: <87sfxy4zpa.fsf@posteo.org> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.66; envelope-from=avityazev@posteo.org; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/shellutils.scm (zsh-syntax-highlighting): New variable. --- gnu/packages/shellutils.scm | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index 94b5536df7..69e1d0d069 100644 --- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm @@ -138,6 +138,61 @@ 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-before 'build 'add-all-md + (lambda _ + (copy-file "docs/highlighters.md" "docs/all.md") + (make-file-writable "docs/all.md") + #t)) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "make" "test") + (invoke "make" "perf")) + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (zsh-plugins + (string-append out "/share/zsh/plugins/zsh-syntax-highlighting")) + (highlighters-dir (string-append zsh-plugins "/highlighters"))) + (invoke "make" "all") + (install-file "zsh-syntax-highlighting.zsh" zsh-plugins) + (install-file ".version" zsh-plugins) + (install-file ".revision-hash" zsh-plugins) + (copy-recursively "highlighters" highlighters-dir) + #t)))))) + (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 the shell 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:expat))) + (define-public sh-z (package (name "sh-z")