gnu: Add cl-ana.statistical-learning.
[jackhill/guix/guix.git] / gnu / packages / texinfo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages texinfo)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix utils)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system gnu)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages readline))
37
38 (define-public texinfo
39 (package
40 (name "texinfo")
41 (version "6.6")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append "mirror://gnu/texinfo/texinfo-"
45 version ".tar.xz"))
46 (sha256
47 (base32
48 "0rixv4c301djr0d0cnsxs8c1wjndi6bf9vi5axz6mwjkv80cmfcv"))))
49 (build-system gnu-build-system)
50 (inputs `(("ncurses" ,ncurses)
51 ("perl" ,perl)))
52
53 (native-search-paths
54 ;; This is the variable used by the standalone Info reader.
55 (list (search-path-specification
56 (variable "INFOPATH")
57 (files '("share/info")))))
58
59 (home-page "https://www.gnu.org/software/texinfo/")
60 (synopsis "The GNU documentation format")
61 (description
62 "Texinfo is the official documentation format of the GNU project. It
63 uses a single source file using explicit commands to produce a final document
64 in any of several supported output formats, such as HTML or PDF. This
65 package includes both the tools necessary to produce Info documents from
66 their source and the command-line Info reader. The emphasis of the language
67 is on expressing the content semantically, avoiding physical markup commands.")
68 (license gpl3+)))
69
70 (define-public texinfo-6.7
71 (package
72 (inherit texinfo)
73 (version "6.7")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append "mirror://gnu/texinfo/texinfo-"
77 version ".tar.xz"))
78 (sha256
79 (base32
80 "1aicn1v3czqii08wc91jw089n1x3gfchkf808q2as59dak0h714q"))))))
81
82 (define-public texinfo-5
83 (package (inherit texinfo)
84 (version "5.2")
85 (source (origin
86 (method url-fetch)
87 (uri (string-append "mirror://gnu/texinfo/texinfo-"
88 version ".tar.xz"))
89 (patches (search-patches "texinfo-5-perl-compat.patch"))
90 (sha256
91 (base32
92 "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))
93 (native-inputs '())))
94
95 (define-public texinfo-4
96 (package (inherit texinfo)
97 (version "4.13a")
98 (source (origin
99 (method url-fetch)
100 (uri (string-append
101 "mirror://gnu/texinfo/texinfo-"
102 version
103 ".tar.lzma"))
104 (sha256
105 (base32
106 "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
107 (native-inputs '())
108 (inputs `(("ncurses" ,ncurses) ("xz" ,xz)))))
109
110 (define-public info-reader
111 ;; The idea of this package is to have the standalone Info reader without
112 ;; the dependency on Perl that 'makeinfo' drags.
113 (package
114 (inherit texinfo)
115 (name "info-reader")
116 (arguments
117 `(#:disallowed-references ,(assoc-ref (package-inputs texinfo)
118 "perl")
119
120 #:modules ((ice-9 ftw) (srfi srfi-1)
121 ,@%gnu-build-system-modules)
122
123 #:phases (modify-phases %standard-phases
124 (add-after 'install 'keep-only-info-reader
125 (lambda* (#:key outputs #:allow-other-keys)
126 ;; Remove everything but 'bin/info' and associated
127 ;; files.
128 (define (files)
129 (scandir "." (lambda (file)
130 (not (member file '("." ".."))))))
131
132 (let ((out (assoc-ref outputs "out")))
133 (with-directory-excursion out
134 (for-each delete-file-recursively
135 (fold delete (files) '("bin" "share"))))
136 (with-directory-excursion (string-append out "/bin")
137 (for-each delete-file (delete "info" (files))))
138 (with-directory-excursion (string-append out "/share")
139 (for-each delete-file-recursively
140 (fold delete (files)
141 '("info" "locale"))))
142 #t))))))
143 (synopsis "Standalone Info documentation reader")))
144
145 (define-public texi2html
146 (package
147 (name "texi2html")
148 (version "5.0")
149 (source (origin
150 (method url-fetch)
151 (uri (string-append "mirror://savannah/" name "/" name "-"
152 version ".tar.bz2"))
153 (sha256
154 (base32
155 "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8"))
156 (patches
157 (search-patches "texi2html-document-encoding.patch"
158 "texi2html-i18n.patch"))
159 (snippet
160 ;; This file is modified by the patch above, but reset its
161 ;; timestamp so we don't trigger the rule to update PO files,
162 ;; which would require Gettext.
163 ;; See <http://bugs.gnu.org/18247>.
164 '(begin
165 (utime "texi2html.pl" 0 0 0 0)
166 #t))))
167 (build-system gnu-build-system)
168 (inputs `(("perl" ,perl)))
169 (arguments
170 ;; Tests fail because of warnings on stderr from Perl 5.22. Adjusting
171 ;; texi2html.pl to avoid the warnings seems non-trivial, so we simply
172 ;; disable the tests.
173 '(#:tests? #f))
174 (home-page "https://www.nongnu.org/texi2html/")
175 (synopsis "Convert Texinfo to HTML")
176 (description
177 "Texi2HTML is a Perl script which converts Texinfo source files to HTML
178 output. It now supports many advanced features, such as internationalization
179 and extremely configurable output formats.
180
181 Development of Texi2HTML moved to the GNU Texinfo repository in 2010, since it
182 was meant to replace the makeinfo implementation in GNU Texinfo. The route
183 forward for authors is, in most cases, to alter manuals and build processes as
184 necessary to use the new features of the makeinfo/texi2any implementation of
185 GNU Texinfo. The Texi2HTML maintainers (one of whom is the principal author
186 of the GNU Texinfo implementation) do not intend to make further releases of
187 Texi2HTML.")
188 ;; Files in /lib under lgpl2.1+ and x11
189 (license gpl2+)))
190
191 (define-public pinfo
192 (package
193 (name "pinfo")
194 (version "0.6.13")
195 (source (origin
196 (method git-fetch)
197 (uri (git-reference
198 (url "https://github.com/baszoetekouw/pinfo.git")
199 (commit (string-append "v" version))))
200 (file-name (git-file-name name version))
201 (sha256
202 (base32
203 "173d2p22irwiabvr4z6qvr6zpr6ysfkhmadjlyhyiwd7z62larvy"))))
204 (build-system gnu-build-system)
205 (arguments
206 `(#:phases
207 (modify-phases %standard-phases
208 (add-after 'unpack 'remove-Werror
209 (lambda _
210 (substitute* "configure.ac"
211 (("-Werror") ""))
212 #t))
213 (add-after 'unpack 'embed-reference-to-clear
214 (lambda* (#:key inputs #:allow-other-keys)
215 (substitute* '("src/manual.c"
216 "src/mainfunction.c"
217 "src/utils.c")
218 (("\"clear\"")
219 (string-append "\"" (which "clear") "\"")))
220 #t)))))
221 (inputs
222 `(("ncurses" ,ncurses)
223 ("readline" ,readline)))
224 (native-inputs
225 `(("autoconf" ,autoconf)
226 ("automake" ,automake)
227 ("gettext" ,gnu-gettext)
228 ("libtool" ,libtool)
229 ("texinfo" ,texinfo)))
230 (home-page "https://github.com/baszoetekouw/pinfo")
231 (synopsis "Lynx-style Info file and man page reader")
232 (description
233 "Pinfo is an Info file viewer. Pinfo is similar in use to the Lynx web
234 browser. You just move across info nodes, and select links, follow them, etc.
235 It supports many colors. Pinfo also supports viewing of manual pages -- they
236 are colorized like in the midnight commander's viewer, and additionaly they
237 are hypertextualized.")
238 (license gpl2+)))