Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / documentation.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
6 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
8 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
11 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages documentation)
29 #:use-module (guix licenses)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system cmake)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages docbook)
42 #:use-module (gnu packages flex)
43 #:use-module (gnu packages graphviz)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages xml))
48
49 (define-public asciidoc
50 (package
51 (name "asciidoc")
52 (version "8.6.10")
53 (source (origin
54 (method url-fetch)
55 (uri (string-append "https://github.com/asciidoc/asciidoc/"
56 "archive/" version ".tar.gz"))
57 (file-name (string-append name "-" version ".tar.gz"))
58 (sha256
59 (base32
60 "10xrl1iwyvs8aqm0vzkvs3dnsn93wyk942kk4ppyl6w9imbzhlly"))))
61 (build-system gnu-build-system)
62 (arguments
63 `(#:tests? #f ; no 'check' target
64 #:phases
65 (modify-phases %standard-phases
66 (replace 'bootstrap
67 (lambda _
68 (invoke "autoconf")))
69 ;; Some XML-related binaries are required for asciidoc's proper usage.
70 ;; Without these, asciidoc fails when parsing XML documents, either
71 ;; reporting a missing "xmllint" binary or, when passed the
72 ;; "--no-xmllint" option, a missing "xsltproc" binary.
73 ;; The following phase enables asciidoc to find some of them.
74 (add-before 'configure 'set-xml-binary-paths
75 (lambda* (#:key inputs #:allow-other-keys)
76 (let* ((libxml2 (assoc-ref inputs "libxml2"))
77 (xmllint (string-append libxml2 "/bin/xmllint"))
78 (libxslt (assoc-ref inputs "libxslt"))
79 (xsltproc (string-append libxslt "/bin/xsltproc")))
80 (substitute* "a2x.py"
81 (("XMLLINT = 'xmllint'")
82 (string-append "XMLLINT = '" xmllint "'"))
83 (("XSLTPROC = 'xsltproc'")
84 (string-append "XSLTPROC = '" xsltproc "'")))
85 #t)))
86 ;; Make asciidoc use the local docbook-xsl package instead of fetching
87 ;; it from the internet at run-time.
88 (add-before 'install 'make-local-docbook-xsl
89 (lambda* (#:key inputs #:allow-other-keys)
90 (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
91 (("xsl:import href=\"http://docbook.sourceforge.net/\
92 release/xsl/current")
93 (string-append
94 "xsl:import href=\""
95 (string-append (assoc-ref inputs "docbook-xsl")
96 "/xml/xsl/docbook-xsl-"
97 ,(package-version docbook-xsl)))))
98 #t))
99 ;; Do the same for docbook-xml.
100 (add-before 'install 'make-local-docbook-xml
101 (lambda* (#:key inputs #:allow-other-keys)
102 (substitute* "docbook45.conf"
103 (("http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd")
104 (string-append (assoc-ref inputs "docbook-xml")
105 "/xml/dtd/docbook/docbookx.dtd")))
106 #t)))))
107 (native-inputs
108 `(("autoconf" ,autoconf)))
109 (inputs `(("python" ,python-2)
110 ("docbook-xml" ,docbook-xml)
111 ("docbook-xsl" ,docbook-xsl)
112 ("libxml2" ,libxml2)
113 ("libxslt" ,libxslt)))
114 (home-page "http://asciidoc.org/")
115 (synopsis "Text-based document generation system")
116 (description
117 "AsciiDoc is a text document format for writing notes, documentation,
118 articles, books, ebooks, slideshows, web pages, man pages and blogs.
119 AsciiDoc files can be translated to many formats including HTML, PDF,
120 EPUB, man page.
121
122 AsciiDoc is highly configurable: both the AsciiDoc source file syntax and
123 the backend output markups (which can be almost any type of SGML/XML
124 markup) can be customized and extended by the user.")
125 (license gpl2+)))
126
127 (define-public asciidoc-py3
128 (package (inherit asciidoc)
129 (name "asciidoc-py3")
130 (version "9.0.0rc1")
131 (source (origin
132 (method git-fetch)
133 (uri (git-reference
134 (url "https://github.com/asciidoc/asciidoc-py3/")
135 (commit version)))
136 (file-name (git-file-name name version))
137 (sha256
138 (base32
139 "1v815dgab62970m9cr2crwbh4kvlzk6pv3hk4bzv6gfa4lbwfkfl"))))
140 (build-system gnu-build-system)
141 (native-inputs
142 `(("autoconf" ,autoconf)))
143 (inputs
144 `(("python" ,python)
145 ("docbook-xml" ,docbook-xml)
146 ("docbook-xsl" ,docbook-xsl)
147 ("libxml2" ,libxml2)
148 ("libxslt" ,libxslt)))))
149
150 (define-public doxygen
151 (package
152 (name "doxygen")
153 (version "1.8.17")
154 (home-page "http://www.doxygen.nl/")
155 (source (origin
156 (method url-fetch)
157 (uri (list (string-append home-page "files/doxygen-"
158 version ".src.tar.gz")
159 (string-append "mirror://sourceforge/doxygen/rel-"
160 version "/doxygen-" version
161 ".src.tar.gz")))
162 (sha256
163 (base32
164 "16dmv0gm1x8rvbm82fmjvi213q8fxqxinm75pcf595flya59ific"))
165 (patches (search-patches "doxygen-test.patch"
166 "doxygen-1.8.17-runtests.patch"))))
167 (build-system cmake-build-system)
168 (native-inputs
169 `(("bison" ,bison)
170 ("flex" ,flex)
171 ("libxml2" ,libxml2) ;provides xmllint for the tests
172 ("python" ,python))) ;for creating the documentation
173 (inputs
174 `(("bash" ,bash-minimal)))
175 (arguments
176 ;; Force cmake to use iconv header from cross-libc instead of the one
177 ;; from native libc.
178 `(,@(if (%current-target-system)
179 '(#:configure-flags
180 (list (string-append "-DICONV_INCLUDE_DIR="
181 (assoc-ref %build-inputs "cross-libc")
182 "/include")))
183 '())
184 #:test-target "tests"
185 #:phases (modify-phases %standard-phases
186 (add-before 'configure 'patch-sh
187 (lambda* (#:key inputs #:allow-other-keys)
188 (substitute* "src/portable.cpp"
189 (("/bin/sh")
190 (string-append
191 (assoc-ref inputs "bash") "/bin/sh")))
192 #t)))))
193 (synopsis "Generate documentation from annotated sources")
194 (description "Doxygen is the de facto standard tool for generating
195 documentation from annotated C++ sources, but it also supports other popular
196 programming languages such as C, Objective-C, C#, PHP, Java, Python,
197 IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl,
198 and to some extent D.")
199 (license gpl3+)))
200
201 (define-public doc++
202 (package
203 (name "doc++")
204 (version "3.4.10")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "https://sourceforge.net/projects/docpp/"
208 "files/doc++-" version ".tar.gz"))
209 (sha256
210 (base32
211 "0i37zlxl8g352s4hzpdx0657k5x3czh3xcsfr27irc708gb277pn"))
212 (patches (search-patches "doc++-include-directives.patch"
213 "doc++-segfault-fix.patch"))))
214 (build-system gnu-build-system)
215 (native-inputs
216 `(("flex" ,flex)
217 ("gettext" ,gettext-minimal)))
218 (home-page "http://docpp.sourceforge.net/")
219 (synopsis "Documentation system for C, C++, IDL, and Java")
220 (description
221 "DOC++ is a documentation system for C, C++, IDL, and Java. It can
222 generate both TeX output for high-quality hardcopies or HTML output for online
223 brwosing. The documentation is extracted directly from the C/C++/IDL source
224 or Java class files.")
225 (license gpl2+)))
226
227 (define-public scrollkeeper
228 (package
229 (name "scrollkeeper")
230 (version "0.3.14")
231 (source
232 (origin
233 (method url-fetch)
234 (uri (string-append "mirror://sourceforge/scrollkeeper/scrollkeeper/"
235 version "/scrollkeeper-" version ".tar.gz"))
236 (sha256
237 (base32 "1bfxwxc1ngh11v36z899sz9qam366r050fhkyb5adv65lb1x62sa"))))
238 (build-system gnu-build-system)
239 (arguments
240 `(#:configure-flags
241 (list (string-append "--with-xml-catalog="
242 (assoc-ref %build-inputs "docbook-xml")
243 "/xml/dtd/docbook/catalog.xml"))))
244 (inputs
245 `(("perl" ,perl)
246 ("libxml2" ,libxml2)
247 ("libxslt" ,libxslt)
248 ;; The configure script checks for either version 4.2 or 4.1.2.
249 ("docbook-xml" ,docbook-xml-4.2)))
250 (native-inputs
251 `(("intltool" ,intltool)))
252 (home-page "http://scrollkeeper.sourceforge.net/")
253 (synopsis "Open Documentation Cataloging Project")
254 (description "ScrollKeeper is a cataloging system for documentation on open
255 systems. It manages documentation metadata as specified by the Open Source
256 Metadata Framework and provides a simple API to allow help browsers to find,
257 sort, and search the document catalog. It will also be able to communicate
258 with catalog servers on the Net to search for documents which are not on the
259 local system.")
260 (license lgpl2.1+)))