documentation.scm 14 KB

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