gnu: libdvdcss: Update to 1.4.3.
[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 ;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
8 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
9 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages texinfo)
28 #:use-module (gnu packages autotools)
29 #:use-module (guix licenses)
30 #:use-module (guix packages)
31 #:use-module (guix utils)
32 #:use-module (guix download)
33 #:use-module (guix utils)
34 #:use-module (guix git-download)
35 #:use-module (guix build-system gnu)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages gettext)
40 #:use-module (gnu packages ncurses)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages readline))
43
44 (define-public texinfo
45 (package
46 (name "texinfo")
47 (version "6.7")
48 (source (origin
49 (method url-fetch)
50 (uri (string-append "mirror://gnu/texinfo/texinfo-"
51 version ".tar.xz"))
52 (sha256
53 (base32
54 "1aicn1v3czqii08wc91jw089n1x3gfchkf808q2as59dak0h714q"))))
55 (build-system gnu-build-system)
56 (arguments
57 ;; When cross-compiling, the package is configured twice: once with the
58 ;; native compiler and once with the cross-compiler. During the configure
59 ;; with the native compiler, the environment is reset. This leads to
60 ;; multiple environment variables missing. Do not reset the environment
61 ;; to prevent that.
62 (if (%current-target-system)
63 '(#:phases
64 (modify-phases %standard-phases
65 (add-before 'configure 'fix-cross-configure
66 (lambda _
67 (substitute* "configure"
68 (("env -i")
69 "env "))
70 #t))))
71 '()))
72 (inputs `(("ncurses" ,ncurses)
73 ;; TODO: remove `if' in the next rebuild cycle.
74 ,@(if (%current-target-system)
75 `(("perl" ,perl))
76 '())))
77 ;; When cross-compiling, texinfo will build some of its own binaries with
78 ;; the native compiler. This means ncurses is needed both in both inputs
79 ;; and native-inputs.
80 (native-inputs `(("perl" ,perl)
81 ("ncurses" ,ncurses)))
82
83 (native-search-paths
84 ;; This is the variable used by the standalone Info reader.
85 (list (search-path-specification
86 (variable "INFOPATH")
87 (files '("share/info")))))
88
89 (home-page "https://www.gnu.org/software/texinfo/")
90 (synopsis "The GNU documentation format")
91 (description
92 "Texinfo is the official documentation format of the GNU project. It
93 uses a single source file using explicit commands to produce a final document
94 in any of several supported output formats, such as HTML or PDF. This
95 package includes both the tools necessary to produce Info documents from
96 their source and the command-line Info reader. The emphasis of the language
97 is on expressing the content semantically, avoiding physical markup commands.")
98 (license gpl3+)))
99
100 (define-public texinfo-5
101 (package (inherit texinfo)
102 (version "5.2")
103 (source (origin
104 (method url-fetch)
105 (uri (string-append "mirror://gnu/texinfo/texinfo-"
106 version ".tar.xz"))
107 (patches (search-patches "texinfo-5-perl-compat.patch"))
108 (sha256
109 (base32
110 "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))))
111
112 (define-public texinfo-4
113 (package (inherit texinfo)
114 (version "4.13a")
115 (source (origin
116 (method url-fetch)
117 (uri (string-append
118 "mirror://gnu/texinfo/texinfo-"
119 version
120 ".tar.lzma"))
121 (sha256
122 (base32
123 "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
124 (inputs `(("ncurses" ,ncurses)
125 ("xz" ,xz)))
126 (native-inputs
127 `(("automake" ,automake)
128 ,@(package-native-inputs texinfo)))
129 (arguments
130 (substitute-keyword-arguments (package-arguments texinfo)
131 ((#:phases phases)
132 `(modify-phases ,phases
133 (add-after 'unpack 'fix-configure
134 (lambda* (#:key inputs native-inputs #:allow-other-keys)
135 ;; Replace outdated config.sub and config.guess.
136 (with-directory-excursion "build-aux"
137 (for-each
138 (lambda (file)
139 (install-file (string-append
140 (assoc-ref
141 (or native-inputs inputs) "automake")
142 "/share/automake-"
143 ,(version-major+minor
144 (package-version automake))
145 "/" file) "."))
146 '("config.sub" "config.guess")))
147 #t))
148 ;; Build native version of tools before running 'build phase.
149 ,@(if (%current-target-system)
150 `((add-before 'build 'make-native-gnu-lib
151 (lambda* (#:key inputs #:allow-other-keys)
152 (invoke "make" "-C" "tools/gnulib/lib")
153 #t)))
154 '())))))))
155
156 (define-public info-reader
157 ;; The idea of this package is to have the standalone Info reader without
158 ;; the dependency on Perl that 'makeinfo' drags.
159 (package/inherit texinfo
160 (name "info-reader")
161 (arguments
162 `(,@(substitute-keyword-arguments (package-arguments texinfo)
163 ((#:phases phases)
164 `(modify-phases ,phases
165 (add-after 'install 'keep-only-info-reader
166 (lambda* (#:key outputs #:allow-other-keys)
167 ;; Remove everything but 'bin/info' and associated
168 ;; files.
169 (define (files)
170 (scandir "." (lambda (file)
171 (not (member file '("." ".."))))))
172
173 (let ((out (assoc-ref outputs "out")))
174 (with-directory-excursion out
175 (for-each delete-file-recursively
176 (fold delete (files) '("bin" "share"))))
177 (with-directory-excursion (string-append out "/bin")
178 (for-each delete-file (delete "info" (files))))
179 (with-directory-excursion (string-append out "/share")
180 (for-each delete-file-recursively
181 (fold delete (files)
182 '("info" "locale"))))
183 #t))))))
184 #:disallowed-references ,(assoc-ref (package-inputs texinfo)
185 "perl")
186 #:modules ((ice-9 ftw) (srfi srfi-1)
187 ,@%gnu-build-system-modules)))
188 (synopsis "Standalone Info documentation reader")))
189
190 (define-public texi2html
191 (package
192 (name "texi2html")
193 (version "5.0")
194 (source (origin
195 (method url-fetch)
196 (uri (string-append "mirror://savannah/" name "/" name "-"
197 version ".tar.bz2"))
198 (sha256
199 (base32
200 "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8"))
201 (patches
202 (search-patches "texi2html-document-encoding.patch"
203 "texi2html-i18n.patch"))
204 (snippet
205 ;; This file is modified by the patch above, but reset its
206 ;; timestamp so we don't trigger the rule to update PO files,
207 ;; which would require Gettext.
208 ;; See <http://bugs.gnu.org/18247>.
209 '(begin
210 (utime "texi2html.pl" 0 0 0 0)
211 #t))))
212 (build-system gnu-build-system)
213 (inputs `(("perl" ,perl)))
214 (arguments
215 ;; Tests fail because of warnings on stderr from Perl 5.22. Adjusting
216 ;; texi2html.pl to avoid the warnings seems non-trivial, so we simply
217 ;; disable the tests.
218 '(#:tests? #f))
219 (home-page "https://www.nongnu.org/texi2html/")
220 (synopsis "Convert Texinfo to HTML")
221 (description
222 "Texi2HTML is a Perl script which converts Texinfo source files to HTML
223 output. It now supports many advanced features, such as internationalization
224 and extremely configurable output formats.
225
226 Development of Texi2HTML moved to the GNU Texinfo repository in 2010, since it
227 was meant to replace the makeinfo implementation in GNU Texinfo. The route
228 forward for authors is, in most cases, to alter manuals and build processes as
229 necessary to use the new features of the makeinfo/texi2any implementation of
230 GNU Texinfo. The Texi2HTML maintainers (one of whom is the principal author
231 of the GNU Texinfo implementation) do not intend to make further releases of
232 Texi2HTML.")
233 ;; Files in /lib under lgpl2.1+ and x11
234 (license gpl2+)))
235
236 (define-public texi2html-1.82
237 (package
238 (inherit texi2html)
239 (version "1.82")
240 (source
241 (origin
242 (method url-fetch)
243 (uri (string-append "mirror://savannah/texi2html/"
244 "texi2html-" version ".tar.bz2"))
245 (sha256
246 (base32 "1wdli2szkgm3l0vx8rf6lylw0b0m47dlz9iy004n928nqkzix76n"))))))
247
248 (define-public pinfo
249 (package
250 (name "pinfo")
251 (version "0.6.13")
252 (source (origin
253 (method git-fetch)
254 (uri (git-reference
255 (url "https://github.com/baszoetekouw/pinfo")
256 (commit (string-append "v" version))))
257 (file-name (git-file-name name version))
258 (sha256
259 (base32
260 "173d2p22irwiabvr4z6qvr6zpr6ysfkhmadjlyhyiwd7z62larvy"))))
261 (build-system gnu-build-system)
262 (arguments
263 `(#:phases
264 (modify-phases %standard-phases
265 (add-after 'unpack 'remove-Werror
266 (lambda _
267 (substitute* "configure.ac"
268 (("-Werror") ""))
269 #t))
270 (add-after 'unpack 'embed-reference-to-clear
271 (lambda* (#:key inputs #:allow-other-keys)
272 (substitute* '("src/manual.c"
273 "src/mainfunction.c"
274 "src/utils.c")
275 (("\"clear\"")
276 (string-append "\"" (which "clear") "\"")))
277 #t)))))
278 (inputs
279 `(("ncurses" ,ncurses)
280 ("readline" ,readline)))
281 (native-inputs
282 `(("autoconf" ,autoconf)
283 ("automake" ,automake)
284 ("gettext" ,gettext-minimal)
285 ("libtool" ,libtool)
286 ("texinfo" ,texinfo)))
287 (home-page "https://github.com/baszoetekouw/pinfo")
288 (synopsis "Lynx-style Info file and man page reader")
289 (description
290 "Pinfo is an Info file viewer. Pinfo is similar in use to the Lynx web
291 browser. You just move across info nodes, and select links, follow them, etc.
292 It supports many colors. Pinfo also supports viewing of manual pages -- they
293 are colorized like in the midnight commander's viewer, and additionally they
294 are hypertextualized.")
295 (license gpl2+)))