gnu: ruby-pandoc-ruby: Use pandoc instead of ghc-pandoc.
[jackhill/guix/guix.git] / gnu / packages / texinfo.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
99fcefb9 2;;; Copyright © 2012, 2013, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
1022da10 3;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
f7b55b04 4;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
ca825070 5;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
e703f6d8 6;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
c096028a 7;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
7b90379d 8;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
f9f3ac4e 9;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
95c14929 10;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
db32c281 11;;;
233e7676 12;;; This file is part of GNU Guix.
db32c281 13;;;
233e7676 14;;; GNU Guix is free software; you can redistribute it and/or modify it
db32c281
LC
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;;;
233e7676 19;;; GNU Guix is distributed in the hope that it will be useful, but
db32c281
LC
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
233e7676 25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
db32c281 26
1ffa7090 27(define-module (gnu packages texinfo)
6fe3e250 28 #:use-module (gnu packages autotools)
4a44e743 29 #:use-module (guix licenses)
db32c281 30 #:use-module (guix packages)
a13116b6 31 #:use-module (guix utils)
db32c281 32 #:use-module (guix download)
6fe3e250 33 #:use-module (guix utils)
e703f6d8 34 #:use-module (guix git-download)
db32c281 35 #:use-module (guix build-system gnu)
c5d83768 36 #:use-module (gnu packages)
e703f6d8 37 #:use-module (gnu packages autotools)
1ffa7090 38 #:use-module (gnu packages compression)
e703f6d8 39 #:use-module (gnu packages gettext)
74601e45 40 #:use-module (gnu packages ncurses)
e703f6d8
RW
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages readline))
db32c281
LC
43
44(define-public texinfo
45 (package
46 (name "texinfo")
64b39d6e 47 (version "6.7")
a24b75d8 48 (source (origin
f7b55b04
MW
49 (method url-fetch)
50 (uri (string-append "mirror://gnu/texinfo/texinfo-"
51 version ".tar.xz"))
52 (sha256
53 (base32
64b39d6e 54 "1aicn1v3czqii08wc91jw089n1x3gfchkf808q2as59dak0h714q"))))
db32c281 55 (build-system gnu-build-system)
5a2f58d5
MO
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 '()))
95c14929
JN
72 (inputs `(("ncurses" ,ncurses)
73 ;; TODO: remove `if' in the next rebuild cycle.
74 ,@(if (%current-target-system)
75 `(("perl" ,perl))
76 '())))
5a2f58d5
MO
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)))
1668dfcd
LC
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
6fd52309 89 (home-page "https://www.gnu.org/software/texinfo/")
f50d2669 90 (synopsis "The GNU documentation format")
db32c281 91 (description
a22dc0c4 92 "Texinfo is the official documentation format of the GNU project. It
79c311b8
LC
93uses a single source file using explicit commands to produce a final document
94in any of several supported output formats, such as HTML or PDF. This
95package includes both the tools necessary to produce Info documents from
96their source and the command-line Info reader. The emphasis of the language
97is on expressing the content semantically, avoiding physical markup commands.")
4a44e743 98 (license gpl3+)))
bbafef3f 99
f7b55b04
MW
100(define-public texinfo-5
101 (package (inherit texinfo)
102 (version "5.2")
ce1e4bd5
LC
103 (source (origin
104 (method url-fetch)
105 (uri (string-append "mirror://gnu/texinfo/texinfo-"
106 version ".tar.xz"))
a446cf26 107 (patches (search-patches "texinfo-5-perl-compat.patch"))
ce1e4bd5
LC
108 (sha256
109 (base32
c096028a 110 "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))))
ce1e4bd5 111
bbafef3f
MW
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"))))
6fe3e250
PML
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 '())))))))
c5d83768 155
7feebd33
LC
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
8f03b70b 160 (inherit texinfo)
7feebd33
LC
161 (name "info-reader")
162 (arguments
7b90379d
MO
163 `(,@(substitute-keyword-arguments (package-arguments texinfo)
164 ((#:phases phases)
165 `(modify-phases ,phases
166 (add-after 'install 'keep-only-info-reader
167 (lambda* (#:key outputs #:allow-other-keys)
168 ;; Remove everything but 'bin/info' and associated
169 ;; files.
170 (define (files)
171 (scandir "." (lambda (file)
172 (not (member file '("." ".."))))))
7feebd33 173
7b90379d
MO
174 (let ((out (assoc-ref outputs "out")))
175 (with-directory-excursion out
176 (for-each delete-file-recursively
177 (fold delete (files) '("bin" "share"))))
178 (with-directory-excursion (string-append out "/bin")
179 (for-each delete-file (delete "info" (files))))
180 (with-directory-excursion (string-append out "/share")
181 (for-each delete-file-recursively
182 (fold delete (files)
183 '("info" "locale"))))
184 #t))))))
185 #:disallowed-references ,(assoc-ref (package-inputs texinfo)
186 "perl")
7feebd33 187 #:modules ((ice-9 ftw) (srfi srfi-1)
7b90379d 188 ,@%gnu-build-system-modules)))
7feebd33
LC
189 (synopsis "Standalone Info documentation reader")))
190
c5d83768
EB
191(define-public texi2html
192 (package
193 (name "texi2html")
194 (version "5.0")
195 (source (origin
196 (method url-fetch)
197 (uri (string-append "mirror://savannah/" name "/" name "-"
198 version ".tar.bz2"))
199 (sha256
200 (base32
201 "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8"))
d759cf67 202 (patches
fc1adab1
AK
203 (search-patches "texi2html-document-encoding.patch"
204 "texi2html-i18n.patch"))
d759cf67
LC
205 (snippet
206 ;; This file is modified by the patch above, but reset its
207 ;; timestamp so we don't trigger the rule to update PO files,
208 ;; which would require Gettext.
209 ;; See <http://bugs.gnu.org/18247>.
6cbee49d
MW
210 '(begin
211 (utime "texi2html.pl" 0 0 0 0)
212 #t))))
c5d83768 213 (build-system gnu-build-system)
c5d83768 214 (inputs `(("perl" ,perl)))
1022da10
EB
215 (arguments
216 ;; Tests fail because of warnings on stderr from Perl 5.22. Adjusting
217 ;; texi2html.pl to avoid the warnings seems non-trivial, so we simply
218 ;; disable the tests.
219 '(#:tests? #f))
340978d7 220 (home-page "https://www.nongnu.org/texi2html/")
c5d83768
EB
221 (synopsis "Convert Texinfo to HTML")
222 (description
223 "Texi2HTML is a Perl script which converts Texinfo source files to HTML
224output. It now supports many advanced features, such as internationalization
225and extremely configurable output formats.
226
227Development of Texi2HTML moved to the GNU Texinfo repository in 2010, since it
228was meant to replace the makeinfo implementation in GNU Texinfo. The route
229forward for authors is, in most cases, to alter manuals and build processes as
230necessary to use the new features of the makeinfo/texi2any implementation of
231GNU Texinfo. The Texi2HTML maintainers (one of whom is the principal author
232of the GNU Texinfo implementation) do not intend to make further releases of
233Texi2HTML.")
234 ;; Files in /lib under lgpl2.1+ and x11
235 (license gpl2+)))
e703f6d8 236
f9f3ac4e
NG
237(define-public texi2html-1.82
238 (package
239 (inherit texi2html)
240 (version "1.82")
241 (source
242 (origin
243 (method url-fetch)
244 (uri (string-append "mirror://savannah/texi2html/"
245 "texi2html-" version ".tar.bz2"))
246 (sha256
247 (base32 "1wdli2szkgm3l0vx8rf6lylw0b0m47dlz9iy004n928nqkzix76n"))))))
248
e703f6d8
RW
249(define-public pinfo
250 (package
251 (name "pinfo")
252 (version "0.6.13")
253 (source (origin
254 (method git-fetch)
255 (uri (git-reference
b0e7b699 256 (url "https://github.com/baszoetekouw/pinfo")
e703f6d8 257 (commit (string-append "v" version))))
ca825070 258 (file-name (git-file-name name version))
e703f6d8
RW
259 (sha256
260 (base32
261 "173d2p22irwiabvr4z6qvr6zpr6ysfkhmadjlyhyiwd7z62larvy"))))
262 (build-system gnu-build-system)
263 (arguments
264 `(#:phases
265 (modify-phases %standard-phases
266 (add-after 'unpack 'remove-Werror
267 (lambda _
268 (substitute* "configure.ac"
269 (("-Werror") ""))
270 #t))
271 (add-after 'unpack 'embed-reference-to-clear
272 (lambda* (#:key inputs #:allow-other-keys)
273 (substitute* '("src/manual.c"
274 "src/mainfunction.c"
275 "src/utils.c")
276 (("\"clear\"")
277 (string-append "\"" (which "clear") "\"")))
278 #t)))))
279 (inputs
280 `(("ncurses" ,ncurses)
281 ("readline" ,readline)))
282 (native-inputs
283 `(("autoconf" ,autoconf)
284 ("automake" ,automake)
f2d97d57 285 ("gettext" ,gettext-minimal)
e703f6d8
RW
286 ("libtool" ,libtool)
287 ("texinfo" ,texinfo)))
288 (home-page "https://github.com/baszoetekouw/pinfo")
289 (synopsis "Lynx-style Info file and man page reader")
290 (description
291 "Pinfo is an Info file viewer. Pinfo is similar in use to the Lynx web
292browser. You just move across info nodes, and select links, follow them, etc.
293It supports many colors. Pinfo also supports viewing of manual pages -- they
4250a963 294are colorized like in the midnight commander's viewer, and additionally they
e703f6d8
RW
295are hypertextualized.")
296 (license gpl2+)))