[PATCH 3/3] gnu: Add jless.

  • Open
  • quality assurance status badge
Details
3 participants
  • Maxim Cournoyer
  • Maxime Devos
  • phodina
Owner
unassigned
Submitted by
phodina
Severity
normal

Debbugs page

P
P
phodina wrote on 21 Feb 2022 01:48
(name . Guix Patches)(address . guix-patches@gnu.org)
7PPWo-rQGVQzTQfVhdIcwIR776XuP7D08guFk3dNHD5ovuGtYlTAUq34VTSOoAbHco8f4F42Acta5vt_skiSPsoh-uBd2lzAS1TWSdK9z9U=@protonmail.com
Hi,

These patches add JSON viewer in Rust.

----
Petr
Attachment: file
From 2c94882dc4eb680bc26b51b7b4d0eca393e4a55c Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 16 Feb 2022 02:01:04 +0100
Subject: [PATCH 1/3] gnu: Add rust-logos-derive-0.12.

* gnu/packages/crates-io.scm (rust-logos-derive-0.12): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 2e176eeb54..ae46f59198 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -32394,6 +32394,33 @@ (define-public rust-log4rs-1
logging implementation for the `log` facade.")
(license (list license:expat license:asl2.0))))
+(define-public rust-logos-derive-0.12
+ (package
+ (name "rust-logos-derive")
+ (version "0.12.0")
+ (source (origin
+ (method url-fetch)
+ (uri (crate-uri "logos-derive" version))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0vf38d1pvy3w7qdpl7yr9ds5azaahy51r6pi25dzghrazn3x59sn"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:skip-build? #t
+ #:cargo-inputs
+ (("rust-beef" ,rust-beef-0.5) ("rust-fnv" ,rust-fnv-1)
+ ("rust-proc-macro2" ,rust-proc-macro2-1)
+ ("rust-quote" ,rust-quote-1)
+ ("rust-regex-syntax" ,rust-regex-syntax-0.6)
+ ("rust-syn" ,rust-syn-1)
+ ("rust-utf8-ranges" ,rust-utf8-ranges-1))))
+ (home-page "https://github.com/maciejhirsz/logos")
+ (synopsis "Macros for deriving common traits for fast Lexers")
+ (description "This package provides macros for deriving common traits for
+fast Lexers.")
+ (license (list license:expat license:asl2.0))))
+
(define-public rust-logtest-2
(package
(name "rust-logtest")
--
2.34.0
From b15f96c2f1005acbe45ec59675f1b58861cae1b1 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 16 Feb 2022 02:02:29 +0100
Subject: [PATCH 2/3] gnu: Add rust-logos-0.12.

* gnu/packages/crates-io.scm (rust-logos-0.12): New variable.

Toggle diff (35 lines)
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index ae46f59198..d825076a19 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -32394,6 +32394,28 @@ (define-public rust-log4rs-1
logging implementation for the `log` facade.")
(license (list license:expat license:asl2.0))))
+(define-public rust-logos-0.12
+ (package
+ (name "rust-logos")
+ (version "0.12.0")
+ (source (origin
+ (method url-fetch)
+ (uri (crate-uri "logos" version))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0idklzd8afh87c82n3yp3l0djjmkwrsginxgm5ni64xylny2lzj2"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:skip-build? #t
+ #:cargo-inputs
+ (("rust-logos-derive" ,rust-logos-derive-0.12))))
+ (home-page "https://github.com/maciejhirsz/logos")
+ (synopsis "Generate fast Lexers")
+ (description "This package provides easy way to generate fast
+Lexers.")
+ (license (list license:expat license:asl2.0))))
+
(define-public rust-logos-derive-0.12
(package
(name "rust-logos-derive")
--
2.34.0
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.

Toggle diff (66 lines)
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
M
M
Maxime Devos wrote on 21 Feb 2022 05:24
55bdc663882446c0447c0b91e8de4635f2b4a538.camel@telenet.be
phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
Toggle quote (5 lines)
> +    (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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYhOSoRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mjxAQCYj2j+NJfeDIRFFy7iJwZpnhAf
QaY+L5Q4/1WyaejbLQD8DqDYkfkw/n64kPUplbb63v6JfdKZMimQQUSP1vw4mgE=
=Ukpy
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 21 Feb 2022 05:25
a6b097578d3f3fe6c43fa5030263c981e2fdfa3a.camel@telenet.be
phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
Toggle quote (2 lines)
> +     `(#:skip-build? #t

Why skip the builld?
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYhOSzhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jHcAP90hQhBJtRazu8//I1wSXixUkgn
CuCI1ndf0eJtFfi5LAD/bxnSfiDvF0Zu6Layjc1Kh8Pmps05BiRH+g1UsWacvAY=
=i3vK
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 21 Feb 2022 05:27
7bfd2382d78f208b7e3db76514346a9db22703f0.camel@telenet.be
phodina via Guix-patches via schreef op ma 21-02-2022 om 09:48 [+0000]:
Toggle quote (4 lines)
> +    (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
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYhOTLxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7oDeAP0Rqa/1zlj6uDwv6h+SFRDM90qW
/2LwkC9jy11HP+8T9QEAvcmIGZKyjrqS7KCm+qzR94uxfHzvqJbZA1xcjDXTRw0=
=2Nmh
-----END PGP SIGNATURE-----


M
M
Maxim Cournoyer wrote on 28 Sep 2022 12:29
Re: bug#54085: [PATCH 3/3] gnu: Add jless.
(name . phodina)(address . phodina@protonmail.com)
875yh7ti0a.fsf_-_@gmail.com
Hi Petr,

Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (9 lines)
> 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
M
Maxim Cournoyer wrote on 28 Sep 2022 12:29
control message for bug #54085
(address . control@debbugs.gnu.org)
874jwrti04.fsf@gmail.com
tags 54085 + moreinfo
quit
M
M
Maxime Devos wrote on 28 Sep 2022 13:17
Re: bug#54085: [PATCH 3/3] gnu: Add jless.
(address . 54085@debbugs.gnu.org)
827c57dd-7d1d-1fb7-7479-4e9804908fdf@telenet.be
On 28-09-2022 21:29, Maxim Cournoyer wrote:
Toggle quote (7 lines)
>> 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.
Attachment: OpenPGP_signature
P
P
phodina wrote on 21 Nov 2022 08:14
(name . Maxime Devos)(address . maximedevos@telenet.be)
U7rt2lb4CKr5h0RCxC0rVmWuLfmRrz5MZWq6kDYtmjmchz62tnupbhd1NfXT6oZnG4NTxRxv5LiNNiP2DIIyyiTlg4pnBplChRgTBse4nH0=@protonmail.com
Hi Maxim and Maxime,

Here are the patches. Should have the issues you mentioned fixed.

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

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

Toggle diff (57 lines)
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 693489264d..379e49bcc1 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -709,6 +709,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.38.1
From 82925c0d7d30ac0fe780d99877f2589b5e8cd88e Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 16 Feb 2022 02:02:29 +0100
Subject: [PATCH v2 2/3] gnu: Add rust-logos-0.12.

* gnu/packages/crates-io.scm (rust-logos-0.12): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 1cbe7d4798..8bc1031e22 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -30738,6 +30738,33 @@ (define-public rust-log-0.3
`(#:cargo-inputs
(("rust-log" ,rust-log-0.4))))))
+(define-public rust-logos-0.12
+ (package
+ (name "rust-logos")
+ (version "0.12.0")
+ (source (origin
+ (method url-fetch)
+ (uri (crate-uri "logos" version))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0idklzd8afh87c82n3yp3l0djjmkwrsginxgm5ni64xylny2lzj2"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:cargo-inputs
+ (("rust-logos-derive" ,rust-logos-derive-0.12))))
+ (home-page "https://github.com/maciejhirsz/logos")
+ (synopsis "Generate fast Lexers")
+ (description "This package provides easy way to generate fast Lexers:
+@itemize
+@item Combines all token definitions into a single deterministic state machine
+@item Optimizes branches into lookup tables or jump tables
+@item Prevents backtracking inside token definitions
+@item Unwinds loops, and batches reads to minimize bounds checking
+@item Does all of that heavy lifting at compile time
+@end itemize")
+ (license (list license:expat license:asl2.0))))
+
(define-public rust-logos-derive-0.12
(package
(name "rust-logos-derive")
--
2.38.1
From 3e751d77b56a8b8b4a964125dab383a56313b528 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 16 Feb 2022 02:01:04 +0100
Subject: [PATCH v2 1/3] gnu: Add rust-logos-derive-0.12.

* gnu/packages/crates-io.scm (rust-logos-derive-0.12): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 792779a28f..1cbe7d4798 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -30738,6 +30738,33 @@ (define-public rust-log-0.3
`(#:cargo-inputs
(("rust-log" ,rust-log-0.4))))))
+(define-public rust-logos-derive-0.12
+ (package
+ (name "rust-logos-derive")
+ (version "0.12.0")
+ (source (origin
+ (method url-fetch)
+ (uri (crate-uri "logos-derive" version))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0vf38d1pvy3w7qdpl7yr9ds5azaahy51r6pi25dzghrazn3x59sn"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:skip-build? #t
+ #:cargo-inputs
+ (("rust-beef" ,rust-beef-0.5) ("rust-fnv" ,rust-fnv-1)
+ ("rust-proc-macro2" ,rust-proc-macro2-1)
+ ("rust-quote" ,rust-quote-1)
+ ("rust-regex-syntax" ,rust-regex-syntax-0.6)
+ ("rust-syn" ,rust-syn-1)
+ ("rust-utf8-ranges" ,rust-utf8-ranges-1))))
+ (home-page "https://github.com/maciejhirsz/logos")
+ (synopsis "Macros for deriving common traits for fast Lexers")
+ (description "This package provides macros for deriving common traits for
+fast Lexers.")
+ (license (list license:expat license:asl2.0))))
+
(define-public rust-loom-0.5
(package
(name "rust-loom")
--
2.38.1
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 54085@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 54085
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch