[PATCH] gnu: lesspipe: Update to 2.02.

DoneSubmitted by Hartmut Goebel.
Details
5 participants
  • Brice Waegeneire
  • Hartmut Goebel
  • Ludovic Courtès
  • Nicolas Goaziou
  • Maxime Devos
Owner
unassigned
Severity
normal
H
H
Hartmut Goebel wrote on 10 Feb 17:52 +0100
(address . guix-patches@gnu.org)
639f99264ee673157112aec54d28c80842e4be52.1644511905.git.h.goebel@crazy-compilers.com
* gnu/packages/less.scm (lesspipe): Update to 2.02.
---
gnu/packages/less.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/less.scm b/gnu/packages/less.scm
index e23b5d0c24..3322321ac6 100644
--- a/gnu/packages/less.scm
+++ b/gnu/packages/less.scm
@@ -59,7 +59,7 @@ text editors.")
 (define-public lesspipe
   (package
     (name "lesspipe")
-    (version "1.91")
+    (version "2.02")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -68,7 +68,7 @@ text editors.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "04dqvq6j4h451xqbvxzv6pv679hzzfm39pdm5vg7h3r45gzg0kps"))))
+                "15lcgawwqlpwa3kra44nnyx0jmidjqdq45xcr5q90kz8iqix3ll7"))))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f                      ; no tests
-- 
2.30.2
B
B
Brice Waegeneire wrote on 12 Feb 10:48 +0100
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)(address . 53920@debbugs.gnu.org)
87r188wh3o.fsf@waegenei.re
Hello Hartmut,

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

Toggle quote (5 lines)
> * gnu/packages/less.scm (lesspipe): Update to 2.02.
> ---
> gnu/packages/less.scm | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

[...]

Thank you for the patch, I wasn't able to build it tho. Because the previsou git
tag was named "1.91" and the latest one is "v2.02", so the commit field from
git-reference need to be adjusted. Did you managed to build and test it on your
side before sending the patch?

Cheers,
- Brice
L
L
Ludovic Courtès wrote on 16 Feb 16:01 +0100
control message for bug #53920
(address . control@debbugs.gnu.org)
87czjmx3ca.fsf@gnu.org
tags 53920 + moreinfo
quit
H
H
Hartmut Goebel wrote on 20 Feb 17:54 +0100
Re: bug#53920: [PATCH] gnu: lesspipe: Update to 2.02.
(name . Brice Waegeneire)(address . brice@waegenei.re)(address . 53920@debbugs.gnu.org)
e7646bd1-3214-1606-a5c3-99c9babf1b15@crazy-compilers.com
Am 12.02.22 um 10:48 schrieb Brice Waegeneire:
Toggle quote (3 lines)
> Did you managed to build and test it on your
> side before sending the patch?

I though I did, but apparently I dd not. When looking at it, I saw that
quite some stuff changed under the hood, too. I’ll send a new patch
these days.

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
H
H
Hartmut Goebel wrote on 22 Feb 10:16 +0100
[PATCH v2] gnu: lesspipe: Update to 2.02.
(address . 53920@debbugs.gnu.org)
0055cb8be0309c568de5743dbd4addcb5f583f84.1645521332.git.h.goebel@crazy-compilers.com
* gnu/packages/less.scm (lesspipe): Update to 2.02.
[arguments]<phases>{configure} Adjust to updated source.
{fix-makefile}: New phase.
{patch-tput-and-file}: rename into …
{patch-command-paths}: this; patch other relevant scripts.
---
gnu/packages/less.scm | 58 +++++++++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 21 deletions(-)

