Merge branch 'master' into staging
[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 ;;;
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 documentation)
27 #:use-module (guix licenses)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system cmake)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages bash)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages bison)
37 #:use-module (gnu packages docbook)
38 #:use-module (gnu packages flex)
39 #:use-module (gnu packages graphviz)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages glib)
42 #:use-module (gnu packages perl)
43 #:use-module (gnu packages xml))
44
45 (define-public asciidoc
46 (package
47 (name "asciidoc")
48 (version "8.6.10")
49 (source (origin
50 (method url-fetch)
51 (uri (string-append "https://github.com/asciidoc/asciidoc/"
52 "archive/" version ".tar.gz"))
53 (file-name (string-append name "-" version ".tar.gz"))
54 (sha256
55 (base32
56 "10xrl1iwyvs8aqm0vzkvs3dnsn93wyk942kk4ppyl6w9imbzhlly"))))
57 (build-system gnu-build-system)
58 (arguments
59 `(#:tests? #f ; no 'check' target
60 #:phases
61 (modify-phases %standard-phases
62 (replace 'bootstrap
63 (lambda _
64 (invoke "autoconf")))
65 ;; Some XML-related binaries are required for asciidoc's proper usage.
66 ;; Without these, asciidoc fails when parsing XML documents, either
67 ;; reporting a missing "xmllint" binary or, when passed the
68 ;; "--no-xmllint" option, a missing "xsltproc" binary.
69 ;; The following phase enables asciidoc to find some of them.
70 (add-before 'configure 'set-xml-binary-paths
71 (lambda* (#:key inputs #:allow-other-keys)
72 (let* ((libxml2 (assoc-ref inputs "libxml2"))
73 (xmllint (string-append libxml2 "/bin/xmllint"))
74 (libxslt (assoc-ref inputs "libxslt"))
75 (xsltproc (string-append libxslt "/bin/xsltproc")))
76 (substitute* "a2x.py"
77 (("XMLLINT = 'xmllint'")
78 (string-append "XMLLINT = '" xmllint "'"))
79 (("XSLTPROC = 'xsltproc'")
80 (string-append "XSLTPROC = '" xsltproc "'")))
81 #t)))
82 ;; Make asciidoc use the local docbook-xsl package instead of fetching
83 ;; it from the internet at run-time.
84 (add-before 'install 'make-local-docbook-xsl
85 (lambda* (#:key inputs #:allow-other-keys)
86 (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
87 (("xsl:import href=\"http://docbook.sourceforge.net/\
88 release/xsl/current")
89 (string-append
90 "xsl:import href=\""
91 (string-append (assoc-ref inputs "docbook-xsl")
92 "/xml/xsl/docbook-xsl-"
93 ,(package-version docbook-xsl)))))
94 #t))
95 ;; Do the same for docbook-xml.
96 (add-before 'install 'make-local-docbook-xml
97 (lambda* (#:key inputs #:allow-other-keys)
98 (substitute* "docbook45.conf"
99 (("http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd")
100 (string-append (assoc-ref inputs "docbook-xml")
101 "/xml/dtd/docbook/docbookx.dtd")))
102 #t)))))
103 (native-inputs
104 `(("autoconf" ,autoconf)))
105 (inputs `(("python" ,python-2)
106 ("docbook-xml" ,docbook-xml)
107 ("docbook-xsl" ,docbook-xsl)
108 ("libxml2" ,libxml2)
109 ("libxslt" ,libxslt)))
110 (home-page "http://asciidoc.org/")
111 (synopsis "Text-based document generation system")
112 (description
113 "AsciiDoc is a text document format for writing notes, documentation,
114 articles, books, ebooks, slideshows, web pages, man pages and blogs.
115 AsciiDoc files can be translated to many formats including HTML, PDF,
116 EPUB, man page.
117
118 AsciiDoc is highly configurable: both the AsciiDoc source file syntax and
119 the backend output markups (which can be almost any type of SGML/XML
120 markup) can be customized and extended by the user.")
121 (license gpl2+)))
122
123 (define-public doxygen
124 (package
125 (name "doxygen")
126 (version "1.8.15")
127 (home-page "http://www.doxygen.nl/")
128 (source (origin
129 (method url-fetch)
130 (uri (list (string-append home-page "files/doxygen-"
131 version ".src.tar.gz")
132 (string-append "mirror://sourceforge/doxygen/rel-"
133 version "/doxygen-" version
134 ".src.tar.gz")))
135 (sha256
136 (base32
137 "0p94b4yb6bk2dxzs5kyl82xxgq2qakgbx5yy3ssbbadncb20x75x"))
138 (patches (search-patches "doxygen-test.patch"))))
139 (build-system cmake-build-system)
140 (native-inputs
141 `(("bison" ,bison)
142 ("flex" ,flex-2.6.1) ; sefaults with 2.6.4
143 ("libxml2" ,libxml2) ; provides xmllint for the tests
144 ("python" ,python-2))) ; for creating the documentation
145 (inputs
146 `(("bash" ,bash-minimal)))
147 (arguments
148 `(#:test-target "tests"
149 #:phases (modify-phases %standard-phases
150 (add-before 'configure 'patch-sh
151 (lambda* (#:key inputs #:allow-other-keys)
152 (substitute* "src/portable.cpp"
153 (("/bin/sh")
154 (string-append
155 (assoc-ref inputs "bash") "/bin/sh")))
156 #t)))))
157 (synopsis "Generate documentation from annotated sources")
158 (description "Doxygen is the de facto standard tool for generating
159 documentation from annotated C++ sources, but it also supports other popular
160 programming languages such as C, Objective-C, C#, PHP, Java, Python,
161 IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl,
162 and to some extent D.")
163 (license gpl3+)))
164
165 (define-public doc++
166 (package
167 (name "doc++")
168 (version "3.4.10")
169 (source (origin
170 (method url-fetch)
171 (uri (string-append "https://sourceforge.net/projects/docpp/"
172 "files/doc++-" version ".tar.gz"))
173 (sha256
174 (base32
175 "0i37zlxl8g352s4hzpdx0657k5x3czh3xcsfr27irc708gb277pn"))
176 (patches (search-patches "doc++-include-directives.patch"
177 "doc++-segfault-fix.patch"))))
178 (build-system gnu-build-system)
179 (native-inputs
180 `(("flex" ,flex)
181 ("gettext" ,gettext-minimal)))
182 (home-page "http://docpp.sourceforge.net/")
183 (synopsis "Documentation system for C, C++, IDL, and Java")
184 (description
185 "DOC++ is a documentation system for C, C++, IDL, and Java. It can
186 generate both TeX output for high-quality hardcopies or HTML output for online
187 brwosing. The documentation is extracted directly from the C/C++/IDL source
188 or Java class files.")
189 (license gpl2+)))
190
191 (define-public scrollkeeper
192 (package
193 (name "scrollkeeper")
194 (version "0.3.14")
195 (source
196 (origin
197 (method url-fetch)
198 (uri (string-append "mirror://sourceforge/scrollkeeper/scrollkeeper/"
199 version "/scrollkeeper-" version ".tar.gz"))
200 (sha256
201 (base32 "1bfxwxc1ngh11v36z899sz9qam366r050fhkyb5adv65lb1x62sa"))))
202 (build-system gnu-build-system)
203 (arguments
204 `(#:configure-flags
205 (list (string-append "--with-xml-catalog="
206 (assoc-ref %build-inputs "docbook-xml")
207 "/xml/dtd/docbook/catalog.xml"))))
208 (inputs
209 `(("perl" ,perl)
210 ("libxml2" ,libxml2)
211 ("libxslt" ,libxslt)
212 ;; The configure script checks for either version 4.2 or 4.1.2.
213 ("docbook-xml" ,docbook-xml-4.2)))
214 (native-inputs
215 `(("intltool" ,intltool)))
216 (home-page "http://scrollkeeper.sourceforge.net/")
217 (synopsis "Open Documentation Cataloging Project")
218 (description "ScrollKeeper is a cataloging system for documentation on open
219 systems. It manages documentation metadata as specified by the Open Source
220 Metadata Framework and provides a simple API to allow help browsers to find,
221 sort, and search the document catalog. It will also be able to communicate
222 with catalog servers on the Net to search for documents which are not on the
223 local system.")
224 (license lgpl2.1+)))