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