| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 |
|
| 25 | (define-module (gnu packages less)
|
| 26 | #:use-module (guix gexp)
|
| 27 | #:use-module (guix licenses)
|
| 28 | #:use-module (gnu packages)
|
| 29 | #:use-module (gnu packages base)
|
| 30 | #:use-module (gnu packages ncurses)
|
| 31 | #:use-module (gnu packages perl)
|
| 32 | #:use-module (gnu packages perl-compression)
|
| 33 | #:use-module (gnu packages file)
|
| 34 | #:use-module (guix packages)
|
| 35 | #:use-module (guix download)
|
| 36 | #:use-module (guix git-download)
|
| 37 | #:use-module (guix build-system gnu))
|
| 38 |
|
| 39 | (define-public less
|
| 40 | (package
|
| 41 | (name "less")
|
| 42 | (version "608")
|
| 43 | (source
|
| 44 | (origin
|
| 45 | (method url-fetch)
|
| 46 | (uri (list (string-append "mirror://gnu/less/less-"
|
| 47 | version ".tar.gz")
|
| 48 | (string-append "http://www.greenwoodsoftware.com/less/less-"
|
| 49 | version ".tar.gz")))
|
| 50 | (patches (search-patches "less-hurd-path-max.patch"))
|
| 51 | (sha256
|
| 52 | (base32 "02f2d9d6hyf03va28ip620gjc6rf4aikmdyk47h7frqj18pbx6m6"))))
|
| 53 | (build-system gnu-build-system)
|
| 54 | (inputs (list ncurses))
|
| 55 | (home-page "https://www.gnu.org/software/less/")
|
| 56 | (synopsis "Paginator for terminals")
|
| 57 | (description
|
| 58 | "GNU less is a pager, a program that allows you to view large amounts
|
| 59 | of text in page-sized chunks. Unlike traditional pagers, it allows both
|
| 60 | backwards and forwards movement through the document. It also does not have
|
| 61 | to read the entire input file before starting, so it starts faster than most
|
| 62 | text editors.")
|
| 63 | (license gpl3+))) |
| 64 |
|
| 65 | (define-public lesspipe
|
| 66 | (package
|
| 67 | (name "lesspipe")
|
| 68 | (version "2.17")
|
| 69 | (source (origin
|
| 70 | (method git-fetch)
|
| 71 | (uri (git-reference
|
| 72 | (url "https://github.com/wofr06/lesspipe")
|
| 73 | (commit (string-append "v" version))))
|
| 74 | (file-name (git-file-name name version))
|
| 75 | (sha256
|
| 76 | (base32
|
| 77 | "0fc01pb0qps48wi9cw06sraqbxkcx6nik1jsj0xcal463i66xwk9"))))
|
| 78 | (build-system gnu-build-system)
|
| 79 | (arguments
|
| 80 | (list
|
| 81 | #:tests? #f |
| 82 | #:phases
|
| 83 | #~(modify-phases %standard-phases
|
| 84 | (replace 'configure
|
| 85 | (lambda* (#:key outputs #:allow-other-keys)
|
| 86 | |
| 87 | |
| 88 | (invoke "./configure"
|
| 89 | (string-append "--prefix=" (assoc-ref outputs "out")))))
|
| 90 | (add-before 'install 'fix-makefile
|
| 91 | (lambda _
|
| 92 | (substitute* "Makefile"
|
| 93 | (("\\$\\(DESTDIR\\)/etc") "$(DESTDIR)$(PREFIX)/etc"))))
|
| 94 | (add-before 'install 'patch-command-paths
|
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | (lambda* (#:key inputs #:allow-other-keys)
|
| 101 | (let ((file (search-input-file inputs "/bin/file"))
|
| 102 | (locale (search-input-file inputs "/bin/locale"))
|
| 103 | (tput (search-input-file inputs "/bin/tput")))
|
| 104 | (substitute* "sxw2txt"
|
| 105 | (("^use warnings;" line)
|
| 106 | (string-append
|
| 107 | line "\nuse lib '" #$(this-package-input "perl-archive-zip")
|
| 108 | "/lib/perl5/site_perl';")))
|
| 109 | (substitute* "lesscomplete"
|
| 110 | (("file -") (string-append file " -")))
|
| 111 | (substitute* "lesspipe.sh"
|
| 112 | (("\\<tput\\>") tput)
|
| 113 | (("\\<locale\\>") locale)
|
| 114 | (("file -")
|
| 115 | (string-append file " -")))))))))
|
| 116 | (inputs
|
| 117 | (list file
|
| 118 | ncurses |
| 119 | glibc |
| 120 | perl-archive-zip))
|
| 121 | (native-inputs (list perl))
|
| 122 | (home-page "https://github.com/wofr06/lesspipe")
|
| 123 | (synopsis "Input filter for less")
|
| 124 | (description "To browse files, the excellent viewer @code{less} can be
|
| 125 | used. By setting the environment variable @code{LESSOPEN}, less can be
|
| 126 | enhanced by external filters to become more powerful. The input filter for
|
| 127 | less described here is called @code{lesspipe.sh}. It is able to process a
|
| 128 | wide variety of file formats. It enables users to inspect archives and
|
| 129 | display their contents without having to unpack them before. The filter is
|
| 130 | easily extensible for new formats.")
|
| 131 | (license gpl2+)))
|