texlive.scm 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2017, 2022 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2023 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (test-texlive)
  20. #:use-module (gnu packages tex)
  21. #:use-module (guix import texlive)
  22. #:use-module (guix tests)
  23. #:use-module (guix tests http)
  24. #:use-module (guix build utils)
  25. #:use-module (srfi srfi-1)
  26. #:use-module (srfi srfi-64)
  27. #:use-module (srfi srfi-26)
  28. #:use-module (web client)
  29. #:use-module (ice-9 match))
  30. (test-begin "texlive")
  31. (define %fake-tlpdb
  32. '(("12many"
  33. . ((name
  34. . "12many")
  35. (catalogue
  36. . "one2many")
  37. (shortdesc
  38. . "Generalising mathematical index sets")
  39. (longdesc
  40. . "In the discrete branches of mathematics...")
  41. (docfiles
  42. . ("texmf-dist/doc/latex/12many/12many.pdf"
  43. "texmf-dist/doc/latex/12many/README"))
  44. (srcfiles
  45. . ("texmf-dist/source/latex/12many/12many.dtx"
  46. "texmf-dist/source/latex/12many/12many.ins"))
  47. (runfiles
  48. . ("texmf-dist/tex/latex/12many/12many.sty"))
  49. (catalogue-license . "lppl")))
  50. ("adforn"
  51. (name . "adforn")
  52. (shortdesc . "OrnementsADF font with TeX/LaTeX support")
  53. (longdesc . "The bundle provides the Ornements ADF font...")
  54. (execute "addMap OrnementsADF.map")
  55. (docfiles
  56. "texmf-dist/doc/fonts/adforn/COPYING"
  57. "texmf-dist/doc/fonts/adforn/NOTICE"
  58. "texmf-dist/doc/fonts/adforn/README"
  59. "texmf-dist/doc/fonts/adforn/adforn.pdf")
  60. (runfiles
  61. "texmf-dist/fonts/afm/arkandis/adforn/OrnementsADF.afm"
  62. "texmf-dist/fonts/enc/dvips/adforn/OrnementsADF.enc"
  63. "texmf-dist/fonts/map/dvips/adforn/OrnementsADF.map"
  64. "texmf-dist/fonts/tfm/arkandis/adforn/OrnementsADF.tfm"
  65. "texmf-dist/fonts/type1/arkandis/adforn/OrnementsADF.pfb"
  66. "texmf-dist/tex/latex/adforn/adforn.sty"
  67. "texmf-dist/tex/latex/adforn/uornementsadf.fd")
  68. (catalogue-license . "lppl gpl2"))
  69. ("authorindex"
  70. (name . "authorindex")
  71. (shortdesc . "Index citations by author names")
  72. (longdesc . "This package allows the user to...")
  73. (depend "authorindex.ARCH")
  74. (docfiles "texmf-dist/doc/latex/authorindex/COPYING")
  75. (runfiles
  76. "texmf-dist/scripts/authorindex/authorindex"
  77. "texmf-dist/tex/latex/authorindex/authorindex.sty")
  78. (catalogue-license . "lppl"))
  79. ("authorindex.x86_64-linux"
  80. (name . "authorindex.x86_64-linux")
  81. (binfiles "bin/amd64-netbsd/authorindex"))
  82. ("chs-physics-report"
  83. . ((name . "ch-physics-report")
  84. (shortdesc . "Physics lab reports...")
  85. (longdesc . "This package may...")
  86. (docfiles
  87. .
  88. ("texmf-dist/doc/latex/chs-physics-report/README.txt"
  89. "texmf-dist/doc/latex/chs-physics-report/chs-physics-report.pdf"))
  90. (runfiles
  91. .
  92. ("texmf-dist/tex/latex/chs-physics-report/chs-physics-report.sty"))
  93. (catalogue-license . "pd cc-by-sa-3")))
  94. ("collection-basic"
  95. (name . "collection-basic")
  96. (shortdesc . "Essential programs and files")
  97. (longdesc . "These files are regarded as basic...")
  98. (depend "amsfonts" "hyph-utf8" "hyphen-base" "texlive-common"
  99. "texlive.infra" "tlshell"))
  100. ("collection-texworks"
  101. (name . "collection-texworks")
  102. (shortdesc . "TeXworks editor...")
  103. (longdesc . "See http...")
  104. (depend "texworks" "collection-basic"))
  105. ("cyrillic-bin"
  106. (name . "cyrillic-bin")
  107. (shortdesc . "Cyrillic bibtex and makeindex")
  108. (depend "cyrillic-bin.ARCH")
  109. (docfiles
  110. "texmf-dist/doc/man/man1/rubibtex.1"
  111. "texmf-dist/doc/man/man1/rubibtex.man1.pdf")
  112. (runfiles
  113. "texmf-dist/scripts/texlive-extra/rumakeindex.sh"
  114. "texmf-dist/scripts/texlive-extra/rubibtex.sh"))
  115. ("cyrillic-bin.x86_64-linux"
  116. (name . "cyrillic-bin.x86_64-linux")
  117. (shortdesc . "x86_64-linux files of cyrillic-bin")
  118. (binfiles
  119. "bin/x86_64-linux/rubibtex"
  120. "bin/x86_64-linux/rumakeindex"))
  121. ("example"
  122. . ((name . "example")
  123. (shortdesc . "Typeset examples...")
  124. (longdesc . "The package makes it easier...")
  125. (runfiles
  126. .
  127. ("texmf-dist/tex/latex/example/example.sty"))
  128. (catalogue-license . "gpl")))
  129. ("lollipop"
  130. (name . "lollipop")
  131. (shortdesc . "TeX made easy")
  132. (longdesc . "Lollipop is TeX made easy...")
  133. (execute "AddFormat name=lollipop engine=tex options=\"lollipop.ini\"...")
  134. (docfiles
  135. "texmf-dist/doc/otherformats/lollipop/README"
  136. "texmf-dist/doc/otherformats/lollipop/manual/address.tex"
  137. "texmf-dist/doc/otherformats/lollipop/manual/appendix.tex"
  138. "texmf-dist/doc/otherformats/lollipop/manual/btxmac.tex"
  139. "texmf-dist/doc/otherformats/lollipop/manual/comm.tex"
  140. "texmf-dist/doc/otherformats/lollipop/manual/comment.tex"
  141. "texmf-dist/doc/otherformats/lollipop/manual/example.tex"
  142. "texmf-dist/doc/otherformats/lollipop/manual/extern.tex"
  143. "texmf-dist/doc/otherformats/lollipop/manual/head.tex"
  144. "texmf-dist/doc/otherformats/lollipop/manual/list.tex"
  145. "texmf-dist/doc/otherformats/lollipop/manual/lollipop-manual.bib"
  146. "texmf-dist/doc/otherformats/lollipop/manual/lollipop-manual.pdf")
  147. (runfiles
  148. "texmf-dist/tex/lollipop/lollipop-define.tex"
  149. "texmf-dist/tex/lollipop/lollipop-document.tex"
  150. "texmf-dist/tex/lollipop/lollipop-float.tex"
  151. "texmf-dist/tex/lollipop/lollipop-fontdefs.tex"
  152. "texmf-dist/tex/lollipop/lollipop-fonts.tex"
  153. "texmf-dist/tex/lollipop/lollipop-heading.tex"
  154. "texmf-dist/tex/lollipop/lollipop-lists.tex"
  155. "texmf-dist/tex/lollipop/lollipop-output.tex"
  156. "texmf-dist/tex/lollipop/lollipop-plain.tex"
  157. "texmf-dist/tex/lollipop/lollipop-text.tex"
  158. "texmf-dist/tex/lollipop/lollipop-tools.tex"
  159. "texmf-dist/tex/lollipop/lollipop.ini"
  160. "texmf-dist/tex/lollipop/lollipop.tex")
  161. (catalogue-license . "gpl3"))
  162. ("pax"
  163. (name . "pax")
  164. (shortdesc . "Extract and reinsert PDF...")
  165. (longdesc . "If PDF files are...")
  166. (depend "pax.ARCH")
  167. (docfiles
  168. "texmf-dist/doc/latex/pax/README")
  169. (srcfiles
  170. "texmf-dist/source/latex/pax/Makefile"
  171. "texmf-dist/source/latex/pax/build.xml")
  172. (runfiles
  173. "texmf-dist/scripts/pax/pdfannotextractor.pl")
  174. (catalogue-license . "lppl gpl"))
  175. ("pax.x86_64-linux"
  176. (name . "pax.x86_64-linux")
  177. (shortdesc . "x86_64-linux files of pax")
  178. (binfiles
  179. "bin/x86_64-linux/pdfannotextractor"))
  180. ("stricttex"
  181. . ((name
  182. . "stricttex")
  183. (shortdesc
  184. . "Strictly balanced brackets and numbers in command names")
  185. (longdesc
  186. . "This is a small, LuaLaTeX-only package providing you with three,
  187. sometimes useful features: It allows you to make brackets [...] \"strict\",
  188. meaning that each [ must be balanced by a ]. It allows you to use numbers in
  189. command names, so that you can do stuff like \\newcommand\\pi12{\\pi_{12}}. It
  190. allows you to use numbers and primes in command names, so that you can do
  191. stuff like \\newcommand\\pi'12{\\pi '_{12}}.")
  192. (docfiles
  193. . ("texmf-dist/doc/lualatex/stricttex/README.md"
  194. "texmf-dist/doc/lualatex/stricttex/stricttex.pdf"))
  195. (runfiles
  196. . ("texmf-dist/tex/lualatex/stricttex/stricttex.lua"
  197. "texmf-dist/tex/lualatex/stricttex/stricttex.sty"))
  198. (catalogue-license . "lppl1.3c")))
  199. ("tex"
  200. (name . "tex")
  201. (shortdesc . "A sophisticated typesetting engine")
  202. (longdesc . "TeX is a typesetting system that incorporates...")
  203. (depend "cm" "hyphen-base" "tex.ARCH")
  204. (docfiles "texmf-dist/doc/man/man1/tex.1")
  205. (catalogue-license . "knuth"))
  206. ("texsis"
  207. . ((name
  208. . "texsis")
  209. (shortdesc
  210. . "Plain TeX macros for Physicists")
  211. (longdesc
  212. . "TeXsis is a TeX macro package which provides useful features for
  213. typesetting research papers and related documents. For example, it includes
  214. support specifically for: Automatic numbering of equations, figures, tables
  215. and references; Simplified control of type sizes, line spacing, footnotes,
  216. running headlines and footlines, and tables of contents, figures and tables;
  217. Specialized document formats for research papers, preprints and \"e-prints\",
  218. conference proceedings, theses, books, referee reports, letters, and
  219. memoranda; Simplified means of constructing an index for a book or thesis;
  220. Easy to use double column formatting; Specialized environments for lists,
  221. theorems and proofs, centered or non-justified text, and listing computer
  222. code; Specialized macros for easily constructing ruled tables. TeXsis was
  223. originally developed for physicists, but others may also find it useful. It is
  224. completely compatible with Plain TeX.")
  225. (depend . ("tex" "plain" "knuth-lib" "hyphen-base" "cm"))
  226. (docfiles
  227. . ("texmf-dist/doc/man/man1/texsis.1"
  228. "texmf-dist/doc/man/man1/texsis.man1.pdf"
  229. "texmf-dist/doc/otherformats/texsis/base/COPYING"
  230. "texmf-dist/doc/otherformats/texsis/base/Example.tex"
  231. "texmf-dist/doc/otherformats/texsis/base/Fonts.tex"
  232. "texmf-dist/doc/otherformats/texsis/base/INSTALL"
  233. "texmf-dist/doc/otherformats/texsis/base/Install.tex"
  234. "texmf-dist/doc/otherformats/texsis/base/MANIFEST"
  235. "texmf-dist/doc/otherformats/texsis/base/Manual.fgl"
  236. "texmf-dist/doc/otherformats/texsis/base/Manual.ref"
  237. "texmf-dist/doc/otherformats/texsis/base/Manual.tbl"
  238. "texmf-dist/doc/otherformats/texsis/base/Manual.tex"
  239. "texmf-dist/doc/otherformats/texsis/base/NEWS"
  240. "texmf-dist/doc/otherformats/texsis/base/README"
  241. "texmf-dist/doc/otherformats/texsis/base/TXSapxF.doc"
  242. "texmf-dist/doc/otherformats/texsis/base/TXScover.doc"
  243. "texmf-dist/doc/otherformats/texsis/base/TXSdcol.doc"
  244. "texmf-dist/doc/otherformats/texsis/base/TXSdoc.doc"
  245. "texmf-dist/doc/otherformats/texsis/base/TXSdoc0.doc"
  246. "texmf-dist/doc/otherformats/texsis/base/TXSdocM.doc"
  247. "texmf-dist/doc/otherformats/texsis/base/TXSend.doc"
  248. "texmf-dist/doc/otherformats/texsis/base/TXSenvmt.doc"
  249. "texmf-dist/doc/otherformats/texsis/base/TXSeqns.doc"
  250. "texmf-dist/doc/otherformats/texsis/base/TXSfigs.doc"
  251. "texmf-dist/doc/otherformats/texsis/base/TXSfmts.doc"
  252. "texmf-dist/doc/otherformats/texsis/base/TXSfonts.doc"
  253. "texmf-dist/doc/otherformats/texsis/base/TXSinstl.doc"
  254. "texmf-dist/doc/otherformats/texsis/base/TXSintro.doc"
  255. "texmf-dist/doc/otherformats/texsis/base/TXSletr.doc"
  256. "texmf-dist/doc/otherformats/texsis/base/TXSmisc.doc"
  257. "texmf-dist/doc/otherformats/texsis/base/TXSprns.doc"
  258. "texmf-dist/doc/otherformats/texsis/base/TXSrefs.doc"
  259. "texmf-dist/doc/otherformats/texsis/base/TXSrevs.doc"
  260. "texmf-dist/doc/otherformats/texsis/base/TXSruled.doc"
  261. "texmf-dist/doc/otherformats/texsis/base/TXSsects.doc"
  262. "texmf-dist/doc/otherformats/texsis/base/TXSsite.000"
  263. "texmf-dist/doc/otherformats/texsis/base/TXSsymb.doc"
  264. "texmf-dist/doc/otherformats/texsis/base/TXStags.doc"
  265. "texmf-dist/doc/otherformats/texsis/base/index.tex"
  266. "texmf-dist/doc/otherformats/texsis/base/letr"
  267. "texmf-dist/doc/otherformats/texsis/base/penguin.eps"
  268. "texmf-dist/doc/otherformats/texsis/base/penguin2.eps"
  269. "texmf-dist/doc/otherformats/texsis/base/texsis.el"
  270. "texmf-dist/doc/otherformats/texsis/base/texsis.lsm"))
  271. (runfiles
  272. . ("texmf-dist/bibtex/bst/texsis/texsis.bst"
  273. "texmf-dist/tex/texsis/base/AIP.txs"
  274. "texmf-dist/tex/texsis/base/CVformat.txs"
  275. "texmf-dist/tex/texsis/base/Elsevier.txs"
  276. "texmf-dist/tex/texsis/base/Exam.txs"
  277. "texmf-dist/tex/texsis/base/Formletr.txs"
  278. "texmf-dist/tex/texsis/base/IEEE.txs"
  279. "texmf-dist/tex/texsis/base/PhysRev.txs"
  280. "texmf-dist/tex/texsis/base/Spanish.txs"
  281. "texmf-dist/tex/texsis/base/Swedish.txs"
  282. "texmf-dist/tex/texsis/base/TXSconts.tex"
  283. "texmf-dist/tex/texsis/base/TXSdcol.tex"
  284. "texmf-dist/tex/texsis/base/TXSenvmt.tex"
  285. "texmf-dist/tex/texsis/base/TXSeqns.tex"
  286. "texmf-dist/tex/texsis/base/TXSfigs.tex"
  287. "texmf-dist/tex/texsis/base/TXSfmts.tex"
  288. "texmf-dist/tex/texsis/base/TXSfonts.tex"
  289. "texmf-dist/tex/texsis/base/TXShead.tex"
  290. "texmf-dist/tex/texsis/base/TXSinit.tex"
  291. "texmf-dist/tex/texsis/base/TXSletr.tex"
  292. "texmf-dist/tex/texsis/base/TXSmacs.tex"
  293. "texmf-dist/tex/texsis/base/TXSmemo.tex"
  294. "texmf-dist/tex/texsis/base/TXSprns.tex"
  295. "texmf-dist/tex/texsis/base/TXSrefs.tex"
  296. "texmf-dist/tex/texsis/base/TXSruled.tex"
  297. "texmf-dist/tex/texsis/base/TXSsects.tex"
  298. "texmf-dist/tex/texsis/base/TXSsite.tex"
  299. "texmf-dist/tex/texsis/base/TXSsymb.tex"
  300. "texmf-dist/tex/texsis/base/TXStags.tex"
  301. "texmf-dist/tex/texsis/base/TXStitle.tex"
  302. "texmf-dist/tex/texsis/base/Tablebod.txs"
  303. "texmf-dist/tex/texsis/base/WorldSci.txs"
  304. "texmf-dist/tex/texsis/base/color.txs"
  305. "texmf-dist/tex/texsis/base/nuclproc.txs"
  306. "texmf-dist/tex/texsis/base/printfont.txs"
  307. "texmf-dist/tex/texsis/base/spine.txs"
  308. "texmf-dist/tex/texsis/base/texsis.tex"
  309. "texmf-dist/tex/texsis/base/thesis.txs"
  310. "texmf-dist/tex/texsis/base/twin.txs"
  311. "texmf-dist/tex/texsis/config/texsis.ini"))
  312. (catalogue-license . "lppl")))
  313. ("trsym"
  314. (name . "trsym")
  315. (shortdesc . "Symbols for transformations")
  316. (longdesc . "The bundle provides Metafont...")
  317. (docfiles "texmf-dist/doc/latex/trsym/README"
  318. "texmf-dist/doc/latex/trsym/manifest.txt"
  319. "texmf-dist/doc/latex/trsym/trsym.pdf")
  320. (srcfiles "texmf-dist/source/latex/trsym/trsym.dtx"
  321. "texmf-dist/source/latex/trsym/trsym.ins")
  322. (runfiles "texmf-dist/fonts/source/public/trsym/trsy.mf"
  323. "texmf-dist/fonts/source/public/trsym/trsy10.mf"
  324. "texmf-dist/fonts/source/public/trsym/trsy12.mf"
  325. "texmf-dist/fonts/tfm/public/trsym/trsy10.tfm"
  326. "texmf-dist/fonts/tfm/public/trsym/trsy12.tfm"
  327. "texmf-dist/tex/latex/trsym/trsym.sty"
  328. "texmf-dist/tex/latex/trsym/utrsy.fd")
  329. (catalogue-license . "lppl"))))
  330. (test-assert "texlive->guix-package, no docfiles"
  331. ;; Replace network resources with sample data.
  332. (mock ((guix build svn) svn-fetch
  333. (lambda* (url revision directory
  334. #:key (svn-command "svn")
  335. (user-name #f)
  336. (password #f)
  337. (recursive? #t))
  338. (mkdir-p directory)
  339. (with-output-to-file (string-append directory "/foo")
  340. (lambda ()
  341. (display "source")))))
  342. (let ((result (texlive->guix-package "example"
  343. #:package-database
  344. (lambda _ %fake-tlpdb))))
  345. (match result
  346. (('package
  347. ('name "texlive-example")
  348. ('version _)
  349. ('source ('texlive-origin
  350. 'name 'version
  351. ('list "tex/latex/example/")
  352. ('base32 (? string? hash))))
  353. ('build-system 'texlive-build-system)
  354. ('home-page (? string?))
  355. ('synopsis (? string?))
  356. ('description (? string?))
  357. ('license _))
  358. #true)
  359. (_
  360. (begin
  361. (format #t "~s~%" result)
  362. (pk 'fail result #f)))))))
  363. (test-assert "texlive->guix-package"
  364. ;; Replace network resources with sample data.
  365. (mock ((guix build svn) svn-fetch
  366. (lambda* (url revision directory
  367. #:key (svn-command "svn")
  368. (user-name #f)
  369. (password #f)
  370. (recursive? #t))
  371. (mkdir-p directory)
  372. (with-output-to-file (string-append directory "/foo")
  373. (lambda ()
  374. (display "source")))))
  375. (let ((result (texlive->guix-package "texsis"
  376. #:package-database
  377. (lambda _ %fake-tlpdb))))
  378. (match result
  379. (('package
  380. ('name "texlive-texsis")
  381. ('version _)
  382. ('source ('texlive-origin
  383. 'name 'version
  384. ('list "bibtex/bst/texsis/"
  385. "doc/man/man1/texsis.1"
  386. "doc/man/man1/texsis.man1.pdf"
  387. "doc/otherformats/texsis/base/"
  388. "tex/texsis/base/"
  389. "tex/texsis/config/")
  390. ('base32 (? string? hash))))
  391. ('outputs ''("out" "doc"))
  392. ('build-system 'texlive-build-system)
  393. ('propagated-inputs
  394. ('list 'texlive-cm
  395. 'texlive-hyphen-base
  396. 'texlive-knuth-lib
  397. 'texlive-plain
  398. 'texlive-tex))
  399. ('home-page (? string?))
  400. ('synopsis (? string?))
  401. ('description (? string?))
  402. ('license 'lppl))
  403. #true)
  404. (_
  405. (begin
  406. (format #t "~s~%" result)
  407. (pk 'fail result #f)))))))
  408. (test-assert "texlive->guix-package, with METAFONT files"
  409. ;; Replace network resources with sample data.
  410. (mock ((guix build svn) svn-fetch
  411. (lambda* (url revision directory
  412. #:key (svn-command "svn")
  413. (user-name #f)
  414. (password #f)
  415. (recursive? #t))
  416. (mkdir-p directory)
  417. (with-output-to-file (string-append directory "/foo")
  418. (lambda ()
  419. (display "source")))))
  420. (let ((result (texlive->guix-package "trsym"
  421. #:package-database
  422. (lambda _ %fake-tlpdb))))
  423. (match result
  424. (('package
  425. ('name _)
  426. ('version _)
  427. ('source _)
  428. ('outputs _)
  429. ('build-system _)
  430. ('native-inputs
  431. ('list 'texlive-metafont))
  432. ('home-page (? string?))
  433. ('synopsis (? string?))
  434. ('description (? string?))
  435. ('license _))
  436. #true)
  437. (_
  438. (begin
  439. (format #t "~s~%" result)
  440. (pk 'fail result #f)))))))
  441. (test-assert "texlive->guix-package, with catalogue entry, no inputs"
  442. ;; Replace network resources with sample data.
  443. (mock ((guix build svn) svn-fetch
  444. (lambda* (url revision directory
  445. #:key (svn-command "svn")
  446. (user-name #f)
  447. (password #f)
  448. (recursive? #t))
  449. (mkdir-p directory)
  450. (with-output-to-file (string-append directory "/foo")
  451. (lambda ()
  452. (display "source")))))
  453. (let ((result (texlive->guix-package "12many"
  454. #:package-database
  455. (lambda _ %fake-tlpdb))))
  456. (match result
  457. (('package
  458. ('name "texlive-12many")
  459. ('version _)
  460. ('source ('texlive-origin
  461. 'name 'version
  462. ('list "doc/latex/12many/"
  463. "source/latex/12many/"
  464. "tex/latex/12many/")
  465. ('base32 (? string? hash))))
  466. ('outputs ''("out" "doc"))
  467. ('build-system 'texlive-build-system)
  468. ('home-page "https://ctan.org/pkg/one2many")
  469. ('synopsis (? string?))
  470. ('description (? string?))
  471. ('license 'lppl))
  472. #true)
  473. (_
  474. (begin
  475. (format #t "~s~%" result)
  476. (pk 'fail result #f)))))))
  477. (test-assert "texlive->guix-package, multiple licenses"
  478. ;; Replace network resources with sample data.
  479. (mock ((guix build svn) svn-fetch
  480. (lambda* (url revision directory
  481. #:key (svn-command "svn")
  482. (user-name #f)
  483. (password #f)
  484. (recursive? #t))
  485. (mkdir-p directory)
  486. (with-output-to-file (string-append directory "/foo")
  487. (lambda ()
  488. (display "source")))))
  489. (let ((result (texlive->guix-package "chs-physics-report"
  490. #:package-database
  491. (lambda _ %fake-tlpdb))))
  492. (match result
  493. (('package
  494. ('name "texlive-chs-physics-report")
  495. ('version _)
  496. ('source ('texlive-origin
  497. 'name 'version
  498. ('list "doc/latex/chs-physics-report/"
  499. "tex/latex/chs-physics-report/")
  500. ('base32 (? string? hash))))
  501. ('outputs ''("out" "doc"))
  502. ('build-system 'texlive-build-system)
  503. ('home-page (? string?))
  504. ('synopsis (? string?))
  505. ('description (? string?))
  506. ('license ('list 'public-domain 'cc-by-sa3.0)))
  507. #true)
  508. (_
  509. (begin
  510. (format #t "~s~%" result)
  511. (pk 'fail result #f)))))))
  512. (test-assert "texlive->guix-package, meta-package"
  513. ;; Replace network resources with sample data.
  514. (mock ((guix build svn) svn-fetch
  515. (lambda* (url revision directory
  516. #:key (svn-command "svn")
  517. (user-name #f)
  518. (password #f)
  519. (recursive? #t))
  520. (mkdir-p directory)
  521. (with-output-to-file (string-append directory "/foo")
  522. (lambda ()
  523. (display "source")))))
  524. (let ((result (texlive->guix-package "collection-texworks"
  525. #:package-database
  526. (lambda _ %fake-tlpdb))))
  527. (match result
  528. (('package
  529. ('name "texlive-collection-texworks")
  530. ('version _)
  531. ('source #f)
  532. ('build-system 'trivial-build-system)
  533. ('arguments
  534. ('list '#:builder ('gexp ('mkdir ('ungexp 'output)))))
  535. ('propagated-inputs
  536. ('list 'texlive-collection-basic))
  537. ('home-page "https://www.tug.org/texlive/")
  538. ('synopsis (? string?))
  539. ('description (? string?))
  540. ('license
  541. ('fsf-free "https://www.tug.org/texlive/copying.html")))
  542. #true)
  543. (_
  544. (begin
  545. (format #t "~s~%" result)
  546. (pk 'fail result #f)))))))
  547. (test-assert "texlive->guix-package, with TeX format"
  548. ;; Replace network resources with sample data.
  549. (mock ((guix build svn) svn-fetch
  550. (lambda* (url revision directory
  551. #:key (svn-command "svn")
  552. (user-name #f)
  553. (password #f)
  554. (recursive? #t))
  555. (mkdir-p directory)
  556. (with-output-to-file (string-append directory "/foo")
  557. (lambda ()
  558. (display "source")))))
  559. (let ((result (texlive->guix-package "lollipop"
  560. #:package-database
  561. (lambda _ %fake-tlpdb))))
  562. (match result
  563. (('package
  564. ('name "texlive-lollipop")
  565. ('version _)
  566. ('source ('texlive-origin
  567. 'name 'version
  568. ('list "doc/otherformats/lollipop/"
  569. "tex/lollipop/")
  570. ('base32 (? string? hash))))
  571. ('outputs ''("out" "doc"))
  572. ('build-system 'texlive-build-system)
  573. ('arguments ('list '#:create-formats ('gexp ('list "lollipop"))))
  574. ('home-page (? string?))
  575. ('synopsis (? string?))
  576. ('description (? string?))
  577. ('license 'gpl3))
  578. #true)
  579. (_
  580. (begin
  581. (format #t "~s~%" result)
  582. (pk 'fail result #f)))))))
  583. (test-assert "texlive->guix-package, execute but no TeX format"
  584. ;; Replace network resources with sample data.
  585. (mock ((guix build svn) svn-fetch
  586. (lambda* (url revision directory
  587. #:key (svn-command "svn")
  588. (user-name #f)
  589. (password #f)
  590. (recursive? #t))
  591. (mkdir-p directory)
  592. (with-output-to-file (string-append directory "/foo")
  593. (lambda ()
  594. (display "source")))))
  595. (let ((result (texlive->guix-package "adforn"
  596. #:package-database
  597. (lambda _ %fake-tlpdb))))
  598. (match result
  599. (('package
  600. ('name "texlive-adforn")
  601. ('version _)
  602. ('source _)
  603. ('outputs ''("out" "doc"))
  604. ('build-system 'texlive-build-system)
  605. ('home-page (? string?))
  606. ('synopsis (? string?))
  607. ('description (? string?))
  608. ('license _))
  609. #true)
  610. (_
  611. (begin
  612. (format #t "~s~%" result)
  613. (pk 'fail result #f)))))))
  614. (test-assert "texlive->guix-package, translate dependencies"
  615. ;; Replace network resources with sample data.
  616. (mock ((guix build svn) svn-fetch
  617. (lambda* (url revision directory
  618. #:key (svn-command "svn")
  619. (user-name #f)
  620. (password #f)
  621. (recursive? #t))
  622. (mkdir-p directory)
  623. (with-output-to-file (string-append directory "/foo")
  624. (lambda ()
  625. (display "source")))))
  626. (let ((result (texlive->guix-package "collection-basic"
  627. #:package-database
  628. (lambda _ %fake-tlpdb))))
  629. (match result
  630. (('package
  631. ('name "texlive-collection-basic")
  632. ('version _)
  633. ('source _)
  634. ('build-system 'trivial-build-system)
  635. ('arguments
  636. ('list '#:builder ('gexp ('mkdir ('ungexp 'output)))))
  637. ('propagated-inputs
  638. ('list 'texlive-amsfonts 'texlive-hyphen-complete))
  639. ('home-page (? string?))
  640. ('synopsis (? string?))
  641. ('description (? string?))
  642. ('license _))
  643. #true)
  644. (_
  645. (begin
  646. (format #t "~s~%" result)
  647. (pk 'fail result #f)))))))
  648. (test-assert "texlive->guix-package, lonely `hyphen-base' dependency and ARCH"
  649. ;; Replace network resources with sample data.
  650. (mock ((guix build svn) svn-fetch
  651. (lambda* (url revision directory
  652. #:key (svn-command "svn")
  653. (user-name #f)
  654. (password #f)
  655. (recursive? #t))
  656. (mkdir-p directory)
  657. (with-output-to-file (string-append directory "/foo")
  658. (lambda ()
  659. (display "source")))))
  660. (let ((result (texlive->guix-package "tex"
  661. #:package-database
  662. (lambda _ %fake-tlpdb))))
  663. (match result
  664. (('package
  665. ('name "texlive-tex")
  666. ('version _)
  667. ('source _)
  668. ('outputs _)
  669. ('build-system 'texlive-build-system)
  670. ('arguments ('list '#:texlive-latex-bin? #f))
  671. ('propagated-inputs
  672. ('list 'texlive-cm 'texlive-hyphen-base))
  673. ('home-page (? string?))
  674. ('synopsis (? string?))
  675. ('description (? string?))
  676. ('license _))
  677. #true)
  678. (_
  679. (begin
  680. (format #t "~s~%" result)
  681. (pk 'fail result #f)))))))
  682. (test-assert "texlive->guix-package, single script, no extension"
  683. ;; Replace network resources with sample data.
  684. (mock ((guix build svn) svn-fetch
  685. (lambda* (url revision directory
  686. #:key (svn-command "svn")
  687. (user-name #f)
  688. (password #f)
  689. (recursive? #t))
  690. (mkdir-p directory)
  691. (with-output-to-file (string-append directory "/foo")
  692. (lambda ()
  693. (display "source")))))
  694. (let ((result (texlive->guix-package "authorindex"
  695. #:package-database
  696. (lambda _ %fake-tlpdb))))
  697. (match result
  698. (('package
  699. ('name "texlive-authorindex")
  700. ('version _)
  701. ('source _)
  702. ('outputs _)
  703. ('build-system 'texlive-build-system)
  704. ('arguments
  705. ('list '#:link-scripts ('gexp ('list "authorindex"))))
  706. ('home-page (? string?))
  707. ('synopsis (? string?))
  708. ('description (? string?))
  709. ('license _))
  710. #true)
  711. (_
  712. (begin
  713. (format #t "~s~%" result)
  714. (pk 'fail result #f)))))))
  715. (test-assert "texlive->guix-package, multiple scripts, with extensions"
  716. ;; Replace network resources with sample data.
  717. (mock ((guix build svn) svn-fetch
  718. (lambda* (url revision directory
  719. #:key (svn-command "svn")
  720. (user-name #f)
  721. (password #f)
  722. (recursive? #t))
  723. (mkdir-p directory)
  724. (with-output-to-file (string-append directory "/foo")
  725. (lambda ()
  726. (display "source")))))
  727. (let ((result (texlive->guix-package "cyrillic-bin"
  728. #:package-database
  729. (lambda _ %fake-tlpdb))))
  730. (match result
  731. (('package
  732. ('name "texlive-cyrillic-bin")
  733. ('version _)
  734. ('source _)
  735. ('outputs _)
  736. ('build-system 'texlive-build-system)
  737. ('arguments
  738. ('list '#:link-scripts
  739. ('gexp ('list "rubibtex.sh" "rumakeindex.sh"))))
  740. ('home-page _)
  741. ('synopsis _)
  742. ('description _)
  743. ('license _))
  744. #true)
  745. (_
  746. (begin
  747. (format #t "~s~%" result)
  748. (pk 'fail result #f)))))))
  749. (test-assert "texlive->guix-package, script with associated input"
  750. ;; Replace network resources with sample data.
  751. (mock ((guix build svn) svn-fetch
  752. (lambda* (url revision directory
  753. #:key (svn-command "svn")
  754. (user-name #f)
  755. (password #f)
  756. (recursive? #t))
  757. (mkdir-p directory)
  758. (with-output-to-file (string-append directory "/foo")
  759. (lambda ()
  760. (display "source")))))
  761. (let ((result (texlive->guix-package "pax"
  762. #:package-database
  763. (lambda _ %fake-tlpdb))))
  764. (match result
  765. (('package
  766. ('name "texlive-pax")
  767. ('version _)
  768. ('source _)
  769. ('outputs _)
  770. ('build-system 'texlive-build-system)
  771. ('arguments
  772. ('list '#:link-scripts ('gexp ('list "pdfannotextractor.pl"))))
  773. ('inputs
  774. ('list 'perl))
  775. ('home-page _)
  776. ('synopsis _)
  777. ('description _)
  778. ('license _))
  779. #true)
  780. (_
  781. (begin
  782. (format #t "~s~%" result)
  783. (pk 'fail result #f)))))))
  784. (test-end "texlive")