texinfo.scm 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
  4. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu packages texinfo)
  21. #:use-module (guix licenses)
  22. #:use-module (guix packages)
  23. #:use-module (guix download)
  24. #:use-module (guix build-system gnu)
  25. #:use-module (gnu packages)
  26. #:use-module (gnu packages compression)
  27. #:use-module (gnu packages perl)
  28. #:use-module (gnu packages linux)
  29. #:use-module (gnu packages ncurses))
  30. (define-public texinfo
  31. ;; TODO: Merge with 'texinfo-latest' on the next core-updates.
  32. (package
  33. (name "texinfo")
  34. (version "6.3")
  35. (source (origin
  36. (method url-fetch)
  37. (uri (string-append "mirror://gnu/texinfo/texinfo-"
  38. version ".tar.xz"))
  39. (sha256
  40. (base32
  41. "0fpr9kdjjl6nj2pc50k2zr7134hvqz8bi8pfqa7131a9lpzz6v14"))))
  42. (build-system gnu-build-system)
  43. (native-inputs `(("procps" ,procps))) ;one of the tests needs pgrep
  44. (inputs `(("ncurses" ,ncurses)
  45. ("perl" ,perl)))
  46. (native-search-paths
  47. ;; This is the variable used by the standalone Info reader.
  48. (list (search-path-specification
  49. (variable "INFOPATH")
  50. (files '("share/info")))))
  51. (home-page "https://www.gnu.org/software/texinfo/")
  52. (synopsis "The GNU documentation format")
  53. (description
  54. "Texinfo is the official documentation format of the GNU project. It
  55. uses a single source file using explicit commands to produce a final document
  56. in any of several supported output formats, such as HTML or PDF. This
  57. package includes both the tools necessary to produce Info documents from
  58. their source and the command-line Info reader. The emphasis of the language
  59. is on expressing the content semantically, avoiding physical markup commands.")
  60. (license gpl3+)))
  61. (define-public texinfo-latest
  62. ;; TODO: Turn this into 'texinfo' on the next core-updates cycle.
  63. (package (inherit texinfo)
  64. (version "6.5")
  65. (source (origin
  66. (method url-fetch)
  67. (uri (string-append "mirror://gnu/texinfo/texinfo-"
  68. version ".tar.xz"))
  69. (sha256
  70. (base32
  71. "0qjzvbvnv9003xdrcpi3jp7y68j4hq2ciw9frh2hghh698zlnxvp"))))
  72. (native-inputs '())))
  73. (define-public texinfo-5
  74. (package (inherit texinfo)
  75. (version "5.2")
  76. (source (origin
  77. (method url-fetch)
  78. (uri (string-append "mirror://gnu/texinfo/texinfo-"
  79. version ".tar.xz"))
  80. (sha256
  81. (base32
  82. "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))
  83. (native-inputs '())))
  84. (define-public texinfo-4
  85. (package (inherit texinfo)
  86. (version "4.13a")
  87. (source (origin
  88. (method url-fetch)
  89. (uri (string-append
  90. "mirror://gnu/texinfo/texinfo-"
  91. version
  92. ".tar.lzma"))
  93. (sha256
  94. (base32
  95. "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
  96. (native-inputs '())
  97. (inputs `(("ncurses" ,ncurses) ("xz" ,xz)))))
  98. (define-public info-reader
  99. ;; The idea of this package is to have the standalone Info reader without
  100. ;; the dependency on Perl that 'makeinfo' drags.
  101. (package
  102. (inherit texinfo)
  103. (name "info-reader")
  104. (arguments
  105. `(#:disallowed-references ,(assoc-ref (package-inputs texinfo)
  106. "perl")
  107. #:modules ((ice-9 ftw) (srfi srfi-1)
  108. ,@%gnu-build-system-modules)
  109. #:phases (modify-phases %standard-phases
  110. (add-after 'install 'keep-only-info-reader
  111. (lambda* (#:key outputs #:allow-other-keys)
  112. ;; Remove everything but 'bin/info' and associated
  113. ;; files.
  114. (define (files)
  115. (scandir "." (lambda (file)
  116. (not (member file '("." ".."))))))
  117. (let ((out (assoc-ref outputs "out")))
  118. (with-directory-excursion out
  119. (for-each delete-file-recursively
  120. (fold delete (files) '("bin" "share"))))
  121. (with-directory-excursion (string-append out "/bin")
  122. (for-each delete-file (delete "info" (files))))
  123. (with-directory-excursion (string-append out "/share")
  124. (for-each delete-file-recursively
  125. (fold delete (files)
  126. '("info" "locale"))))
  127. #t))))))
  128. (synopsis "Standalone Info documentation reader")))
  129. (define-public texi2html
  130. (package
  131. (name "texi2html")
  132. (version "5.0")
  133. (source (origin
  134. (method url-fetch)
  135. (uri (string-append "mirror://savannah/" name "/" name "-"
  136. version ".tar.bz2"))
  137. (sha256
  138. (base32
  139. "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8"))
  140. (patches
  141. (search-patches "texi2html-document-encoding.patch"
  142. "texi2html-i18n.patch"))
  143. (snippet
  144. ;; This file is modified by the patch above, but reset its
  145. ;; timestamp so we don't trigger the rule to update PO files,
  146. ;; which would require Gettext.
  147. ;; See <http://bugs.gnu.org/18247>.
  148. '(utime "texi2html.pl" 0 0 0 0))))
  149. (build-system gnu-build-system)
  150. (inputs `(("perl" ,perl)))
  151. (arguments
  152. ;; Tests fail because of warnings on stderr from Perl 5.22. Adjusting
  153. ;; texi2html.pl to avoid the warnings seems non-trivial, so we simply
  154. ;; disable the tests.
  155. '(#:tests? #f))
  156. (home-page "http://www.nongnu.org/texi2html/")
  157. (synopsis "Convert Texinfo to HTML")
  158. (description
  159. "Texi2HTML is a Perl script which converts Texinfo source files to HTML
  160. output. It now supports many advanced features, such as internationalization
  161. and extremely configurable output formats.
  162. Development of Texi2HTML moved to the GNU Texinfo repository in 2010, since it
  163. was meant to replace the makeinfo implementation in GNU Texinfo. The route
  164. forward for authors is, in most cases, to alter manuals and build processes as
  165. necessary to use the new features of the makeinfo/texi2any implementation of
  166. GNU Texinfo. The Texi2HTML maintainers (one of whom is the principal author
  167. of the GNU Texinfo implementation) do not intend to make further releases of
  168. Texi2HTML.")
  169. ;; Files in /lib under lgpl2.1+ and x11
  170. (license gpl2+)))