texinfo.scm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2015, 2016, 2017, 2019 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, 2019 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
  7. ;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
  8. ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
  9. ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  10. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  11. ;;;
  12. ;;; This file is part of GNU Guix.
  13. ;;;
  14. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  15. ;;; under the terms of the GNU General Public License as published by
  16. ;;; the Free Software Foundation; either version 3 of the License, or (at
  17. ;;; your option) any later version.
  18. ;;;
  19. ;;; GNU Guix is distributed in the hope that it will be useful, but
  20. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. ;;; GNU General Public License for more details.
  23. ;;;
  24. ;;; You should have received a copy of the GNU General Public License
  25. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  26. (define-module (gnu packages texinfo)
  27. #:use-module (gnu packages autotools)
  28. #:use-module (guix licenses)
  29. #:use-module (guix packages)
  30. #:use-module (guix utils)
  31. #:use-module (guix download)
  32. #:use-module (guix utils)
  33. #:use-module (guix git-download)
  34. #:use-module (guix build-system gnu)
  35. #:use-module (gnu packages)
  36. #:use-module (gnu packages autotools)
  37. #:use-module (gnu packages compression)
  38. #:use-module (gnu packages gettext)
  39. #:use-module (gnu packages ncurses)
  40. #:use-module (gnu packages perl)
  41. #:use-module (gnu packages readline))
  42. (define-public texinfo
  43. (package
  44. (name "texinfo")
  45. (version "6.7")
  46. (source (origin
  47. (method url-fetch)
  48. (uri (string-append "mirror://gnu/texinfo/texinfo-"
  49. version ".tar.xz"))
  50. (sha256
  51. (base32
  52. "1aicn1v3czqii08wc91jw089n1x3gfchkf808q2as59dak0h714q"))))
  53. (build-system gnu-build-system)
  54. (arguments
  55. ;; When cross-compiling, the package is configured twice: once with the
  56. ;; native compiler and once with the cross-compiler. During the configure
  57. ;; with the native compiler, the environment is reset. This leads to
  58. ;; multiple environment variables missing. Do not reset the environment
  59. ;; to prevent that.
  60. `(#:phases
  61. (if ,(%current-target-system)
  62. (modify-phases %standard-phases
  63. (add-before 'configure 'fix-cross-configure
  64. (lambda _
  65. (substitute* "configure"
  66. (("env -i")
  67. "env "))
  68. #t)))
  69. %standard-phases)))
  70. (inputs `(("ncurses" ,ncurses)
  71. ("perl" ,perl)))
  72. ;; When cross-compiling, texinfo will build some of its own binaries with
  73. ;; the native compiler. This means ncurses is needed both in both inputs
  74. ;; and native-inputs.
  75. (native-inputs `(("perl" ,perl)
  76. ("ncurses" ,ncurses)))
  77. (native-search-paths
  78. ;; This is the variable used by the standalone Info reader.
  79. (list (search-path-specification
  80. (variable "INFOPATH")
  81. (files '("share/info")))))
  82. (home-page "https://www.gnu.org/software/texinfo/")
  83. (synopsis "The GNU documentation format")
  84. (description
  85. "Texinfo is the official documentation format of the GNU project. It
  86. uses a single source file using explicit commands to produce a final document
  87. in any of several supported output formats, such as HTML or PDF. This
  88. package includes both the tools necessary to produce Info documents from
  89. their source and the command-line Info reader. The emphasis of the language
  90. is on expressing the content semantically, avoiding physical markup commands.")
  91. (license gpl3+)))
  92. (define-public texinfo-5
  93. (package (inherit texinfo)
  94. (version "5.2")
  95. (source (origin
  96. (method url-fetch)
  97. (uri (string-append "mirror://gnu/texinfo/texinfo-"
  98. version ".tar.xz"))
  99. (patches (search-patches "texinfo-5-perl-compat.patch"))
  100. (sha256
  101. (base32
  102. "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))))
  103. (define-public texinfo-4
  104. (package (inherit texinfo)
  105. (version "4.13a")
  106. (source (origin
  107. (method url-fetch)
  108. (uri (string-append
  109. "mirror://gnu/texinfo/texinfo-"
  110. version
  111. ".tar.lzma"))
  112. (sha256
  113. (base32
  114. "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
  115. (inputs `(("ncurses" ,ncurses)
  116. ("xz" ,xz)))
  117. (native-inputs
  118. `(("automake" ,automake)
  119. ,@(package-native-inputs texinfo)))
  120. (arguments
  121. (substitute-keyword-arguments (package-arguments texinfo)
  122. ((#:phases phases)
  123. `(modify-phases ,phases
  124. (add-after 'unpack 'fix-configure
  125. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  126. ;; Replace outdated config.sub and config.guess.
  127. (with-directory-excursion "build-aux"
  128. (for-each
  129. (lambda (file)
  130. (install-file (string-append
  131. (assoc-ref
  132. (or native-inputs inputs) "automake")
  133. "/share/automake-"
  134. ,(version-major+minor
  135. (package-version automake))
  136. "/" file) "."))
  137. '("config.sub" "config.guess")))
  138. #t))
  139. ;; Build native version of tools before running 'build phase.
  140. ,@(if (%current-target-system)
  141. `((add-before 'build 'make-native-gnu-lib
  142. (lambda* (#:key inputs #:allow-other-keys)
  143. (invoke "make" "-C" "tools/gnulib/lib")
  144. #t)))
  145. '())))))))
  146. (define-public info-reader
  147. ;; The idea of this package is to have the standalone Info reader without
  148. ;; the dependency on Perl that 'makeinfo' drags.
  149. (package/inherit texinfo
  150. (name "info-reader")
  151. (arguments
  152. `(,@(substitute-keyword-arguments (package-arguments texinfo)
  153. ((#:phases phases)
  154. `(modify-phases ,phases
  155. (add-after 'install 'keep-only-info-reader
  156. (lambda* (#:key outputs #:allow-other-keys)
  157. ;; Remove everything but 'bin/info' and associated
  158. ;; files.
  159. (define (files)
  160. (scandir "." (lambda (file)
  161. (not (member file '("." ".."))))))
  162. (let ((out (assoc-ref outputs "out")))
  163. (with-directory-excursion out
  164. (for-each delete-file-recursively
  165. (fold delete (files) '("bin" "share"))))
  166. (with-directory-excursion (string-append out "/bin")
  167. (for-each delete-file (delete "info" (files))))
  168. (with-directory-excursion (string-append out "/share")
  169. (for-each delete-file-recursively
  170. (fold delete (files)
  171. '("info" "locale"))))
  172. #t))))))
  173. #:disallowed-references ,(assoc-ref (package-inputs texinfo)
  174. "perl")
  175. #:modules ((ice-9 ftw) (srfi srfi-1)
  176. ,@%gnu-build-system-modules)))
  177. (synopsis "Standalone Info documentation reader")))
  178. (define-public texi2html
  179. (package
  180. (name "texi2html")
  181. (version "5.0")
  182. (source (origin
  183. (method url-fetch)
  184. (uri (string-append "mirror://savannah/" name "/" name "-"
  185. version ".tar.bz2"))
  186. (sha256
  187. (base32
  188. "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8"))
  189. (patches
  190. (search-patches "texi2html-document-encoding.patch"
  191. "texi2html-i18n.patch"))
  192. (snippet
  193. ;; This file is modified by the patch above, but reset its
  194. ;; timestamp so we don't trigger the rule to update PO files,
  195. ;; which would require Gettext.
  196. ;; See <http://bugs.gnu.org/18247>.
  197. '(begin
  198. (utime "texi2html.pl" 0 0 0 0)
  199. #t))))
  200. (build-system gnu-build-system)
  201. (inputs `(("perl" ,perl)))
  202. (arguments
  203. ;; Tests fail because of warnings on stderr from Perl 5.22. Adjusting
  204. ;; texi2html.pl to avoid the warnings seems non-trivial, so we simply
  205. ;; disable the tests.
  206. '(#:tests? #f))
  207. (home-page "https://www.nongnu.org/texi2html/")
  208. (synopsis "Convert Texinfo to HTML")
  209. (description
  210. "Texi2HTML is a Perl script which converts Texinfo source files to HTML
  211. output. It now supports many advanced features, such as internationalization
  212. and extremely configurable output formats.
  213. Development of Texi2HTML moved to the GNU Texinfo repository in 2010, since it
  214. was meant to replace the makeinfo implementation in GNU Texinfo. The route
  215. forward for authors is, in most cases, to alter manuals and build processes as
  216. necessary to use the new features of the makeinfo/texi2any implementation of
  217. GNU Texinfo. The Texi2HTML maintainers (one of whom is the principal author
  218. of the GNU Texinfo implementation) do not intend to make further releases of
  219. Texi2HTML.")
  220. ;; Files in /lib under lgpl2.1+ and x11
  221. (license gpl2+)))
  222. (define-public texi2html-1.82
  223. (package
  224. (inherit texi2html)
  225. (version "1.82")
  226. (source
  227. (origin
  228. (method url-fetch)
  229. (uri (string-append "mirror://savannah/texi2html/"
  230. "texi2html-" version ".tar.bz2"))
  231. (sha256
  232. (base32 "1wdli2szkgm3l0vx8rf6lylw0b0m47dlz9iy004n928nqkzix76n"))))))
  233. (define-public pinfo
  234. (package
  235. (name "pinfo")
  236. (version "0.6.13")
  237. (source (origin
  238. (method git-fetch)
  239. (uri (git-reference
  240. (url "https://github.com/baszoetekouw/pinfo")
  241. (commit (string-append "v" version))))
  242. (file-name (git-file-name name version))
  243. (sha256
  244. (base32
  245. "173d2p22irwiabvr4z6qvr6zpr6ysfkhmadjlyhyiwd7z62larvy"))))
  246. (build-system gnu-build-system)
  247. (arguments
  248. `(#:phases
  249. (modify-phases %standard-phases
  250. (add-after 'unpack 'remove-Werror
  251. (lambda _
  252. (substitute* "configure.ac"
  253. (("-Werror") ""))
  254. #t))
  255. (add-after 'unpack 'embed-reference-to-clear
  256. (lambda* (#:key inputs #:allow-other-keys)
  257. (substitute* '("src/manual.c"
  258. "src/mainfunction.c"
  259. "src/utils.c")
  260. (("\"clear\"")
  261. (string-append "\"" (which "clear") "\"")))
  262. #t)))))
  263. (inputs
  264. `(("ncurses" ,ncurses)
  265. ("readline" ,readline)))
  266. (native-inputs
  267. `(("autoconf" ,autoconf)
  268. ("automake" ,automake)
  269. ("gettext" ,gettext-minimal)
  270. ("libtool" ,libtool)
  271. ("texinfo" ,texinfo)))
  272. (home-page "https://github.com/baszoetekouw/pinfo")
  273. (synopsis "Lynx-style Info file and man page reader")
  274. (description
  275. "Pinfo is an Info file viewer. Pinfo is similar in use to the Lynx web
  276. browser. You just move across info nodes, and select links, follow them, etc.
  277. It supports many colors. Pinfo also supports viewing of manual pages -- they
  278. are colorized like in the midnight commander's viewer, and additionally they
  279. are hypertextualized.")
  280. (license gpl2+)))