Toggle diff (89 lines)
diff --git a/gnu/packages/less.scm b/gnu/packages/less.scm
index e23b5d0c24..a9775ecdf0 100644
--- a/gnu/packages/less.scm
+++ b/gnu/packages/less.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -59,38 +60,53 @@ text editors.")
 (define-public lesspipe
   (package
     (name "lesspipe")
-    (version "1.91")
+    (version "2.02")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/wofr06/lesspipe")
-                    (commit version)))
+                    (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "04dqvq6j4h451xqbvxzv6pv679hzzfm39pdm5vg7h3r45gzg0kps"))))
+                "15lcgawwqlpwa3kra44nnyx0jmidjqdq45xcr5q90kz8iqix3ll7"))))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f                      ; no tests
-       #:phases (modify-phases %standard-phases
-                  (replace 'configure
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let ((out (assoc-ref outputs "out")))
-                        (delete-file "Makefile") ; force generating
-                        (invoke "./configure"
-                                (string-append "--prefix=" out)
-                                "--yes"))))
-                  (add-before 'install 'patch-tput-and-file
-                    (lambda* (#:key inputs #:allow-other-keys)
-                      (substitute* "lesspipe.sh"
-                        (("tput colors")
-                         (string-append (search-input-file inputs "/bin/tput")
-                                        " colors"))
-                        (("file -")
-                         (string-append (search-input-file inputs "/bin/file")
-                                        " -"))))))))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; configure is a perl script which the standard configure phase
+             ;; fails to execute
+             (invoke "./configure"
+                     (string-append "--prefix=" (assoc-ref outputs "out")))))
+         (add-before 'install 'fix-makefile
+           (lambda _
+               (substitute* "Makefile"
+                 (("\\$\\(DESTDIR\\)/etc") "$(DESTDIR)$(PREFIX)/etc"))))
+         (add-before 'install 'patch-command-paths
+           ;; Depending on the content of the file to be displayed and some
+           ;; settings, lesspipe trees to use a large variety of external
+           ;; commands, e.g. rpm, dpkg, vimcolor.  We only link the essential
+           ;; ones to avoid this package to pull in all these dependencies
+           ;; which might never ever we used.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((file (search-input-file inputs "/bin/file"))
+                   (tput (search-input-file inputs "/bin/tput")))
+               (substitute* "sxw2txt"
+                 (("^use warnings;" line)
+                  (string-append line "use lib '" file "';")))
+               (substitute* "lesscomplete"
+                 (("file -") (string-append file " -")))
+               (substitute* "lesspipe.sh"
+                 (("tput colors")
+                  (string-append tput " colors"))
+                 (("file -")
+                  (string-append file " -")))))))))
     (inputs
-     (list file ncurses))  ; for tput
+     (list file
+           ncurses))  ; for tput
     (native-inputs (list perl))
     (home-page "https://github.com/wofr06/lesspipe")
     (synopsis "Input filter for less")
-- 
2.30.2
H
H
Hartmut Goebel wrote on 22 Feb 19:39 +0100
[PATCH v3] gnu: lesspipe: Update to 2.03.
(address . 53920@debbugs.gnu.org)
ad08e104569e8759a2dacc429b4021f2dd2d6250.1645555065.git.h.goebel@crazy-compilers.com
* gnu/packages/less.scm (lesspipe): Update to 2.03.
[arguments] Use new style. <phases>{configure} Adjust to updated source.
{fix-makefile} New phase.
{patch-tput-and-file} rename into …
{patch-command-paths} this; patch other relevant scripts.
[inputs] Add perl-archive-zip.
---
gnu/packages/less.scm | 66 ++++++++++++++++++++++++++++---------------
1 file changed, 44 insertions(+), 22 deletions(-)

