unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 53920@debbugs.gnu.org
Subject: [bug#53920] [PATCH v3] gnu: lesspipe: Update to 2.03.
Date: Tue, 22 Feb 2022 19:39:05 +0100	[thread overview]
Message-ID: <ad08e104569e8759a2dacc429b4021f2dd2d6250.1645555065.git.h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <639f99264ee673157112aec54d28c80842e4be52.1644511905.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(-)

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





  parent reply	other threads:[~2022-02-22 18:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 16:52 [bug#53920] [PATCH] gnu: lesspipe: Update to 2.02 Hartmut Goebel
2022-02-12  9:48 ` Brice Waegeneire
2022-02-20 16:54   ` Hartmut Goebel
2022-02-22 18:42   ` Hartmut Goebel
2022-02-22  9:16 ` [bug#53920] [PATCH v2] " Hartmut Goebel
2022-02-22 18:39 ` Hartmut Goebel [this message]
2022-02-27 22:06   ` [bug#53920] [PATCH] " Ludovic Courtès
2022-02-27 22:22   ` [bug#53920] [PATCH v3] gnu: lesspipe: Update to 2.03 Maxime Devos
2022-02-28  8:25     ` Hartmut Goebel
2022-02-28  9:56       ` Nicolas Goaziou
2022-02-28 12:31         ` Hartmut Goebel
2022-02-28 12:50           ` Nicolas Goaziou
2022-03-02 20:52             ` bug#53920: " Hartmut Goebel

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=ad08e104569e8759a2dacc429b4021f2dd2d6250.1645555065.git.h.goebel@crazy-compilers.com \
    --to=h.goebel@crazy-compilers.com \
    --cc=53920@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).