texlive.scm 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2017, 2022 Ricardo Wurmus <rekado@elephly.net>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (test-texlive)
  19. #:use-module (gnu packages tex)
  20. #:use-module (guix import texlive)
  21. #:use-module (guix tests)
  22. #:use-module (guix tests http)
  23. #:use-module (guix build utils)
  24. #:use-module (srfi srfi-1)
  25. #:use-module (srfi srfi-64)
  26. #:use-module (srfi srfi-26)
  27. #:use-module (web client)
  28. #:use-module (ice-9 match))
  29. (test-begin "texlive")
  30. (define %fake-tlpdb
  31. '(("stricttex"
  32. . ((name
  33. . "stricttex")
  34. (shortdesc
  35. . "Strictly balanced brackets and numbers in command names")
  36. (longdesc
  37. . "This is a small, LuaLaTeX-only package providing you with three,
  38. sometimes useful features: It allows you to make brackets [...] \"strict\",
  39. meaning that each [ must be balanced by a ]. It allows you to use numbers in
  40. command names, so that you can do stuff like \\newcommand\\pi12{\\pi_{12}}. It
  41. allows you to use numbers and primes in command names, so that you can do
  42. stuff like \\newcommand\\pi'12{\\pi '_{12}}.")
  43. (docfiles
  44. . ("texmf-dist/doc/lualatex/stricttex/README.md"
  45. "texmf-dist/doc/lualatex/stricttex/stricttex.pdf"))
  46. (runfiles
  47. . ("texmf-dist/tex/lualatex/stricttex/stricttex.lua"
  48. "texmf-dist/tex/lualatex/stricttex/stricttex.sty"))
  49. (catalogue-license . "lppl1.3c")))
  50. ("texsis"
  51. . ((name
  52. . "texsis")
  53. (shortdesc
  54. . "Plain TeX macros for Physicists")
  55. (longdesc
  56. . "TeXsis is a TeX macro package which provides useful features for
  57. typesetting research papers and related documents. For example, it includes
  58. support specifically for: Automatic numbering of equations, figures, tables
  59. and references; Simplified control of type sizes, line spacing, footnotes,
  60. running headlines and footlines, and tables of contents, figures and tables;
  61. Specialized document formats for research papers, preprints and \"e-prints\",
  62. conference proceedings, theses, books, referee reports, letters, and
  63. memoranda; Simplified means of constructing an index for a book or thesis;
  64. Easy to use double column formatting; Specialized environments for lists,
  65. theorems and proofs, centered or non-justified text, and listing computer
  66. code; Specialized macros for easily constructing ruled tables. TeXsis was
  67. originally developed for physicists, but others may also find it useful. It is
  68. completely compatible with Plain TeX.")
  69. (depend . ("cm" "hyphen-base" "knuth-lib" "plain" "tex"))
  70. (docfiles
  71. . ("texmf-dist/doc/man/man1/texsis.1"
  72. "texmf-dist/doc/man/man1/texsis.man1.pdf"
  73. "texmf-dist/doc/otherformats/texsis/base/COPYING"
  74. "texmf-dist/doc/otherformats/texsis/base/Example.tex"
  75. "texmf-dist/doc/otherformats/texsis/base/Fonts.tex"
  76. "texmf-dist/doc/otherformats/texsis/base/INSTALL"
  77. "texmf-dist/doc/otherformats/texsis/base/Install.tex"
  78. "texmf-dist/doc/otherformats/texsis/base/MANIFEST"
  79. "texmf-dist/doc/otherformats/texsis/base/Manual.fgl"
  80. "texmf-dist/doc/otherformats/texsis/base/Manual.ref"
  81. "texmf-dist/doc/otherformats/texsis/base/Manual.tbl"
  82. "texmf-dist/doc/otherformats/texsis/base/Manual.tex"
  83. "texmf-dist/doc/otherformats/texsis/base/NEWS"
  84. "texmf-dist/doc/otherformats/texsis/base/README"
  85. "texmf-dist/doc/otherformats/texsis/base/TXSapxF.doc"
  86. "texmf-dist/doc/otherformats/texsis/base/TXScover.doc"
  87. "texmf-dist/doc/otherformats/texsis/base/TXSdcol.doc"
  88. "texmf-dist/doc/otherformats/texsis/base/TXSdoc.doc"
  89. "texmf-dist/doc/otherformats/texsis/base/TXSdoc0.doc"
  90. "texmf-dist/doc/otherformats/texsis/base/TXSdocM.doc"
  91. "texmf-dist/doc/otherformats/texsis/base/TXSend.doc"
  92. "texmf-dist/doc/otherformats/texsis/base/TXSenvmt.doc"
  93. "texmf-dist/doc/otherformats/texsis/base/TXSeqns.doc"
  94. "texmf-dist/doc/otherformats/texsis/base/TXSfigs.doc"
  95. "texmf-dist/doc/otherformats/texsis/base/TXSfmts.doc"
  96. "texmf-dist/doc/otherformats/texsis/base/TXSfonts.doc"
  97. "texmf-dist/doc/otherformats/texsis/base/TXSinstl.doc"
  98. "texmf-dist/doc/otherformats/texsis/base/TXSintro.doc"
  99. "texmf-dist/doc/otherformats/texsis/base/TXSletr.doc"
  100. "texmf-dist/doc/otherformats/texsis/base/TXSmisc.doc"
  101. "texmf-dist/doc/otherformats/texsis/base/TXSprns.doc"
  102. "texmf-dist/doc/otherformats/texsis/base/TXSrefs.doc"
  103. "texmf-dist/doc/otherformats/texsis/base/TXSrevs.doc"
  104. "texmf-dist/doc/otherformats/texsis/base/TXSruled.doc"
  105. "texmf-dist/doc/otherformats/texsis/base/TXSsects.doc"
  106. "texmf-dist/doc/otherformats/texsis/base/TXSsite.000"
  107. "texmf-dist/doc/otherformats/texsis/base/TXSsymb.doc"
  108. "texmf-dist/doc/otherformats/texsis/base/TXStags.doc"
  109. "texmf-dist/doc/otherformats/texsis/base/index.tex"
  110. "texmf-dist/doc/otherformats/texsis/base/letr"
  111. "texmf-dist/doc/otherformats/texsis/base/penguin.eps"
  112. "texmf-dist/doc/otherformats/texsis/base/penguin2.eps"
  113. "texmf-dist/doc/otherformats/texsis/base/texsis.el"
  114. "texmf-dist/doc/otherformats/texsis/base/texsis.lsm"))
  115. (runfiles
  116. . ("texmf-dist/bibtex/bst/texsis/texsis.bst"
  117. "texmf-dist/tex/texsis/base/AIP.txs"
  118. "texmf-dist/tex/texsis/base/CVformat.txs"
  119. "texmf-dist/tex/texsis/base/Elsevier.txs"
  120. "texmf-dist/tex/texsis/base/Exam.txs"
  121. "texmf-dist/tex/texsis/base/Formletr.txs"
  122. "texmf-dist/tex/texsis/base/IEEE.txs"
  123. "texmf-dist/tex/texsis/base/PhysRev.txs"
  124. "texmf-dist/tex/texsis/base/Spanish.txs"
  125. "texmf-dist/tex/texsis/base/Swedish.txs"
  126. "texmf-dist/tex/texsis/base/TXSconts.tex"
  127. "texmf-dist/tex/texsis/base/TXSdcol.tex"
  128. "texmf-dist/tex/texsis/base/TXSenvmt.tex"
  129. "texmf-dist/tex/texsis/base/TXSeqns.tex"
  130. "texmf-dist/tex/texsis/base/TXSfigs.tex"
  131. "texmf-dist/tex/texsis/base/TXSfmts.tex"
  132. "texmf-dist/tex/texsis/base/TXSfonts.tex"
  133. "texmf-dist/tex/texsis/base/TXShead.tex"
  134. "texmf-dist/tex/texsis/base/TXSinit.tex"
  135. "texmf-dist/tex/texsis/base/TXSletr.tex"
  136. "texmf-dist/tex/texsis/base/TXSmacs.tex"
  137. "texmf-dist/tex/texsis/base/TXSmemo.tex"
  138. "texmf-dist/tex/texsis/base/TXSprns.tex"
  139. "texmf-dist/tex/texsis/base/TXSrefs.tex"
  140. "texmf-dist/tex/texsis/base/TXSruled.tex"
  141. "texmf-dist/tex/texsis/base/TXSsects.tex"
  142. "texmf-dist/tex/texsis/base/TXSsite.tex"
  143. "texmf-dist/tex/texsis/base/TXSsymb.tex"
  144. "texmf-dist/tex/texsis/base/TXStags.tex"
  145. "texmf-dist/tex/texsis/base/TXStitle.tex"
  146. "texmf-dist/tex/texsis/base/Tablebod.txs"
  147. "texmf-dist/tex/texsis/base/WorldSci.txs"
  148. "texmf-dist/tex/texsis/base/color.txs"
  149. "texmf-dist/tex/texsis/base/nuclproc.txs"
  150. "texmf-dist/tex/texsis/base/printfont.txs"
  151. "texmf-dist/tex/texsis/base/spine.txs"
  152. "texmf-dist/tex/texsis/base/texsis.tex"
  153. "texmf-dist/tex/texsis/base/thesis.txs"
  154. "texmf-dist/tex/texsis/base/twin.txs"
  155. "texmf-dist/tex/texsis/config/texsis.ini"))
  156. (catalogue-license . "lppl")))))
  157. (test-assert "texlive->guix-package"
  158. ;; Replace network resources with sample data.
  159. (mock ((guix build svn) svn-fetch
  160. (lambda* (url revision directory
  161. #:key (svn-command "svn")
  162. (user-name #f)
  163. (password #f)
  164. (recursive? #t))
  165. (mkdir-p directory)
  166. (with-output-to-file (string-append directory "/foo")
  167. (lambda ()
  168. (display "source")))))
  169. (let ((result (texlive->guix-package "texsis"
  170. #:package-database
  171. (lambda _ %fake-tlpdb))))
  172. (match result
  173. (('package
  174. ('inherit ('simple-texlive-package
  175. "texlive-texsis"
  176. ('list "bibtex/bst/texsis/"
  177. "doc/man/man1/"
  178. "doc/otherformats/texsis/base/"
  179. "tex/texsis/base/"
  180. "tex/texsis/config/")
  181. ('base32 (? string? hash))
  182. #:trivial? #t))
  183. ('version . any)
  184. ('propagated-inputs
  185. ('list 'texlive-cm
  186. 'texlive-hyphen-base
  187. 'texlive-knuth-lib
  188. 'texlive-plain
  189. 'texlive-tex))
  190. ('home-page "https://www.tug.org/texlive/")
  191. ('synopsis "Plain TeX macros for Physicists")
  192. ('description (? string? description))
  193. ('license 'lppl))
  194. #true)
  195. (_
  196. (begin
  197. (format #t "~s~%" result)
  198. (pk 'fail result #f)))))))
  199. (test-end "texlive")