Toggle diff (107 lines)
diff --git a/gnu/packages/less.scm b/gnu/packages/less.scm
index e23b5d0c24..ede6238d25 100644
--- a/gnu/packages/less.scm
+++ b/gnu/packages/less.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,10 +21,12 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages less)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (gnu packages)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages perl-compression)
   #:use-module (gnu packages file)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -59,38 +62,57 @@ text editors.")
 (define-public lesspipe
   (package
     (name "lesspipe")
-    (version "1.91")
+    (version "2.03")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/wofr06/lesspipe")
-                    (commit version)))
+                    (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "04dqvq6j4h451xqbvxzv6pv679hzzfm39pdm5vg7h3r45gzg0kps"))))
+                "0hvqs7c2scjzyanylp7f2r1kpdp9v5qvgarhwvaisx9q1d0hiqy9"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f                      ; no tests
-       #:phases (modify-phases %standard-phases
-                  (replace 'configure
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let ((out (assoc-ref outputs "out")))
-                        (delete-file "Makefile") ; force generating
-                        (invoke "./configure"
-                                (string-append "--prefix=" out)
-                                "--yes"))))
-                  (add-before 'install 'patch-tput-and-file
-                    (lambda* (#:key inputs #:allow-other-keys)
-                      (substitute* "lesspipe.sh"
-                        (("tput colors")
-                         (string-append (search-input-file inputs "/bin/tput")
-                                        " colors"))
-                        (("file -")
-                         (string-append (search-input-file inputs "/bin/file")
-                                        " -"))))))))
+     (list
+      #:tests? #f                      ; no tests
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'configure
+            (lambda* (#:key outputs #:allow-other-keys)
+              ;; configure is a perl script which the standard configure phase
+              ;; fails to execute
+              (invoke "./configure"
+                      (string-append "--prefix=" (assoc-ref outputs "out")))))
+          (add-before 'install 'fix-makefile
+            (lambda _
+              (substitute* "Makefile"
+                (("\\$\\(DESTDIR\\)/etc") "$(DESTDIR)$(PREFIX)/etc"))))
+          (add-before 'install 'patch-command-paths
+            ;; Depending on the content of the file to be displayed and some
+            ;; settings, lesspipe trees to use a large variety of external
+            ;; commands, e.g. rpm, dpkg, vimcolor.  We only link the
+            ;; essential ones to avoid this package to pull in all these
+            ;; dependencies which might never ever we used.
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((file (search-input-file inputs "/bin/file"))
+                    (tput (search-input-file inputs "/bin/tput")))
+                (substitute* "sxw2txt"
+                  (("^use warnings;" line)
+                   (string-append
+                    line "\nuse lib '" #$perl-archive-zip
+                    "/lib/perl5/site_perl';")))
+                (substitute* "lesscomplete"
+                  (("file -") (string-append file " -")))
+                (substitute* "lesspipe.sh"
+                  (("tput colors")
+                   (string-append tput " colors"))
+                  (("file -")
+                   (string-append file " -")))))))))
     (inputs
-     (list file ncurses))  ; for tput
+     (list file
+           ncurses  ;; for tput
+           perl-archive-zip))
     (native-inputs (list perl))
     (home-page "https://github.com/wofr06/lesspipe")
     (synopsis "Input filter for less")
-- 
2.30.2
H
H
Hartmut Goebel wrote on 22 Feb 19:42 +0100
Re: bug#53920: [PATCH] gnu: lesspipe: Update to 2.02.
(name . Brice Waegeneire)(address . brice@waegenei.re)(address . 53920@debbugs.gnu.org)
0412739c-a61f-ba09-3fab-7ef90fe3b2a3@crazy-compilers.com
Hi Brice,

I'd appreciate your review on version 3 of the patch.


--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
L
L
Ludovic Courtès wrote on 27 Feb 23:06 +0100
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)(address . 53920@debbugs.gnu.org)
877d9gt15q.fsf_-_@gnu.org
Hi Hartmut,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

Toggle quote (7 lines)
> * gnu/packages/less.scm (lesspipe): Update to 2.03.
> [arguments] Use new style. <phases>{configure} Adjust to updated source.
> {fix-makefile} New phase.
> {patch-tput-and-file} rename into …
> {patch-command-paths} this; patch other relevant scripts.
> [inputs] Add perl-archive-zip.

I haven’t tested it but it looks good to me on the surface. If it works
for you, please go ahead!

Thanks,
Ludo’.
M
M
Maxime Devos wrote on 27 Feb 23:22 +0100
Re: [bug#53920] [PATCH v3] gnu: lesspipe: Update to 2.03.
c496100d9241ca08df01a8eea86bdb45b70150c8.camel@telenet.be
Hartmut Goebel schreef op di 22-02-2022 om 19:39 [+0100]:
Toggle quote (6 lines)
> +                (substitute* "sxw2txt"
> +                  (("^use warnings;" line)
> +                   (string-append
> +                    line "\nuse lib '" #$perl-archive-zip
> +                    "/lib/perl5/site_perl';")))

To make package transformations work, can #$perl-archive-zip be avoided
here? Maybe:

(substitute* [...]
([...]
(string-append [...] (assoc-ref inputs "perl-archive-zip") [...])))

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYhv5oxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7m7/AP4ieF0B5xrtyTAl+VaYcSl0uGkt
GUIAbSeOOV+jl+X5dAD/a1M3Ex5MEttJDkq2I1Dh/FI+joxV0v+HSE1IKXEaIQw=
=eZDo
-----END PGP SIGNATURE-----


H
H
Hartmut Goebel wrote on 28 Feb 09:25 +0100
1518f31f-947a-63a2-3f52-3bbe167196b3@crazy-compilers.com
Am 27.02.22 um 23:22 schrieb Maxime Devos:
Toggle quote (7 lines)
> To make package transformations work, can #$perl-archive-zip be avoided
> here? Maybe:
>
> (substitute* [...]
> ([...]
> (string-append [...] (assoc-ref inputs "perl-archive-zip") [...])))

FMPOV I can easily change this.

Anyhow, I don't understand, why this is necessary for package
transformations. I thought g-exps are the way to do it?

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
N
N
Nicolas Goaziou wrote on 28 Feb 10:56 +0100
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)
87ilszgvpy.fsf@nicolasgoaziou.fr
Hello,

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

