Subject: [PATCH 05/17] gnu: Add perl-io-pager.

From: Christopher Baines <[email-masked]>
Date: Sun, 24 Mar 2019 20:46:20 +0000

* gnu/packages/perl.scm (perl-io-pager): New variable.
---
 gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index ddb7576e7d..094ef7269c 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages less)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages perl-compression)
   #:use-module (gnu packages perl-web)
@@ -4261,6 +4262,41 @@ easier to develop interactive applications: is_interactive(), interactive(),
 and busy().")
     (license (package-license perl))))
 
+(define-public perl-io-pager
+  (package
+    (name "perl-io-pager")
+    (version "0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://cpan/authors/id/J/JP/JPIERCE/IO-Pager-"
+             version
+             "0.tgz"))
+       (sha256
+        (base32
+         "1vzdypsr7vkj8nnda9ccrksci6pqj5awwmi89l7x3mbpq36gad87"))))
+    (build-system perl-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-less
+           (lambda _
+             (substitute* "lib/IO/Pager.pm"
+               (("/usr/local/bin/less', '/usr/bin/less")
+                (which "less")))
+             #t)))))
+    (propagated-inputs
+     `(("perl-file-which" ,perl-file-which)))
+    (inputs
+     `(("less" ,less)))
+    (home-page "https://metacpan.org/release/IO-Pager")
+    (synopsis "Select a pager and pipe text to it")
+    (description
+     "@code{IO::Pager} can be used to locate an available pager and use it to
+display output if a TTY is in use.")
+    (license (package-license perl))))
+
 (define-public perl-io-string
   (package
     (name "perl-io-string")
-- 
2.20.1