gnu: asciidoc: Use local docbook-xml package.
[jackhill/guix/guix.git] / gnu / packages / documentation.scm
CommitLineData
436d4d1f 1;;; GNU Guix --- Functional package management for GNU
0573a923 2;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
7c853c02 3;;; Copyright © 2014, 2016 Andreas Enge <andreas@enge.fr>
b4e655e5 4;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
fa8af53e 5;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
9099a457 6;;; Copyright © 2017 Kei Kebreau <kei@openmailbox.org>
436d4d1f
AE
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
0573a923
EB
23(define-module (gnu packages documentation)
24 #:use-module (guix licenses)
436d4d1f
AE
25 #:use-module (guix packages)
26 #:use-module (guix download)
0573a923 27 #:use-module (guix build-system gnu)
7c853c02 28 #:use-module (guix build-system cmake)
436d4d1f 29 #:use-module (gnu packages)
0573a923 30 #:use-module (gnu packages python)
436d4d1f 31 #:use-module (gnu packages bison)
fa8af53e 32 #:use-module (gnu packages docbook)
436d4d1f 33 #:use-module (gnu packages flex)
9e57c1b5 34 #:use-module (gnu packages graphviz)
b4e655e5 35 #:use-module (gnu packages gettext)
fa8af53e 36 #:use-module (gnu packages glib)
436d4d1f
AE
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages xml)
0573a923
EB
39 #:autoload (gnu packages zip) (unzip))
40
41(define-public asciidoc
42 (package
43 (name "asciidoc")
44 (version "8.6.9")
45 (source (origin
46 (method url-fetch)
de67e922
LF
47 (uri (string-append "mirror://sourceforge/asciidoc/asciidoc/"
48 version "/asciidoc-" version ".tar.gz"))
0573a923
EB
49 (sha256
50 (base32
51 "1w71nk527lq504njmaf0vzr93pgahkgzzxzglrq6bay8cw2rvnvq"))))
52 (build-system gnu-build-system)
dd10ba63
53 (arguments
54 `(#:tests? #f ; no 'check' target
55 #:phases
56 (modify-phases %standard-phases
9099a457
KK
57 ;; Some XML-related binaries are required for asciidoc's proper usage.
58 ;; Without these, asciidoc fails when parsing XML documents, either
59 ;; reporting a missing "xmllint" binary or, when passed the
60 ;; "--no-xmllint" option, a missing "xsltproc" binary.
61 ;; The following phase enables asciidoc to find some of them.
62 (add-before 'configure 'set-xml-binary-paths
63 (lambda* (#:key inputs #:allow-other-keys)
64 (let* ((libxml2 (assoc-ref inputs "libxml2"))
65 (xmllint (string-append libxml2 "/bin/xmllint"))
66 (libxslt (assoc-ref inputs "libxslt"))
67 (xsltproc (string-append libxslt "/bin/xsltproc")))
68 (substitute* "a2x.py"
69 (("XMLLINT = 'xmllint'")
70 (string-append "XMLLINT = '" xmllint "'"))
71 (("XSLTPROC = 'xsltproc'")
72 (string-append "XSLTPROC = '" xsltproc "'")))
73 #t)))
dd10ba63
74 ;; Make asciidoc use the local docbook-xsl package instead of fetching
75 ;; it from the internet at run-time.
76 (add-before 'install 'make-local-docbook-xsl
77 (lambda* (#:key inputs #:allow-other-keys)
78 (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
79 (("xsl:import href=\"http://docbook.sourceforge.net/\
80release/xsl/current")
81 (string-append
82 "xsl:import href=\""
83 (string-append (assoc-ref inputs "docbook-xsl")
84 "/xml/xsl/docbook-xsl-"
85 ,(package-version docbook-xsl)))))
3078821d
KK
86 #t))
87 ;; Do the same for docbook-xml.
88 (add-before 'install 'make-local-docbook-xml
89 (lambda* (#:key inputs #:allow-other-keys)
90 (substitute* "docbook45.conf"
91 (("http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd")
92 (string-append (assoc-ref inputs "docbook-xml")
93 "/xml/dtd/docbook/docbookx.dtd")))
dd10ba63
94 #t)))))
95 (inputs `(("python" ,python-2)
3078821d 96 ("docbook-xml" ,docbook-xml)
9099a457
KK
97 ("docbook-xsl" ,docbook-xsl)
98 ("libxml2" ,libxml2)
99 ("libxslt" ,libxslt)))
0573a923
EB
100 (home-page "http://www.methods.co.nz/asciidoc/")
101 (synopsis "Text-based document generation system")
102 (description
103 "AsciiDoc is a text document format for writing notes, documentation,
104articles, books, ebooks, slideshows, web pages, man pages and blogs.
105AsciiDoc files can be translated to many formats including HTML, PDF,
106EPUB, man page.
107
108AsciiDoc is highly configurable: both the AsciiDoc source file syntax and
109the backend output markups (which can be almost any type of SGML/XML
110markup) can be customized and extended by the user.")
111 (license gpl2+)))
436d4d1f
AE
112
113(define-public doxygen
114 (package
115 (name "doxygen")
7c853c02 116 (version "1.8.11")
436d4d1f
AE
117 (source (origin
118 (method url-fetch)
119 (uri (string-append "http://ftp.stack.nl/pub/users/dimitri/"
120 name "-" version ".src.tar.gz"))
121 (sha256
122 (base32
7c853c02 123 "0ja02pm3fpfhc5dkry00kq8mn141cqvdqqpmms373ncbwi38pl35"))
fc1adab1 124 (patches (search-patches "doxygen-test.patch"))))
7c853c02 125 (build-system cmake-build-system)
436d4d1f
AE
126 (native-inputs
127 `(("bison" ,bison)
128 ("flex" ,flex)
129 ("libxml2" ,libxml2) ; provides xmllint for the tests
436d4d1f
AE
130 ("python" ,python-2))) ; for creating the documentation
131 (arguments
7c853c02 132 `(#:test-target "tests"))
436d4d1f 133 (home-page "http://www.stack.nl/~dimitri/doxygen/")
35b9e423 134 (synopsis "Generate documentation from annotated sources")
436d4d1f
AE
135 (description "Doxygen is the de facto standard tool for generating
136documentation from annotated C++ sources, but it also supports other popular
137programming languages such as C, Objective-C, C#, PHP, Java, Python,
138IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl,
139and to some extent D.")
140 (license gpl3+)))
b4e655e5
EB
141
142(define-public doc++
143 (package
144 (name "doc++")
145 (version "3.4.10")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append "https://sourceforge.net/projects/docpp/"
149 "files/doc++-" version ".tar.gz"))
150 (sha256
151 (base32
152 "0i37zlxl8g352s4hzpdx0657k5x3czh3xcsfr27irc708gb277pn"))
153 (patches (search-patches "doc++-include-directives.patch"
154 "doc++-segfault-fix.patch"))))
155 (build-system gnu-build-system)
156 (native-inputs
157 `(("flex" ,flex)
b94a6ca0 158 ("gettext" ,gettext-minimal)))
b4e655e5
EB
159 (home-page "http://docpp.sourceforge.net/")
160 (synopsis "Documentation system for C, C++, IDL, and Java")
161 (description
162 "DOC++ is a documentation system for C, C++, IDL, and Java. It can
163generate both TeX output for high-quality hardcopies or HTML output for online
164brwosing. The documentation is extracted directly from the C/C++/IDL source
165or Java class files.")
166 (license gpl2+)))
fa8af53e
RJ
167
168(define-public scrollkeeper
169 (package
170 (name "scrollkeeper")
171 (version "0.3.14")
172 (source
173 (origin
174 (method url-fetch)
de67e922
LF
175 (uri (string-append "mirror://sourceforge/scrollkeeper/scrollkeeper/"
176 version "/scrollkeeper-" version ".tar.gz"))
fa8af53e
RJ
177 (sha256
178 (base32 "1bfxwxc1ngh11v36z899sz9qam366r050fhkyb5adv65lb1x62sa"))))
179 (build-system gnu-build-system)
180 (arguments
181 `(#:configure-flags
182 (list (string-append "--with-xml-catalog="
183 (assoc-ref %build-inputs "docbook-xml")
184 "/xml/dtd/docbook/catalog.xml"))))
185 (inputs
186 `(("perl" ,perl)
187 ("libxml2" ,libxml2)
188 ("libxslt" ,libxslt)
189 ;; The configure script checks for either version 4.2 or 4.1.2.
190 ("docbook-xml" ,docbook-xml-4.2)))
191 (native-inputs
192 `(("intltool" ,intltool)))
193 (home-page "http://scrollkeeper.sourceforge.net/")
194 (synopsis "Open Documentation Cataloging Project")
195 (description "ScrollKeeper is a cataloging system for documentation on open
196systems. It manages documentation metadata as specified by the Open Source
197Metadata Framework and provides a simple API to allow help browsers to find,
198sort, and search the document catalog. It will also be able to communicate
199with catalog servers on the Net to search for documents which are not on the
200local system.")
201 (license lgpl2.1+)))