Toggle quote (13 lines)
> Am 27.02.22 um 23:22 schrieb Maxime Devos:
>> To make package transformations work, can #$perl-archive-zip be avoided
>> here? Maybe:
>>
>> (substitute* [...]
>> ([...]
>> (string-append [...] (assoc-ref inputs "perl-archive-zip") [...])))
>
> FMPOV I can easily change this.
>
> Anyhow, I don't understand, why this is necessary for package
> transformations. I thought g-exps are the way to do it?

Actually, I think it should be the higher-level sexp:

#$(this-package-input "perl-archive-zip")

instead of

(assoc-ref inputs ...)

To answer your question, this is explained in
and self-referential records".

Another nitpick: end-of-line comments only need a single semicolon, not
two.

Regards,
--
Nicolas Goaziou
H
H
Hartmut Goebel wrote on 28 Feb 13:31 +0100
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
a2eb27fa-3e37-b4ea-b13d-a28ab2324774@crazy-compilers.com
Am 28.02.22 um 10:56 schrieb Nicolas Goaziou:
Toggle quote (4 lines)
> Actually, I think it should be the higher-level sexp:
>
> #$(this-package-input "perl-archive-zip")

How can one know, this one to use?

The blog post is more like a historical story, not a tutorial for
converting. It uses both

|#~`("--disable-color" ,(string-append "--with-gawk=" #$gawk)))) |

|and|

|#~(list (string-append "--with-gawk=" #$(this-package-input "gawk"))))) |

|The manual seems to mostly use the former way.|

||||

--
Regards
Hartmut Goebel

| Hartmut Goebel |h.goebel@crazy-compilers.com |
|www.crazy-compilers.com | compilers which you thought are impossible |
Attachment: file
N
N
Nicolas Goaziou wrote on 28 Feb 13:50 +0100
(name . Hartmut Goebel)(address . h.goebel@crazy-compilers.com)
875yozgnoc.fsf@nicolasgoaziou.fr
Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

Toggle quote (10 lines)
> Am 28.02.22 um 10:56 schrieb Nicolas Goaziou:
>> Actually, I think it should be the higher-level sexp:
>>
>> #$(this-package-input "perl-archive-zip")
>
> How can one know, this one to use?
>
> The blog post is more like a historical story, not a tutorial for
> converting.

Actually, it is. It a tutorial for converting to the new syntax, with
historical background so you know why you're doing it.

Toggle quote (8 lines)
> It uses both
>
> |#~`("--disable-color" ,(string-append "--with-gawk=" #$gawk)))) |
>
> |and|
>
> |#~(list (string-append "--with-gawk=" #$(this-package-input "gawk"))))) |

Yes, it does. The former is an example of what was done before the
change, and the latter is demonstrating what we should now use.

Toggle quote (2 lines)
> |The manual seems to mostly use the former way.|

Then this should be fixed.

Regards,
H
H
Hartmut Goebel wrote on 2 Mar 21:52 +0100
(address . 53920-close@debbugs.gnu.org)
9767c201-7c8c-22fd-81e5-b85be565f190@crazy-compilers.com
Thanks for the review.

Changed to use #$(this-package-input, updated to 2.04 (which was
released meanwhile) and pushed as d8e353c11bf1999255a2471b553ce754800b074a

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
?
Your comment

This issue is archived.

To comment on this conversation send email to 53920@debbugs.gnu.org