diff mbox series

[bug#54085,3/3] gnu: Add jless.

Message ID 7PPWo-rQGVQzTQfVhdIcwIR776XuP7D08guFk3dNHD5ovuGtYlTAUq34VTSOoAbHco8f4F42Acta5vt_skiSPsoh-uBd2lzAS1TWSdK9z9U=@protonmail.com
State New
Headers show
Series None | expand

Commit Message

phodina Feb. 21, 2022, 9:48 a.m. UTC
Hi,

These patches add JSON viewer in Rust.

----
Petr

Comments

M Feb. 21, 2022, 1:24 p.m. UTC | #1
phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
> +    (synopsis "Macros for deriving common traits for fast Lexers")
> +    (description "This package provides macros for deriving common
> traits for
> +fast Lexers.")

What's the difference between a regular lexer and an uppercase Lexer?
Also, does this package only derive traits for lexers, or also the
lexers theirselves?

Greetings,
Maxime.
M Feb. 21, 2022, 1:25 p.m. UTC | #2
phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
> +     `(#:skip-build? #t

Why skip the builld?
M Feb. 21, 2022, 1:27 p.m. UTC | #3
phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
> +    (description "This package provides macros for deriving common
> traits for
> +fast Lexers.")

The README has some information that could be added to make the
description more descriptive.  Also, why is the name rust-logos-derive
and not rust-logos?

Greetings,
Maxime
Maxim Cournoyer Sept. 28, 2022, 7:29 p.m. UTC | #4
Hi Petr,

Maxime Devos <maximedevos@telenet.be> writes:

> phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
>> +    (description "This package provides macros for deriving common
>> traits for
>> +fast Lexers.")
>
> The README has some information that could be added to make the
> description more descriptive.  Also, why is the name rust-logos-derive
> and not rust-logos?

Could you please follow up to Maxime's comments? :-) With a simple v2 we
should be able to get this merged.

Thanks!

Maxim
M Sept. 28, 2022, 8:17 p.m. UTC | #5
On 28-09-2022 21:29, Maxim Cournoyer wrote:
>> phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
>>> +    (description "This package provides macros for deriving common
>>> traits for
>>> +fast Lexers.")
>> The README has some information that could be added to make the
>> description more descriptive.  Also, why is the name rust-logos-derive
>> and not rust-logos?

Nevermind the naming bit, that's just the convention in Rust on 
separating macros from other things.

Greetings,
Maxime.
diff mbox series

Patch

From 0cd53505fbfd6e69a0ec227e92df3c9b35a0b310 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 16 Feb 2022 02:34:10 +0100
Subject: [PATCH 3/3] gnu: Add jless.

* gnu/packages/rust-apps.scm (jless): New variable.

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index bb59f6b448..f77f9513f6 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -12,7 +12,7 @@ 
 ;;; Copyright © 2021, 2022 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2021, 2022 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
 ;;; Copyright © 2021 Nicolas Graves <ngraves@ngraves.fr>
 ;;; Copyright © 2022 Aleksandr Vityazev <avityazev@posteo.org>
@@ -706,6 +706,50 @@  (define-public i3status-rust
 bar.  It is also compatible with sway.")
     (license license:gpl3)))
 
+(define-public jless
+  (package
+    (name "jless")
+    (version "0.7.1")
+    (source (origin
+              (method url-fetch)
+              (uri (crate-uri "jless" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0sz93gvingvxj68sxfbl8a0p8rmx46bdnw0a2hbm0fh38jx3xdzr"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-atty" ,rust-atty-0.2)
+                       ("rust-lazy-static" ,rust-lazy-static-1)
+                       ("rust-libc" ,rust-libc-0.2)
+                       ("rust-logos" ,rust-logos-0.12)
+                       ("rust-regex" ,rust-regex-1)
+                       ("rust-rustyline" ,rust-rustyline-9)
+                       ("rust-signal-hook" ,rust-signal-hook-0.3)
+                       ("rust-structopt" ,rust-structopt-0.3)
+                       ("rust-termion" ,rust-termion-1)
+                       ("rust-unicode-segmentation" ,rust-unicode-segmentation-1)
+                       ("rust-unicode-width" ,rust-unicode-width-0.1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-version-requirements
+           (lambda _
+             ;; isatty crate is deprecated use atty instead
+             (substitute* "src/main.rs"
+               (("isatty::stdout_isatty\\(") "atty::is(atty::Stream::Stdout")
+               (("isatty::stdin_isatty\\(") "atty::is(atty::Stream::Stdin"))
+             ;; fix requirement versions
+             (substitute* "Cargo.toml"
+               (("isatty") "atty")
+               (("1.5.6") ,(package-version rust-termion-1))
+               (("\"0.1\"") (string-append "\""
+                                           ,(package-version rust-atty-0.2)
+                                           "\""))) #t)))))
+    (home-page "https://github.com/PaulJuliusMartinez/jless")
+    (synopsis "Command-line JSON viewer")
+    (description "This package provides a command-line JSON viewer.")
+    (license license:expat)))
+
 (define-public ripgrep
   (package
     (name "ripgrep")
-- 
2.34.0