gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / less.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
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
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages less)
23 #:use-module (guix licenses)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages ncurses)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages file)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix build-system gnu))
32
33 (define-public less
34 (package
35 (name "less")
36 (version "581")
37 (source
38 (origin
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")))
44 (patches (search-patches "less-hurd-path-max.patch"))
45 (sha256
46 (base32 "0r9cdawhk3n3i5hkcqci5k122srj48qsp3i7zpnf0rvqzs1py1qx"))))
47 (build-system gnu-build-system)
48 (inputs `(("ncurses" ,ncurses)))
49 (home-page "https://www.gnu.org/software/less/")
50 (synopsis "Paginator for terminals")
51 (description
52 "GNU less is a pager, a program that allows you to view large amounts
53 of text in page-sized chunks. Unlike traditional pagers, it allows both
54 backwards and forwards movement through the document. It also does not have
55 to read the entire input file before starting, so it starts faster than most
56 text editors.")
57 (license gpl3+))) ; some files are under GPLv2+
58
59 (define-public lesspipe
60 (package
61 (name "lesspipe")
62 (version "1.85")
63 (source (origin
64 (method git-fetch)
65 (uri (git-reference
66 (url "https://github.com/wofr06/lesspipe")
67 (commit version)))
68 (file-name (git-file-name name version))
69 (sha256
70 (base32
71 "1v1jdkdq1phc93gdr6mjlk98gipxrkkq4bj8kks0kfdvjgdwkdaa"))))
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")
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)))))
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
101 used. By setting the environment variable @code{LESSOPEN}, less can be
102 enhanced by external filters to become more powerful. The input filter for
103 less described here is called @code{lesspipe.sh}. It is able to process a
104 wide variety of file formats. It enables users to inspect archives and
105 display their contents without having to unpack them before. The filter is
106 easily extensible for new formats.")
107 (license gpl2+)))