gnu: python-deepmerge: Use pyproject-build-system.
[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, 2020 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 ;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
13 ;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
14 ;;; Copyright © 2022 Maxim Cournoyer <maxim.counoyer@gmail.com>
15 ;;;
16 ;;; This file is part of GNU Guix.
17 ;;;
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
22 ;;;
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
27 ;;;
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31 (define-module (gnu packages documentation)
32 #:use-module (guix licenses)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix gexp)
36 #:use-module (guix git-download)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system python)
40 #:use-module (guix build-system qt)
41 #:use-module (guix deprecation)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages backup)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages bash)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages python-xyz)
50 #:use-module (gnu packages bison)
51 #:use-module (gnu packages kde-frameworks)
52 #:use-module (gnu packages docbook)
53 #:use-module (gnu packages flex)
54 #:use-module (gnu packages graphviz)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages qt)
60 #:use-module (gnu packages sqlite)
61 #:use-module (gnu packages sphinx)
62 #:use-module (gnu packages xml)
63 #:use-module (gnu packages xorg))
64
65 (define-public latex2html
66 (package
67 (name "latex2html")
68 (version "2020.2")
69 (source
70 (origin
71 (method git-fetch)
72 (uri
73 (git-reference
74 (url "https://github.com/latex2html/latex2html")
75 (commit (string-append "v" version))))
76 (file-name (git-file-name name version))
77 (sha256
78 (base32 "1icyl6kl60wh7cavprgbd8q6lpjwr7wn24m34kpiif7ahknhcbcm"))))
79 (build-system gnu-build-system)
80 (arguments
81 `(#:phases
82 (modify-phases %standard-phases
83 (add-after 'unpack 'patch-configure
84 (lambda* (#:key outputs #:allow-other-keys)
85 (substitute* "configure"
86 (("/usr/local")
87 (assoc-ref outputs "out"))
88 (("\\$\\{CONFIG_SHELL-/bin/sh\\}")
89 (which "bash")))
90 #t))
91 (replace 'configure
92 (lambda _
93 (invoke "./configure")
94 #t))
95 (add-after 'configure 'patch-cfgcache
96 (lambda* (#:key outputs #:allow-other-keys)
97 (substitute* "cfgcache.pm"
98 (("/usr/local")
99 (assoc-ref outputs "out")))
100 #t)))))
101 (inputs
102 (list perl))
103 (synopsis "LaTeX documents to HTML")
104 (description "LaTeX2HTML is a utility that converts LaTeX documents to web
105 pages in HTML.")
106 (home-page "https://www.latex2html.org/")
107 (license gpl2+)))
108
109 (define-public asciidoc
110 (package
111 (name "asciidoc")
112 (version "9.1.0")
113 (source (origin
114 (method git-fetch)
115 (uri (git-reference
116 (url "https://github.com/asciidoc/asciidoc-py")
117 (commit version)))
118 (file-name (git-file-name name version))
119 (sha256
120 (base32
121 "1clf1axkns23wfmh48xfspzsnw04pjh4mq1pshpzvj0cwxhz0yaq"))))
122 (build-system gnu-build-system)
123 (arguments
124 `(#:tests? #f ; no 'check' target
125 #:phases
126 (modify-phases %standard-phases
127 (replace 'bootstrap
128 (lambda _
129 (invoke "autoconf")))
130 ;; Some XML-related binaries are required for asciidoc's proper usage.
131 ;; Without these, asciidoc fails when parsing XML documents, either
132 ;; reporting a missing "xmllint" binary or, when passed the
133 ;; "--no-xmllint" option, a missing "xsltproc" binary.
134 ;; The following phase enables asciidoc to find some of them.
135 (add-before 'configure 'set-xml-binary-paths
136 (lambda* (#:key inputs #:allow-other-keys)
137 (let* ((libxml2 (assoc-ref inputs "libxml2"))
138 (xmllint (string-append libxml2 "/bin/xmllint"))
139 (libxslt (assoc-ref inputs "libxslt"))
140 (xsltproc (string-append libxslt "/bin/xsltproc")))
141 (substitute* "a2x.py"
142 (("XMLLINT = 'xmllint'")
143 (string-append "XMLLINT = '" xmllint "'"))
144 (("XSLTPROC = 'xsltproc'")
145 (string-append "XSLTPROC = '" xsltproc "'")))
146 #t)))
147 ;; Make asciidoc use the local docbook-xsl package instead of fetching
148 ;; it from the internet at run-time.
149 (add-before 'install 'make-local-docbook-xsl
150 (lambda* (#:key inputs #:allow-other-keys)
151 (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
152 (("xsl:import href=\"http://docbook.sourceforge.net/\
153 release/xsl/current")
154 (string-append
155 "xsl:import href=\""
156 (string-append (assoc-ref inputs "docbook-xsl")
157 "/xml/xsl/docbook-xsl-"
158 ,(package-version docbook-xsl)))))
159 #t))
160 ;; Do the same for docbook-xml.
161 (add-before 'install 'make-local-docbook-xml
162 (lambda* (#:key inputs #:allow-other-keys)
163 (substitute* "docbook45.conf"
164 (("http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd")
165 (string-append (assoc-ref inputs "docbook-xml")
166 "/xml/dtd/docbook/docbookx.dtd")))
167 #t)))))
168 (native-inputs
169 (list autoconf))
170 (inputs
171 (list python docbook-xml docbook-xsl libxml2 libxslt))
172 (home-page "https://asciidoc.org/")
173 (synopsis "Text-based document generation system")
174 (description
175 "AsciiDoc is a text document format for writing notes, documentation,
176 articles, books, ebooks, slideshows, web pages, man pages and blogs.
177 AsciiDoc files can be translated to many formats including HTML, PDF,
178 EPUB, man page.
179
180 AsciiDoc is highly configurable: both the AsciiDoc source file syntax and
181 the backend output markups (which can be almost any type of SGML/XML
182 markup) can be customized and extended by the user.")
183 (license gpl2+)))
184
185 (define-deprecated asciidoc-py3 asciidoc)
186
187 (define-public doxygen
188 (package
189 (name "doxygen")
190 (version "1.9.1")
191 (home-page "https://www.doxygen.nl/")
192 (source (origin
193 (method url-fetch)
194 (uri (list (string-append home-page "files/doxygen-"
195 version ".src.tar.gz")
196 (string-append "mirror://sourceforge/doxygen/rel-"
197 version "/doxygen-" version
198 ".src.tar.gz")))
199 (sha256
200 (base32
201 "1lcif1qi20gf04qyjrx7x367669g17vz2ilgi4cmamp1whdsxbk7"))))
202 (build-system cmake-build-system)
203 (native-inputs
204 (list bison flex libxml2 ;provides xmllint for the tests
205 python)) ;for creating the documentation
206 (inputs
207 `(("bash" ,bash-minimal)))
208 (arguments
209 ;; Force cmake to use iconv header from cross-libc instead of the one
210 ;; from native libc.
211 `(,@(if (%current-target-system)
212 '(#:configure-flags
213 (list (string-append "-DICONV_INCLUDE_DIR="
214 (assoc-ref %build-inputs "cross-libc")
215 "/include")))
216 '())
217 #:test-target "tests"
218 #:phases (modify-phases %standard-phases
219 (add-after 'unpack 'disable-bibtex-test
220 (lambda _
221 ;; Disable test that requires bibtex to avoid a
222 ;; circular dependency.
223 (for-each delete-file-recursively
224 '("testing/012" "testing/012_cite.dox"))))
225 (add-before 'configure 'patch-sh
226 (lambda* (#:key inputs #:allow-other-keys)
227 (substitute* "src/portable.cpp"
228 (("/bin/sh")
229 (string-append
230 (assoc-ref inputs "bash") "/bin/sh")))
231 #t)))))
232 (synopsis "Generate documentation from annotated sources")
233 (description "Doxygen is the de facto standard tool for generating
234 documentation from annotated C++ sources, but it also supports other popular
235 programming languages such as C, Objective-C, C#, PHP, Java, Python,
236 IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl,
237 and to some extent D.")
238 (license gpl3+)))
239
240 (define-public doc++
241 (package
242 (name "doc++")
243 (version "3.4.10")
244 (source (origin
245 (method url-fetch)
246 (uri (string-append "https://sourceforge.net/projects/docpp/"
247 "files/doc++-" version ".tar.gz"))
248 (sha256
249 (base32
250 "0i37zlxl8g352s4hzpdx0657k5x3czh3xcsfr27irc708gb277pn"))
251 (patches (search-patches "doc++-include-directives.patch"
252 "doc++-segfault-fix.patch"))))
253 (build-system gnu-build-system)
254 (native-inputs
255 (list flex gettext-minimal))
256 (home-page "http://docpp.sourceforge.net/")
257 (synopsis "Documentation system for C, C++, IDL, and Java")
258 (description
259 "DOC++ is a documentation system for C, C++, IDL, and Java. It can
260 generate both TeX output for high-quality hardcopies or HTML output for online
261 browsing. The documentation is extracted directly from the C/C++/IDL source
262 or Java class files.")
263 (license gpl2+)))
264
265 (define-public python-docrepr
266 (package
267 (name "python-docrepr")
268 (version "0.2.0")
269 (source (origin
270 (method git-fetch)
271 (uri (git-reference
272 (url "https://github.com/spyder-ide/docrepr")
273 (commit (string-append "v" version))))
274 (file-name (git-file-name name version))
275 (sha256
276 (base32
277 "1ma5gwy93m1djd3zdlnqfrwhgr8ic1qbsz5kkrb9f987ax40lfkd"))))
278 (build-system python-build-system)
279 (arguments
280 (list
281 #:phases
282 #~(modify-phases %standard-phases
283 (add-after 'unpack 'patch-sources
284 (lambda _
285 ;; XXX: This fixes an issue where shutil.copytree would fail
286 ;; merging directories with same files copied by Sphinx from the
287 ;; store (hence read-only, throwing a Permission denied error).
288 ;; In the case this happens, it falls back to a manual copy
289 ;; routine that omits overwriting same-named files (see:
290 ;; https://github.com/spyder-ide/docrepr/issues/54).
291 (substitute* "docrepr/utils.py"
292 (("except TypeError")
293 "except (TypeError, shutil.Error)"))))
294 (replace 'check
295 (lambda* (#:key tests? #:allow-other-keys)
296 (when tests?
297 (invoke "pytest" "-p" "no:warnings" "-vv")))))))
298 (native-inputs
299 (list python-ipython
300 python-matplotlib
301 python-numpy
302 python-pytest
303 python-pytest-asyncio))
304 (propagated-inputs
305 (list python-docutils
306 python-jinja2
307 python-matplotlib
308 python-sphinx))
309 (home-page "https://github.com/spyder-ide/docrepr/")
310 (synopsis "Python docstrings to HTML renderer")
311 (description "Docrepr renders Python docstrings to HTML with Sphinx. It
312 can generate rich and plain representations of docstrings, alongside
313 additional metadata about the object to which the docstring belongs.")
314 (license bsd-3)))
315
316 (define-public scrollkeeper
317 (package
318 (name "scrollkeeper")
319 (version "0.3.14")
320 (source
321 (origin
322 (method url-fetch)
323 (uri (string-append "mirror://sourceforge/scrollkeeper/scrollkeeper/"
324 version "/scrollkeeper-" version ".tar.gz"))
325 (sha256
326 (base32 "1bfxwxc1ngh11v36z899sz9qam366r050fhkyb5adv65lb1x62sa"))))
327 (build-system gnu-build-system)
328 (arguments
329 `(#:configure-flags
330 (list (string-append "--with-xml-catalog="
331 (assoc-ref %build-inputs "docbook-xml")
332 "/xml/dtd/docbook/catalog.xml"))))
333 (inputs
334 (list perl libxml2 libxslt
335 ;; The configure script checks for either version 4.2 or 4.1.2.
336 docbook-xml-4.2))
337 (native-inputs
338 (list intltool))
339 (home-page "http://scrollkeeper.sourceforge.net/")
340 (synopsis "Open Documentation Cataloging Project")
341 (description
342 "ScrollKeeper is a cataloging system for documentation. It manages
343 documentation metadata as specified by the Open Source Metadata Framework and
344 provides a simple API to allow help browsers to find, sort, and search the
345 document catalog. It will also be able to communicate with catalog servers on
346 the Net to search for documents which are not on the local system.")
347 (license lgpl2.1+)))
348
349 (define-public zeal
350 (let ((commit "d3c5521c501d24050f578348ff1b9d68244b992c")
351 (revision "1"))
352 (package
353 (name "zeal")
354 (version (git-version "0.6.1" revision commit))
355 (source
356 (origin
357 (method git-fetch)
358 (uri (git-reference
359 (url "https://github.com/zealdocs/zeal")
360 (commit commit)))
361 (file-name (git-file-name name version))
362 (sha256
363 (base32 "1ky2qi2cmjckc51lm3i28815ixgqdm36j7smixxr16jxpmbqs6sl"))))
364 (build-system qt-build-system)
365 (arguments
366 `(#:tests? #f ;no tests
367 #:phases
368 (modify-phases %standard-phases
369 (add-after 'wrap 'wrap-qt-process-path
370 (lambda* (#:key inputs outputs #:allow-other-keys)
371 (let* ((out (assoc-ref outputs "out"))
372 (bin (string-append out "/bin/zeal"))
373 (qt-process-path (string-append
374 (assoc-ref inputs "qtwebengine-5")
375 "/lib/qt5/libexec/QtWebEngineProcess")))
376 (wrap-program bin
377 `("QTWEBENGINEPROCESS_PATH" = (,qt-process-path)))
378 #t))))))
379 (native-inputs
380 (list extra-cmake-modules pkg-config))
381 (inputs
382 `(("libarchive" ,libarchive)
383 ("sqlite" ,sqlite)
384 ("qtbase" ,qtbase-5)
385 ("qtdeclarative-5" ,qtdeclarative-5)
386 ("qtwebchannel-5" ,qtwebchannel-5)
387 ("qtwebengine-5" ,qtwebengine-5)
388 ("qtquickcontrols-5" ,qtquickcontrols-5)
389 ("qtx11extras" ,qtx11extras)
390 ("xcb-util-keyms" ,xcb-util-keysyms)))
391 (home-page "https://zealdocs.org/")
392 (synopsis "Offline documentation browser inspired by Dash")
393 (description "Zeal is a simple offline documentation browser
394 inspired by Dash.")
395 (license gpl3+))))