gnu: Add lci.
[jackhill/guix/guix.git] / gnu / packages / texinfo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2015, 2016 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 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages texinfo)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages perl)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages ncurses))
31
32 (define-public texinfo
33 (package
34 (name "texinfo")
35 (version "6.1")
36 (source (origin
37 (method url-fetch)
38 (uri (string-append "mirror://gnu/texinfo/texinfo-"
39 version ".tar.xz"))
40 (sha256
41 (base32
42 "1ll3d0l8izygdxqz96wfr2631kxahifwdknpgsx2090vw963js5c"))))
43 (build-system gnu-build-system)
44 (native-inputs `(("procps" ,procps))) ;one of the tests needs pgrep
45 (inputs `(("ncurses" ,ncurses)
46 ("perl" ,perl)))
47
48 (native-search-paths
49 ;; This is the variable used by the standalone Info reader.
50 (list (search-path-specification
51 (variable "INFOPATH")
52 (files '("share/info")))))
53
54 (home-page "http://www.gnu.org/software/texinfo/")
55 (synopsis "The GNU documentation format")
56 (description
57 "Texinfo is the official documentation format of the GNU project. It
58 uses a single source file using explicit commands to produce a final document
59 in any of several supported output formats, such as HTML or PDF. This
60 package includes both the tools necessary to produce Info documents from
61 their source and the command-line Info reader. The emphasis of the language
62 is on expressing the content semantically, avoiding physical markup commands.")
63 (license gpl3+)))
64
65 (define-public texinfo-6.3
66 (package
67 (inherit texinfo)
68 (version "6.3")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "mirror://gnu/texinfo/texinfo-"
72 version ".tar.xz"))
73 (sha256
74 (base32
75 "0fpr9kdjjl6nj2pc50k2zr7134hvqz8bi8pfqa7131a9lpzz6v14"))))))
76
77 (define-public texinfo-5
78 (package (inherit texinfo)
79 (version "5.2")
80 (source (origin
81 (method url-fetch)
82 (uri (string-append "mirror://gnu/texinfo/texinfo-"
83 version ".tar.xz"))
84 (sha256
85 (base32
86 "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))
87 (native-inputs '())))
88
89 (define-public texinfo-4
90 (package (inherit texinfo)
91 (version "4.13a")
92 (source (origin
93 (method url-fetch)
94 (uri (string-append
95 "mirror://gnu/texinfo/texinfo-"
96 version
97 ".tar.lzma"))
98 (sha256
99 (base32
100 "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
101 (native-inputs '())
102 (inputs `(("ncurses" ,ncurses) ("xz" ,xz)))))
103
104 (define-public info-reader
105 ;; The idea of this package is to have the standalone Info reader without
106 ;; the dependency on Perl that 'makeinfo' drags.
107 (package
108 (inherit texinfo)
109 (name "info-reader")
110 (arguments
111 `(#:disallowed-references ,(assoc-ref (package-inputs texinfo)
112 "perl")
113
114 #:modules ((ice-9 ftw) (srfi srfi-1)
115 ,@%gnu-build-system-modules)
116
117 #:phases (modify-phases %standard-phases
118 (add-after 'install 'keep-only-info-reader
119 (lambda* (#:key outputs #:allow-other-keys)
120 ;; Remove everything but 'bin/info' and associated
121 ;; files.
122 (define (files)
123 (scandir "." (lambda (file)
124 (not (member file '("." ".."))))))
125
126 (let ((out (assoc-ref outputs "out")))
127 (with-directory-excursion out
128 (for-each delete-file-recursively
129 (fold delete (files) '("bin" "share"))))
130 (with-directory-excursion (string-append out "/bin")
131 (for-each delete-file (delete "info" (files))))
132 (with-directory-excursion (string-append out "/share")
133 (for-each delete-file-recursively
134 (fold delete (files)
135 '("info" "locale"))))
136 #t))))))
137 (synopsis "Standalone Info documentation reader")))
138
139 (define-public texi2html
140 (package
141 (name "texi2html")
142 (version "5.0")
143 (source (origin
144 (method url-fetch)
145 (uri (string-append "mirror://savannah/" name "/" name "-"
146 version ".tar.bz2"))
147 (sha256
148 (base32
149 "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8"))
150 (patches
151 (search-patches "texi2html-document-encoding.patch"
152 "texi2html-i18n.patch"))
153 (snippet
154 ;; This file is modified by the patch above, but reset its
155 ;; timestamp so we don't trigger the rule to update PO files,
156 ;; which would require Gettext.
157 ;; See <http://bugs.gnu.org/18247>.
158 '(utime "texi2html.pl" 0 0 0 0))))
159 (build-system gnu-build-system)
160 (inputs `(("perl" ,perl)))
161 (arguments
162 ;; Tests fail because of warnings on stderr from Perl 5.22. Adjusting
163 ;; texi2html.pl to avoid the warnings seems non-trivial, so we simply
164 ;; disable the tests.
165 '(#:tests? #f))
166 (home-page "http://www.nongnu.org/texi2html/")
167 (synopsis "Convert Texinfo to HTML")
168 (description
169 "Texi2HTML is a Perl script which converts Texinfo source files to HTML
170 output. It now supports many advanced features, such as internationalization
171 and extremely configurable output formats.
172
173 Development of Texi2HTML moved to the GNU Texinfo repository in 2010, since it
174 was meant to replace the makeinfo implementation in GNU Texinfo. The route
175 forward for authors is, in most cases, to alter manuals and build processes as
176 necessary to use the new features of the makeinfo/texi2any implementation of
177 GNU Texinfo. The Texi2HTML maintainers (one of whom is the principal author
178 of the GNU Texinfo implementation) do not intend to make further releases of
179 Texi2HTML.")
180 ;; Files in /lib under lgpl2.1+ and x11
181 (license gpl2+)))