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