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>
14 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
47 (define-public texinfo
53 (uri (string-append "mirror://gnu/texinfo/texinfo-"
57 "1aicn1v3czqii08wc91jw089n1x3gfchkf808q2as59dak0h714q"))))
58 (build-system gnu-build-system)
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
66 (if ,(%current-target-system)
67 (modify-phases %standard-phases
68 (add-before 'configure 'fix-cross-configure
70 (substitute* "configure"
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
79 (native-inputs (list perl ncurses))
82 ;; This is the variable used by the standalone Info reader.
83 (list (search-path-specification
85 (files '("share/info")))))
87 (home-page "https://www.gnu.org/software/texinfo/")
88 (synopsis "The GNU documentation format")
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.")
98 (define-public texinfo-5
99 (package (inherit texinfo)
103 (uri (string-append "mirror://gnu/texinfo/texinfo-"
105 (patches (search-patches "texinfo-5-perl-compat.patch"))
108 "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))))
110 (define-public texinfo-4
111 (package (inherit texinfo)
116 "mirror://gnu/texinfo/texinfo-"
121 "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
122 (inputs (list ncurses xz))
124 (modify-inputs (package-native-inputs texinfo)
127 (substitute-keyword-arguments (package-arguments texinfo)
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"
136 (install-file (string-append
138 (or native-inputs inputs) "automake")
140 ,(version-major+minor
141 (package-version automake))
143 '("config.sub" "config.guess")))
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")
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
159 `(,@(substitute-keyword-arguments (package-arguments texinfo)
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
178 (scandir "." (lambda (file)
179 (not (member file '("." ".."))))))
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
190 '("info" "locale"))))
192 #:disallowed-references ,(assoc-ref (package-inputs texinfo)
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)
200 (define-public texi2html
206 (uri (string-append "mirror://savannah/" name "/" name "-"
210 "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8"))
212 (search-patches "texi2html-document-encoding.patch"
213 "texi2html-i18n.patch"))
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>.
220 (utime "texi2html.pl" 0 0 0 0)
222 (build-system gnu-build-system)
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.
229 (home-page "https://www.nongnu.org/texi2html/")
230 (synopsis "Convert Texinfo to HTML")
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.
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
243 ;; Files in /lib under lgpl2.1+ and x11
246 (define-public texi2html-1.82
253 (uri (string-append "mirror://savannah/texi2html/"
254 "texi2html-" version ".tar.bz2"))
256 (base32 "1wdli2szkgm3l0vx8rf6lylw0b0m47dlz9iy004n928nqkzix76n"))))))
259 (let ((commit "3d76eecde211e41ccc28b04e229f159b3f924399")
263 ;; Latest tag is completely broken and does not build.
264 (version (git-version "0.6.13" revision commit))
268 (url "https://github.com/baszoetekouw/pinfo")
270 (file-name (git-file-name name version))
272 (base32 "0qym323d9my5l4bhw9vry453hhlxhjjvy8mcdi38sk0bqqid0vd1"))))
273 (build-system gnu-build-system)
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"
284 (string-append "\"" ncurses "/bin/clear\"")))))))))
286 (list ncurses readline))
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")
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.")