gnu: Remove ".git" from "https://github/…/….git".
[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
160 (inherit texinfo)
161 (name "info-reader")
162 (arguments
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 '("." ".."))))))
173
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")
187 #:modules ((ice-9 ftw) (srfi srfi-1)
188 ,@%gnu-build-system-modules)))
189 (synopsis "Standalone Info documentation reader")))
190
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"))
202 (patches
203 (search-patches "texi2html-document-encoding.patch"
204 "texi2html-i18n.patch"))
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>.
210 '(begin
211 (utime "texi2html.pl" 0 0 0 0)
212 #t))))
213 (build-system gnu-build-system)
214 (inputs `(("perl" ,perl)))
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))
220 (home-page "https://www.nongnu.org/texi2html/")
221 (synopsis "Convert Texinfo to HTML")
222 (description
223 "Texi2HTML is a Perl script which converts Texinfo source files to HTML
224 output. It now supports many advanced features, such as internationalization
225 and extremely configurable output formats.
226
227 Development of Texi2HTML moved to the GNU Texinfo repository in 2010, since it
228 was meant to replace the makeinfo implementation in GNU Texinfo. The route
229 forward for authors is, in most cases, to alter manuals and build processes as
230 necessary to use the new features of the makeinfo/texi2any implementation of
231 GNU Texinfo. The Texi2HTML maintainers (one of whom is the principal author
232 of the GNU Texinfo implementation) do not intend to make further releases of
233 Texi2HTML.")
234 ;; Files in /lib under lgpl2.1+ and x11
235 (license gpl2+)))
236
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
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
256 (url "https://github.com/baszoetekouw/pinfo")
257 (commit (string-append "v" version))))
258 (file-name (git-file-name name version))
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)
285 ("gettext" ,gettext-minimal)
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
292 browser. You just move across info nodes, and select links, follow them, etc.
293 It supports many colors. Pinfo also supports viewing of manual pages -- they
294 are colorized like in the midnight commander's viewer, and additionally they
295 are hypertextualized.")
296 (license gpl2+)))