texinfo.scm 7.1 KB

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