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