gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / less.scm
CommitLineData
233e7676
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
f76cb6b6 3;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
7baa8c78 4;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
0e680920 5;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
fe7777c1 6;;;
233e7676 7;;; This file is part of GNU Guix.
fe7777c1 8;;;
233e7676 9;;; GNU Guix is free software; you can redistribute it and/or modify it
fe7777c1
NK
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
233e7676 14;;; GNU Guix is distributed in the hope that it will be useful, but
fe7777c1
NK
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
233e7676 20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fe7777c1 21
1ffa7090 22(define-module (gnu packages less)
4a44e743 23 #:use-module (guix licenses)
7baa8c78 24 #:use-module (gnu packages)
1ffa7090 25 #:use-module (gnu packages ncurses)
0e680920
MR
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages file)
fe7777c1
NK
28 #:use-module (guix packages)
29 #:use-module (guix download)
0e680920 30 #:use-module (guix git-download)
fe7777c1
NK
31 #:use-module (guix build-system gnu))
32
33(define-public less
34 (package
35 (name "less")
f76cb6b6 36 (version "581")
fe7777c1
NK
37 (source
38 (origin
4e94744d
TGR
39 (method url-fetch)
40 (uri (list (string-append "mirror://gnu/less/less-"
41 version ".tar.gz")
42 (string-append "http://www.greenwoodsoftware.com/less/less-"
43 version ".tar.gz")))
7baa8c78 44 (patches (search-patches "less-hurd-path-max.patch"))
4e94744d 45 (sha256
f76cb6b6 46 (base32 "0r9cdawhk3n3i5hkcqci5k122srj48qsp3i7zpnf0rvqzs1py1qx"))))
fe7777c1
NK
47 (build-system gnu-build-system)
48 (inputs `(("ncurses" ,ncurses)))
49 (home-page "https://www.gnu.org/software/less/")
f50d2669 50 (synopsis "Paginator for terminals")
fe7777c1 51 (description
a22dc0c4
LC
52 "GNU less is a pager, a program that allows you to view large amounts
53of text in page-sized chunks. Unlike traditional pagers, it allows both
54backwards and forwards movement through the document. It also does not have
55to read the entire input file before starting, so it starts faster than most
56text editors.")
f50d2669 57 (license gpl3+))) ; some files are under GPLv2+
0e680920
MR
58
59(define-public lesspipe
60 (package
61 (name "lesspipe")
e9f56a6d 62 (version "1.85")
0e680920
MR
63 (source (origin
64 (method git-fetch)
65 (uri (git-reference
b0e7b699 66 (url "https://github.com/wofr06/lesspipe")
0e680920
MR
67 (commit version)))
68 (file-name (git-file-name name version))
69 (sha256
70 (base32
e9f56a6d 71 "1v1jdkdq1phc93gdr6mjlk98gipxrkkq4bj8kks0kfdvjgdwkdaa"))))
0e680920
MR
72 (build-system gnu-build-system)
73 (arguments
74 '(#:tests? #f ; no tests
75 #:phases (modify-phases %standard-phases
76 (replace 'configure
77 (lambda* (#:key outputs #:allow-other-keys)
78 (let ((out (assoc-ref outputs "out")))
79 (delete-file "Makefile") ; force generating
80 (invoke "./configure"
81 (string-append "--prefix=" out)
82 "--yes")
5a4990b9
MR
83 #t)))
84 (add-before 'install 'patch-tput-and-file
85 (lambda* (#:key inputs #:allow-other-keys)
86 (substitute* "lesspipe.sh"
87 (("tput colors")
88 (string-append (assoc-ref inputs "ncurses")
89 "/bin/tput colors"))
90 (("file -")
91 (string-append (assoc-ref inputs "file")
92 "/bin/file -")))
93 #t)))))
0e680920
MR
94 (inputs
95 `(("file" ,file)
96 ("ncurses" ,ncurses))) ; for tput
97 (native-inputs `(("perl" ,perl)))
98 (home-page "https://github.com/wofr06/lesspipe")
99 (synopsis "Input filter for less")
100 (description "To browse files, the excellent viewer @code{less} can be
101used. By setting the environment variable @code{LESSOPEN}, less can be
102enhanced by external filters to become more powerful. The input filter for
103less described here is called @code{lesspipe.sh}. It is able to process a
104wide variety of file formats. It enables users to inspect archives and
105display their contents without having to unpack them before. The filter is
106easily extensible for new formats.")
107 (license gpl2+)))