1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
8 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
9 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages tex)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system perl)
32 #:use-module (guix build-system trivial)
33 #:use-module (guix build-system texlive)
34 #:use-module (guix utils)
35 #:use-module (guix git-download)
36 #:use-module (guix svn-download)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages fontutils)
42 #:use-module (gnu packages gd)
43 #:use-module (gnu packages ghostscript)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages icu4c)
46 #:use-module (gnu packages image)
47 #:use-module (gnu packages lua)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages pdf)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages qt)
54 #:use-module (gnu packages ruby)
55 #:use-module (gnu packages shells)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages xml)
59 #:use-module (gnu packages xorg)
60 #:use-module (gnu packages xdisorg)
61 #:use-module (gnu packages zip)
62 #:autoload (gnu packages texinfo) (texinfo)
63 #:use-module (ice-9 ftw)
64 #:use-module (ice-9 match)
65 #:use-module ((srfi srfi-1) #:hide (zip)))
67 (define texlive-extra-src
70 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523-extra.tar.xz")
72 "0q4a92zmwhn4ry6xgrp4k8wq11ax2sg9rg9yrsrdkr719y0x887a"))))
74 (define texlive-texmf-src
77 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-texmf.tar.xz")
78 (patches (search-patches "texlive-texmf-CVE-2016-10243.patch"))
79 (patch-flags '("-p2"))
81 "1dv8vgfzpczqw82hv9g7a8djhhyzywljmrarlcyy6g2qi5q51glr"))))
90 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-source.tar.xz")
92 "1v91vahxlxkdra0qz3f132vvx5d9cx2jy84yl1hkch0agyj2rcx8"))))
93 (build-system gnu-build-system)
95 `(("texlive-extra-src" ,texlive-extra-src)
97 ("fontconfig" ,fontconfig)
98 ("fontforge" ,fontforge)
99 ("freetype" ,freetype)
102 ("ghostscript" ,ghostscript)
103 ("graphite2" ,graphite2)
104 ("harfbuzz" ,harfbuzz)
106 ("libpaper" ,libpaper)
115 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
120 ("zziplib" ,zziplib)))
122 `(("pkg-config" ,pkg-config)))
124 `(#:out-of-source? #t
126 `("--disable-native-texlive-build"
127 "--with-system-cairo"
128 "--with-system-freetype2"
131 "--with-system-graphite2"
132 "--with-system-harfbuzz"
134 "--with-system-libgs"
135 "--with-system-libpaper"
136 "--with-system-libpng"
138 "--with-system-pixman"
139 "--with-system-poppler"
140 "--with-system-potrace"
141 "--with-system-teckit"
144 "--with-system-zziplib")
146 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
147 ;; XXX FIXME fix luajit properly on mips64.
148 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
151 (modify-phases %standard-phases
152 (add-after 'install 'postint
153 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
154 (let* ((out (assoc-ref outputs "out"))
155 (share (string-append out "/share"))
156 (texlive-extra (assoc-ref inputs "texlive-extra-src"))
157 (unpack (assoc-ref %standard-phases 'unpack))
158 (patch-source-shebangs
159 (assoc-ref %standard-phases 'patch-source-shebangs)))
160 ;; Create symbolic links for the latex variants and their
162 (with-directory-excursion (string-append out "/bin/")
164 '("pdftex" "pdftex" "xetex" "luatex")
165 '("latex" "pdflatex" "xelatex" "lualatex")))
166 (with-directory-excursion (string-append share "/man/man1/")
167 (symlink "luatex.1" "lualatex.1"))
168 ;; Unpack texlive-extra and install tlpkg.
169 (mkdir "texlive-extra")
170 (with-directory-excursion "texlive-extra"
171 (apply unpack (list #:source texlive-extra))
172 (apply patch-source-shebangs (list #:source texlive-extra))
173 (system* "mv" "tlpkg" share))))))))
174 (synopsis "TeX Live, a package of the TeX typesetting system")
176 "TeX Live provides a comprehensive TeX document production system.
177 It includes all the major TeX-related programs, macro packages, and fonts
178 that are free software, including support for many languages around the
181 This package contains the binaries.")
182 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
183 (home-page "https://www.tug.org/texlive/")))
185 (define-public texlive-dvips
187 (name "texlive-dvips")
188 (version (number->string %texlive-revision))
192 (url (string-append "svn://www.tug.org/texlive/tags/"
193 %texlive-tag "/Master/texmf-dist/"
195 (revision %texlive-revision)))
198 "1k11yvz4q95bxyxczwvd4r177h6a2gg03xmf51kmgjgz8an2gq2w"))))
199 (build-system trivial-build-system)
201 `(#:modules ((guix build utils))
204 (use-modules (guix build utils))
205 (let ((target (string-append (assoc-ref %outputs "out")
206 "/share/texmf-dist/dvips")))
208 (copy-recursively (assoc-ref %build-inputs "source") target)
210 (home-page "http://www.ctan.org/pkg/dvips")
211 (synopsis "DVI to PostScript drivers")
212 (description "This package provides files needed for converting DVI files
214 ;; Various free software licenses apply to individual files.
215 (license (list license:lppl1.3c+
219 (define-public texlive-generic-unicode-data
221 (name "texlive-generic-unicode-data")
222 (version (number->string %texlive-revision))
226 (url (string-append "svn://www.tug.org/texlive/tags/"
227 %texlive-tag "/Master/texmf-dist/"
228 "/tex/generic/unicode-data"))
229 (revision %texlive-revision)))
232 "0ivrhp6jz31pl4z841g4ws41lmvdiwz4sslmhf02inlib79gz6r2"))))
233 (build-system trivial-build-system)
235 `(#:modules ((guix build utils))
238 (use-modules (guix build utils))
239 (let ((target (string-append (assoc-ref %outputs "out")
240 "/share/texmf-dist/tex/generic/unicode-data")))
242 (copy-recursively (assoc-ref %build-inputs "source") target)
244 (home-page "http://www.ctan.org/pkg/unicode-data")
245 (synopsis "Unicode data and loaders for TeX")
246 (description "This bundle provides generic access to Unicode Consortium
247 data for TeX use. It contains a set of text files provided by the Unicode
248 Consortium which are currently all from Unicode 8.0.0, with the exception of
249 @code{MathClass.txt} which is not currently part of the Unicode Character
250 Database. Accompanying these source data are generic TeX loader files
251 allowing this data to be used as part of TeX runs, in particular in building
252 format files. Currently there are two loader files: one for general character
253 set up and one for initializing XeTeX character classes as has been carried
254 out to date by @code{unicode-letters.tex}. ")
255 (license license:lppl1.3c+)))
257 (define-public texlive-generic-dehyph-exptl
259 (name "texlive-generic-dehyph-exptl")
260 (version (number->string %texlive-revision))
264 (url (string-append "svn://www.tug.org/texlive/tags/"
265 %texlive-tag "/Master/texmf-dist/"
266 "/tex/generic/dehyph-exptl"))
267 (revision %texlive-revision)))
270 "1l9wgv99qq0ysvlxqpj4g8bl0dywbzra4g8m2kmpg2fb0i0hczap"))))
271 (build-system trivial-build-system)
273 `(#:modules ((guix build utils))
276 (use-modules (guix build utils))
277 (let ((target (string-append (assoc-ref %outputs "out")
278 "/share/texmf-dist/tex/generic/dehyph-exptl")))
280 (copy-recursively (assoc-ref %build-inputs "source") target)
282 (home-page "http://projekte.dante.de/Trennmuster/WebHome")
283 (synopsis "Hyphenation patterns for German")
284 (description "The package provides experimental hyphenation patterns for
285 the German language, covering both traditional and reformed orthography. The
286 patterns can be used with packages Babel and hyphsubst from the Oberdiek
288 ;; Hyphenation patterns are under the Expat license; documentation is
290 (license (list license:expat license:lppl))))
292 (define-public texlive-generic-tex-ini-files
294 (name "texlive-generic-tex-ini-files")
295 (version (number->string %texlive-revision))
299 (url (string-append "svn://www.tug.org/texlive/tags/"
300 %texlive-tag "/Master/texmf-dist/"
301 "/tex/generic/tex-ini-files"))
302 (revision %texlive-revision)))
305 "1wh42n1lmzcvi3g6mm31nm3yd5ha5bl260xqc444jg1m9fdp3wz5"))))
306 (build-system trivial-build-system)
308 `(#:modules ((guix build utils))
311 (use-modules (guix build utils))
312 (let ((target (string-append (assoc-ref %outputs "out")
313 "/share/texmf-dist/tex/generic/tex-ini-files")))
315 (copy-recursively (assoc-ref %build-inputs "source") target)
317 (home-page "http://ctan.org/pkg/tex-ini-files")
318 (synopsis "Files for creating TeX formats")
319 (description "This bundle provides a collection of model \".ini\" files
320 for creating TeX formats. These files are commonly used to introduced
321 distribution-dependent variations in formats. They are also used to
322 allow existing format source files to be used with newer engines, for example
323 to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
324 (license license:public-domain)))
326 (define-public texlive-generic-hyph-utf8
328 (name "texlive-generic-hyph-utf8")
329 (version (number->string %texlive-revision))
333 (url (string-append "svn://www.tug.org/texlive/tags/"
334 %texlive-tag "/Master/texmf-dist/"
335 "/tex/generic/hyph-utf8"))
336 (revision %texlive-revision)))
339 "0ghizcz7ps16dzfqf66wwg5i181assc6qsm0g7g5dbmp909931vi"))))
340 (build-system trivial-build-system)
342 `(#:modules ((guix build utils))
345 (use-modules (guix build utils))
346 (let ((target (string-append (assoc-ref %outputs "out")
347 "/share/texmf-dist/tex/generic/hyph-utf8")))
349 (copy-recursively (assoc-ref %build-inputs "source") target)
351 (home-page "http://ctan.org/pkg/hyph-utf8")
352 (synopsis "Hyphenation patterns expressed in UTF-8")
353 (description "Modern native UTF-8 engines such as XeTeX and LuaTeX need
354 hyphenation patterns in UTF-8 format, whereas older systems require
355 hyphenation patterns in the 8-bit encoding of the font in use (such encodings
356 are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
357 etc). The present package offers a collection of conversions of existing
358 patterns to UTF-8 format, together with converters for use with 8-bit fonts in
359 older systems. Since hyphenation patterns for Knuthian-style TeX systems are
360 only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
361 converters, will completely supplant the older patterns.")
362 ;; Individual files each have their own license. Most of these files are
363 ;; independent hyphenation patterns.
364 (license (list license:lppl1.0+
379 license:public-domain
382 (define-public texlive-metafont-base
384 (name "texlive-metafont-base")
385 (version (number->string %texlive-revision))
389 (url (string-append "svn://www.tug.org/texlive/tags/"
390 %texlive-tag "/Master/texmf-dist/"
392 (revision %texlive-revision)))
395 "1yl4n8cn5xqk2nc22zgzq6ymd7bhm6xx1mz3azip7i3ki4bhb5q5"))))
396 (build-system gnu-build-system)
398 `(#:tests? #f ; no test target
400 (modify-phases %standard-phases
403 (lambda* (#:key inputs #:allow-other-keys)
404 (let ((cwd (getcwd)))
406 (string-append cwd "/base:"
413 (with-directory-excursion "build"
414 (zero? (system* "inimf" "mf.mf")))))
416 (lambda* (#:key outputs #:allow-other-keys)
417 (let* ((out (assoc-ref outputs "out"))
418 (base (string-append out "/share/texmf-dist/web2c"))
419 (mf (string-append out "/share/texmf-dist/metafont/base")))
422 (install-file "build/mf.base" base)
423 (copy-recursively "base" mf)
426 `(("texlive-bin" ,texlive-bin)))
427 (home-page "http://www.ctan.org/pkg/metafont")
428 (synopsis "Metafont base files")
429 (description "This package provides the Metafont base files needed to
430 build fonts using the Metafont system.")
431 (license license:knuth)))
433 (define-public texlive-fonts-cm
435 (name "texlive-fonts-cm")
436 (version (number->string %texlive-revision))
440 (url (string-append "svn://www.tug.org/texlive/tags/"
441 %texlive-tag "/Master/texmf-dist/"
442 "/fonts/source/public/cm"))
443 (revision %texlive-revision)))
446 "045k5b9rdmbxpy1a3006l1x96z1rd18vg3cwrvnld9bqybw5qz44"))))
447 (build-system gnu-build-system)
449 `(#:modules ((guix build gnu-build-system)
453 #:tests? #f ; no tests
455 (modify-phases %standard-phases
458 (lambda* (#:key inputs #:allow-other-keys)
459 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
460 ;; Tell mf where to find mf.base
461 (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
462 ;; Tell mf where to look for source files
464 (string-append (getcwd) ":"
465 mf "/share/texmf-dist/metafont/base")))
467 (every (lambda (font)
468 (format #t "building font ~a\n" font)
469 (zero? (system* "mf" "-progname=mf"
470 "-output-directory=build"
476 (basename font ".mf")))))
477 (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))))
479 (lambda* (#:key outputs #:allow-other-keys)
480 (let* ((out (assoc-ref outputs "out"))
482 out "/share/texmf-dist/fonts/tfm/public/cm"))
484 out "/share/texmf-dist/fonts/source/public/cm")))
485 (for-each (cut install-file <> tfm)
486 (find-files "build" "\\.*"))
487 (for-each (cut install-file <> mf)
488 (find-files "." "\\.mf"))
491 `(("texlive-bin" ,texlive-bin)
492 ("texlive-metafont-base" ,texlive-metafont-base)))
493 (home-page "http://www.ctan.org/pkg/cm")
494 (synopsis "Computer Modern fonts for TeX")
495 (description "This package provides the Computer Modern fonts by Donald
496 Knuth. The Computer Modern font family is a large collection of text,
497 display, and mathematical fonts in a range of styles, based on Monotype Modern
499 (license license:knuth)))
501 (define-public texlive-fonts-knuth-lib
503 (name "texlive-fonts-knuth-lib")
504 (version (number->string %texlive-revision))
508 (url (string-append "svn://www.tug.org/texlive/tags/"
509 %texlive-tag "/Master/texmf-dist/"
510 "/fonts/source/public/knuth-lib"))
511 (revision %texlive-revision)))
514 "0in9aqyi8jkyf9d16z0li50z5fpwj1iwgwm83gmvwqcf7chfs04y"))))
515 (build-system gnu-build-system)
517 `(#:modules ((guix build gnu-build-system)
520 #:tests? #f ; no tests
522 (modify-phases %standard-phases
525 (lambda* (#:key inputs #:allow-other-keys)
526 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
527 ;; Tell mf where to find mf.base
529 (string-append mf "/share/texmf-dist/web2c"))
530 ;; Tell mf where to look for source files
532 (string-append (getcwd) ":"
533 mf "/share/texmf-dist/metafont/base")))
535 (zero? (system* "mf" "-progname=mf"
536 "-output-directory=build"
543 (lambda* (#:key outputs #:allow-other-keys)
544 (let* ((out (assoc-ref outputs "out"))
546 out "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
548 out "/share/texmf-dist/fonts/source/public/knuth-lib")))
549 (for-each (cut install-file <> tfm)
550 (find-files "build" "\\.*"))
551 (for-each (cut install-file <> mf)
552 (find-files "." "\\.mf"))
555 `(("texlive-bin" ,texlive-bin)
556 ("texlive-metafont-base" ,texlive-metafont-base)))
557 (home-page "https://www.ctan.org/pkg/knuth-lib")
558 (synopsis "Small library of METAFONT sources")
559 (description "This is a collection of core TeX and METAFONT macro files
560 from Donald Knuth, including the plain format, plain base, and the MF logo
562 (license license:knuth)))
564 (define-public texlive-fonts-latex
566 (name "texlive-fonts-latex")
567 (version (number->string %texlive-revision))
571 (url (string-append "svn://www.tug.org/texlive/tags/"
572 %texlive-tag "/Master/texmf-dist/"
573 "/fonts/source/public/latex-fonts"))
574 (revision %texlive-revision)))
577 "0ypsm4xv9cw0jckk2qc7gi9hcmhf31mrg56pz3llyx3yd9vq2lps"))))
578 (build-system gnu-build-system)
580 `(#:modules ((guix build gnu-build-system)
584 #:tests? #f ; no tests
586 (modify-phases %standard-phases
589 (lambda* (#:key inputs #:allow-other-keys)
590 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
591 ;; Tell mf where to find mf.base
592 (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
593 ;; Tell mf where to look for source files
595 (string-append (getcwd) ":"
596 mf "/share/texmf-dist/metafont/base:"
597 (assoc-ref inputs "texlive-fonts-cm")
598 "/share/texmf-dist/fonts/source/public/cm")))
600 (every (lambda (font)
601 (format #t "building font ~a\n" font)
602 (zero? (system* "mf" "-progname=mf"
603 "-output-directory=build"
609 '("icmcsc10" "icmex10" "icmmi8" "icmsy8" "icmtt8"
610 "ilasy8" "ilcmss8" "ilcmssb8" "ilcmssi8"
611 "lasy5" "lasy6" "lasy7" "lasy8" "lasy9" "lasy10" "lasyb10"
612 "lcircle10" "lcirclew10" "lcmss8" "lcmssb8" "lcmssi8"
613 "line10" "linew10"))))
615 (lambda* (#:key outputs #:allow-other-keys)
616 (let* ((out (assoc-ref outputs "out"))
618 out "/share/texmf-dist/fonts/tfm/public/latex-fonts"))
620 out "/share/texmf-dist/fonts/source/public/latex-fonts")))
621 (for-each (cut install-file <> tfm)
622 (find-files "build" "\\.*"))
623 (for-each (cut install-file <> mf)
624 (find-files "." "\\.mf"))
627 `(("texlive-bin" ,texlive-bin)
628 ("texlive-metafont-base" ,texlive-metafont-base)
629 ("texlive-fonts-cm" ,texlive-fonts-cm)))
630 (home-page "http://www.ctan.org/pkg/latex-fonts")
631 (synopsis "Collection of fonts used in LaTeX distributions")
632 (description "This is a collection of fonts for use with standard LaTeX
633 packages and classes. It includes invisible fonts (for use with the slides
634 class), line and circle fonts (for use in the picture environment) and LaTeX
636 (license license:lppl1.2+)))
638 ;; This provides etex.src which is needed to build various formats, including
639 ;; luatex.fmt and pdflatex.fmt
640 (define-public texlive-tex-plain
642 (name "texlive-tex-plain")
643 (version (number->string %texlive-revision))
647 (url (string-append "svn://www.tug.org/texlive/tags/"
648 %texlive-tag "/Master/texmf-dist/"
650 (revision %texlive-revision)))
653 "1ifmbyl3ir8k0v1g25xjb5rcyy5vhj8a3fa2088nczga09hna5vn"))))
654 (build-system trivial-build-system)
656 `(#:modules ((guix build utils))
659 (use-modules (guix build utils))
660 (let ((target (string-append (assoc-ref %outputs "out")
661 "/share/texmf-dist/tex/plain")))
663 (copy-recursively (assoc-ref %build-inputs "source") target)
665 (home-page "https://www.ctan.org/pkg/plain")
666 (synopsis "Plain TeX format and supporting files")
668 "Contains files used to build the Plain TeX format, as described in the
669 TeXbook, together with various supporting files (some also discussed in the
671 (license license:knuth)))
673 (define-public texlive-latex-base
679 (url (string-append "svn://www.tug.org/texlive/tags/"
680 %texlive-tag "/Master/texmf-dist/"
682 (revision %texlive-revision)))
683 (sha256 (base32 hash))))))
685 (name "texlive-latex-base")
686 (version (number->string %texlive-revision))
689 (uri (texlive-ref "latex" "base"))
692 "1h9pir2hz6i9avc4lrl733p3zf4rpkg8537x1zdbhs91hvhikw9k"))))
693 (build-system gnu-build-system)
695 `(#:modules ((guix build gnu-build-system)
700 #:tests? #f ; no tests
702 (modify-phases %standard-phases
705 (lambda* (#:key inputs #:allow-other-keys)
706 ;; Find required fonts
708 (string-append (assoc-ref inputs "texlive-fonts-cm")
709 "/share/texmf-dist/fonts/tfm/public/cm:"
710 (assoc-ref inputs "texlive-fonts-latex")
711 "/share/texmf-dist/fonts/tfm/public/latex-fonts:"
712 (assoc-ref inputs "texlive-fonts-knuth-lib")
713 "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
719 (append-map (match-lambda
723 (eq? 'directory (stat:type stat)))
729 ;; Create an empty texsys.cfg, because latex.ltx wants to include
730 ;; it. This file must exist and it's fine if it's empty.
731 (with-output-to-file "texsys.cfg"
732 (lambda _ (format #t "%")))
736 (and (zero? (system* "luatex" "-ini" "-interaction=batchmode"
737 "-output-directory=build"
739 ;; LaTeX and XeTeX require e-TeX, which is enabled only in
740 ;; extended mode (activated with a leading asterisk). We
741 ;; should not use luatex here, because that would make the
742 ;; generated format files incompatible with any other TeX
745 ;; FIXME: XeTeX fails to build because neither
746 ;; \XeTeXuseglyphmetrics nor \XeTeXdashbreakstate are
750 (zero? (system* "latex" "-ini" "-interaction=batchmode"
751 "-output-directory=web2c"
752 "-translate-file=cp227.tcx"
753 (string-append "*" format ".ini"))))
758 (zero? (system* "luatex" "-ini" "-interaction=batchmode"
759 "-output-directory=web2c"
760 (string-append format ".ini"))))
761 '("dviluatex" "dvilualatex" "luatex" "lualatex" "xelatex")))))
763 (lambda* (#:key outputs #:allow-other-keys)
764 (let* ((out (assoc-ref outputs "out"))
765 (target (string-append
766 out "/share/texmf-dist/tex/latex/base"))
767 (web2c (string-append
768 out "/share/texmf-dist/web2c")))
771 (for-each delete-file (find-files "." "\\.(log|aux)$"))
772 (for-each (cut install-file <> target)
773 (find-files "build" ".*"))
774 (for-each (cut install-file <> web2c)
775 (find-files "web2c" ".*"))
778 `(("texlive-bin" ,texlive-bin)
779 ("texlive-generic-unicode-data" ,texlive-generic-unicode-data)
780 ("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl)
781 ("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files)
782 ("texlive-latex-latexconfig"
783 ,(texlive-dir "tex/latex/latexconfig/"
784 "1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf"))
785 ("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8)
786 ("texlive-generic-hyphen"
787 ,(texlive-dir "tex/generic/hyphen/"
788 "0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd"))
789 ("texlive-generic-ruhyphen"
790 ,(texlive-dir "tex/generic/ruhyphen/"
791 "14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd"))
792 ("texlive-generic-ukrhyph"
793 ,(texlive-dir "tex/generic/ukrhyph/"
794 "1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv"))
795 ("texlive-generic-config"
796 ,(texlive-dir "tex/generic/config/"
797 "19vj088p4kkp6xll0141m4kl6ssgdzhs3g10i232khb07aqiag8s"))
798 ("texlive-tex-plain" ,texlive-tex-plain)
799 ("texlive-fonts-cm" ,texlive-fonts-cm)
800 ("texlive-fonts-latex" ,texlive-fonts-latex)
801 ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)))
802 (home-page "http://www.ctan.org/pkg/latex-base")
803 (synopsis "Base sources of LaTeX")
805 "This bundle comprises the source of LaTeX itself, together with several
806 packages which are considered \"part of the kernel\". This bundle, together
807 with the required packages, constitutes what every LaTeX distribution should
809 (license license:lppl1.3c+))))
811 (define-public texlive-latex-filecontents
813 (name "texlive-latex-filecontents")
814 (version (number->string %texlive-revision))
817 (uri (texlive-ref "latex" "filecontents"))
820 "0swkbxv8vg0yizadfnvrwjb4cj0pn34v9wm6v7wqq903fdav7k7q"))))
821 (build-system texlive-build-system)
822 (arguments '(#:tex-directory "latex/filecontents"))
823 (home-page "http://www.ctan.org/pkg/filecontents")
824 (synopsis "Extended filecontents and filecontents* environments")
826 "LaTeX2e's @code{filecontents} and @code{filecontents*} environments
827 enable a LaTeX source file to generate external files as it runs through
828 LaTeX. However, there are two limitations of these environments: they refuse
829 to overwrite existing files, and they can only be used in the preamble of a
830 document. The filecontents package removes these limitations, letting you
831 overwrite existing files and letting you use @code{filecontents} /
832 @code{filecontents*} anywhere.")
833 (license license:lppl1.3c+)))
835 (define-public texlive-generic-ifxetex
837 (name "texlive-generic-ifxetex")
841 (uri (texlive-ref "generic" "ifxetex"))
844 "0w2xj7n0szavj329kds09q626szkc378p3w0sk022q0ln4ksz86d"))))
845 (build-system texlive-build-system)
847 '(#:tex-directory "generic/ifxetex"
848 #:tex-format "xelatex"))
850 `(("texlive-latex-filecontents" ,texlive-latex-filecontents)))
851 (home-page "http://www.ctan.org/pkg/ifxetex")
852 (synopsis "Am I running under XeTeX?")
854 "This is a simple package which provides an @code{\\ifxetex} conditional,
855 so that other code can determine that it is running under XeTeX. The package
856 requires the etexe-TeX extensions to the TeX primitive set.")
857 (license license:lppl1.3c+)))
859 (define-public texlive-latex-fancyvrb
861 (name "texlive-latex-fancyvrb")
862 (version (number->string %texlive-revision))
865 (uri (texlive-ref "latex" "fancyvrb"))
868 "03l7140y031rr14h02i4z9zqsfvrbn7wzwxbjsrjcgrk6sdr71wv"))))
869 (build-system texlive-build-system)
871 '(#:tex-directory "latex/fancyvrb"
872 ;; We exclude "fvrb-ex" to avoid a dependency on texlive-luaotfload and
873 ;; thus texlive-luatex-lualibs.
874 #:build-targets '("fancyvrb.ins")))
875 (home-page "http://www.ctan.org/pkg/fancyvrb")
876 (synopsis "Sophisticated verbatim text")
878 "This package provides tools for the flexible handling of verbatim text
879 including: verbatim commands in footnotes; a variety of verbatim environments
880 with many parameters; ability to define new customized verbatim environments;
881 save and restore verbatim text and environments; write and read files in
882 verbatim mode; build \"example\" environments (showing both result and
884 (license license:lppl1.0+)))
886 (define-public texlive-latex-graphics
888 (name "texlive-latex-graphics")
889 (version (number->string %texlive-revision))
892 (uri (texlive-ref "latex" "graphics"))
895 "17ka701xr9nqsjlhz30hphr8d9j4zzwgv5zl5r2f118yzqh9c34v"))))
896 (build-system texlive-build-system)
898 '(#:tex-directory "latex/graphics"
900 (modify-phases %standard-phases
901 (add-after 'install 'install-config
902 (lambda* (#:key inputs outputs #:allow-other-keys)
903 (let ((cfg (assoc-ref inputs "graphics-cfg"))
904 (target (string-append (assoc-ref outputs "out")
905 "/share/texmf-dist/tex/latex/graphics-cfg")))
907 (install-file (string-append cfg "/graphics.cfg") target)
908 (install-file (string-append cfg "/color.cfg") target)
910 (add-after 'install 'install-defs
911 (lambda* (#:key inputs outputs #:allow-other-keys)
912 (let ((def (assoc-ref inputs "graphics-def"))
913 (target (string-append (assoc-ref outputs "out")
914 "/share/texmf-dist/tex/latex/graphics-def")))
916 (copy-recursively def target)
923 (url "https://github.com/latex3/graphics-cfg.git")
924 (commit "19d1238af17df376cd46333b229579b0f7f3a41f")))
927 "12kbgbm52gmmgn8zajb74s8n5rvnxcfdvs3iyj8vcw5vrsw5i6mh"))))
932 (url (string-append "svn://www.tug.org/texlive/tags/"
933 %texlive-tag "/Master/texmf-dist/"
934 "/tex/latex/graphics-def"))
935 (revision %texlive-revision)))
938 "1q5l0x3jsy74v0zq4c9g0x0rb9jfzf7cbhdzkbchyydv49iav802"))))))
939 (home-page "http://www.ctan.org/pkg/latex-graphics")
940 (synopsis "LaTeX standard graphics bundle")
942 "This is a collection of LaTeX packages for producing color, including
943 graphics (e.g. PostScript) files, and rotation and scaling of text in LaTeX
944 documents. It comprises the packages color, graphics, graphicx, trig, epsfig,
945 keyval, and lscape.")
946 ;; The configuration files are released under CC0.
947 (license (list license:lppl1.3c+
950 (define-public texlive-latex-xcolor
952 (name "texlive-latex-xcolor")
953 (version (number->string %texlive-revision))
956 (uri (texlive-ref "latex" "xcolor"))
959 "01n613s7bcrd2n4jfawm0k4nn2ny3aaifp2jjfif3lz4sbv31494"))))
960 (build-system texlive-build-system)
961 (arguments '(#:tex-directory "latex/xcolor"))
962 (home-page "http://www.ctan.org/pkg/xcolor")
963 (synopsis "Driver-independent color extensions for LaTeX and pdfLaTeX")
965 "The package starts from the basic facilities of the colorcolor package,
966 and provides easy driver-independent access to several kinds of color tints,
967 shades, tones, and mixes of arbitrary colors. It allows a user to select a
968 document-wide target color model and offers complete tools for conversion
969 between eight color models. Additionally, there is a command for alternating
970 row colors plus repeated non-aligned material (like horizontal lines) in
972 (license license:lppl1.2+)))
974 (define-public texlive-latex-hyperref
976 (name "texlive-latex-hyperref")
978 ;; The sources in the TeX Live SVN repository do not contain hluatex.dtx,
979 ;; so we fetch the release from GitHub.
982 (uri (string-append "https://github.com/ho-tex/hyperref/"
983 "archive/release-" version ".tar.gz"))
984 (file-name (string-append name "-" version ".tar.gz"))
987 "1d3rmjgzh0025a1dza55zb6nzzlgd1y9snwx45wq1c1vf42m79h2"))))
988 (build-system texlive-build-system)
989 (arguments '(#:tex-directory "latex/hyperref"))
990 (home-page "http://www.ctan.org/pkg/hyperref")
991 (synopsis "Extensive support for hypertext in LaTeX")
993 "The hyperref package is used to handle cross-referencing commands in
994 LaTeX to produce hypertext links in the document. The package provides
995 backends for the special set defined for HyperTeX DVI processors; for embedded
996 pdfmark commands for processing by Acrobat Distiller (dvips and dvipsone); for
997 dviwindo; for PDF control within pdfTeX and dvipdfm; for TeX4ht; and for VTeX
998 pdf and HTML backends. The package is distributed with the backref and
999 nameref packages, which make use of the facilities of hyperref.")
1000 (license license:lppl1.3+)))
1002 (define-public texlive-latex-oberdiek
1004 (name "texlive-latex-oberdiek")
1005 (version (number->string %texlive-revision))
1008 (uri (texlive-ref "latex" "oberdiek"))
1011 "0aswvsxgsn709xmvpcg50d2xl7vcy1ckdxb9c1cligqqfjjvviqf"))))
1012 (build-system texlive-build-system)
1014 '(#:tex-directory "latex/oberdiek"
1016 (modify-phases %standard-phases
1017 ;; "ifpdf.ins" is not generated, so we cannot process it.
1018 (add-after 'unpack 'do-not-process-ifpdf.ins
1020 (substitute* "oberdiek.ins"
1021 (("\\\\batchinput\\{ifpdf.ins\\}") ""))
1023 (home-page "http://www.ctan.org/pkg/oberdiek")
1024 (synopsis "Bundle of packages submitted by Heiko Oberdiek")
1026 "The bundle comprises various LaTeX packages, providing among others:
1027 better accessibility support for PDF files; extensible chemists reaction
1028 arrows; record information about document class(es) used; and many more.")
1029 (license license:lppl1.3+)))
1031 (define-public texlive-latex-tools
1033 (name "texlive-latex-tools")
1034 (version (number->string %texlive-revision))
1037 (uri (texlive-ref "latex" "tools"))
1040 "052a0pch2k5zls5jlay9xxcf93rw3i60a2x28y3ip3rhbsv3xgiz"))))
1041 (build-system texlive-build-system)
1043 '(#:tex-directory "latex/tools"
1044 #:build-targets '("tools.ins")))
1045 (home-page "http://www.ctan.org/pkg/latex-tools")
1046 (synopsis "LaTeX standard tools bundle")
1048 "This package is a collection of (variously) simple tools provided as
1049 part of the LaTeX required tools distribution, comprising the following
1050 packages: afterpage, array, bm, calc, dcolumn, delarray, enumerate, fileerr,
1051 fontsmpl, ftnright, hhline, indentfirst, layout, longtable, multicol,
1052 rawfonts, showkeys, somedefs, tabularx, theorem, trace, varioref, verbatim,
1054 (license license:lppl1.3+)))
1056 (define-public texlive-latex-url
1058 (name "texlive-latex-url")
1059 (version (number->string %texlive-revision))
1063 (url (string-append "svn://www.tug.org/texlive/tags/"
1064 %texlive-tag "/Master/texmf-dist/"
1066 (revision %texlive-revision)))
1069 "184s2543cwia5l7iibhlkl1ffbncfhjpv5p56zq0c15by5sghlac"))))
1070 (build-system trivial-build-system)
1072 `(#:modules ((guix build utils))
1075 (use-modules (guix build utils))
1076 (let ((target (string-append (assoc-ref %outputs "out")
1077 "/share/texmf-dist/tex/latex/url")))
1079 (copy-recursively (assoc-ref %build-inputs "source") target)
1081 (home-page "https://www.ctan.org/pkg/url")
1082 (synopsis "Verbatim with URL-sensitive line breaks")
1083 (description "The command @code{\\url} is a form of verbatim command that
1084 allows linebreaks at certain characters or combinations of characters, accepts
1085 reconfiguration, and can usually be used in the argument to another command.
1086 The command is intended for email addresses, hypertext links,
1087 directories/paths, etc., which normally have no spaces, so by default the
1088 package ignores spaces in its argument. However, a package option allows
1089 spaces, which is useful for operating systems where spaces are a common part
1091 ;; The license header states that it is under LPPL version 2 or later, but
1092 ;; the latest version is 1.3c.
1093 (license license:lppl1.3c+)))
1095 (define-public texlive-latex-l3kernel
1097 (name "texlive-latex-l3kernel")
1098 (version (number->string %texlive-revision))
1101 (uri (texlive-ref "latex" "l3kernel"))
1104 "0ndqw0flhl20f4ny5lssp8rqpnj5kglyg59whbdrxbh2zc7w7j0b"))))
1105 (build-system texlive-build-system)
1107 '(#:tex-directory "latex/l3kernel"))
1108 (home-page "http://www.ctan.org/pkg/l3kernel")
1109 (synopsis "LaTeX3 programmers’ interface")
1111 "The l3kernel bundle provides an implementation of the LaTeX3
1112 programmers’ interface, as a set of packages that run under LaTeX 2e. The
1113 interface provides the foundation on which the LaTeX3 kernel and other future
1114 code are built: it is an API for TeX programmers. The packages are set up so
1115 that the LaTeX3 conventions can be used with regular LaTeX 2e packages.")
1116 (license license:lppl1.3c+)))
1118 (define-public texlive-latex-l3packages
1120 (name "texlive-latex-l3packages")
1121 (version (number->string %texlive-revision))
1124 (uri (texlive-ref "latex" "l3packages"))
1127 "1p1y9my6ccmp2ab91fzqqgih8ifrk4y3wyh397kagiq9f6a6v91f"))))
1128 (build-system texlive-build-system)
1130 '(#:tex-directory "latex/l3packages"
1132 (modify-phases %standard-phases
1133 ;; All package sources are in sub-directories, so we need to add them
1135 (add-after 'unpack 'set-TEXINPUTS
1137 (let ((cwd (getcwd)))
1139 (string-append cwd "/l3keys2e:"
1146 `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1147 (home-page "http://www.ctan.org/pkg/l3packages")
1148 (synopsis "High-level LaTeX3 concepts")
1150 "This bundle holds prototype implementations of concepts for a LaTeX
1151 designer interface, to be used with the experimental LaTeX kernel as
1152 programming tools and kernel support. Packages provided in this release are:
1155 @item l3keys2e, which makes the facilities of the kernel module l3keys
1156 available for use by LaTeX 2e packages;
1157 @item xfrac, which provides flexible splitlevel fractions;
1158 @item xparse, which provides a high-level interface for declaring document
1160 @item xtemplate, which provides a means of defining generic functions using a
1163 (license license:lppl1.3c+)))
1165 (define-public texlive-latex-fontspec
1167 (name "texlive-latex-fontspec")
1168 (version (number->string %texlive-revision))
1171 (uri (texlive-ref "latex" "fontspec"))
1174 "1rx43y5xmjqvc27pjdnmqwp4pcw3czcfd6nfpmzc1gnqfl1hlc0q"))))
1175 (build-system texlive-build-system)
1177 '(#:tex-directory "latex/fontspec"
1178 #:build-targets '("fontspec.dtx")))
1180 `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1181 (home-page "http://www.ctan.org/pkg/fontspec")
1182 (synopsis "Advanced font selection in XeLaTeX and LuaLaTeX")
1184 "Fontspec is a package for XeLaTeX and LuaLaTeX. It provides an
1185 automatic and unified interface to feature-rich AAT and OpenType fonts through
1186 the NFSS in LaTeX running on XeTeX or LuaTeX engines. The package requires
1187 the l3kernel and xparse bundles from the LaTeX 3 development team.")
1188 (license license:lppl1.3+)))
1190 ;; The SVN directory contains little more than a dtx file that generates three
1191 ;; of the many lua files that should be installed as part of this package.
1192 ;; This is why we take the release from GitHub instead.
1193 (define-public texlive-luatex-lualibs
1195 (name "texlive-luatex-lualibs")
1199 (uri (string-append "https://github.com/lualatex/lualibs/"
1200 "releases/download/v"
1201 version "/lualibs.zip"))
1204 "1xx9blvrmx9hyhrl345lpai9m6xxnw997261a1ahn1bm5r2j5fqy"))))
1205 (build-system gnu-build-system)
1208 (list (string-append "DESTDIR="
1209 (assoc-ref %outputs "out")
1210 "/share/texmf-dist"))
1212 (modify-phases %standard-phases
1213 (delete 'configure))))
1215 `(("texlive-bin" ,texlive-bin)
1218 (home-page "https://github.com/lualatex/lualibs")
1219 (synopsis "Lua modules for general programming (in the (La)TeX world)")
1221 "Lualibs is a collection of Lua modules useful for general programming.
1222 The bundle is based on Lua modules shipped with ConTeXt, and made available in
1223 this bundle for use independent of ConTeXt.")
1224 ;; GPL version 2 only
1225 (license license:gpl2)))
1227 (define-public texlive-latex-amsmath
1229 (name "texlive-latex-amsmath")
1230 (version (number->string %texlive-revision))
1233 (uri (texlive-ref "latex" "amsmath"))
1236 "178ywjpdlv78qmfzqdyn6gy14620zjsn2q9wap76fbr9s4hw6dba"))))
1237 (build-system texlive-build-system)
1238 (arguments '(#:tex-directory "latex/amsmath"))
1239 (home-page "http://www.ctan.org/pkg/amsmath")
1240 (synopsis "AMS mathematical facilities for LaTeX")
1242 "This is the principal package in the AMS-LaTeX distribution. It adapts
1243 for use in LaTeX most of the mathematical features found in AMS-TeX; it is
1244 highly recommended as an adjunct to serious mathematical typesetting in LaTeX.
1245 When amsmath is loaded, AMS-LaTeX packages @code{amsbsyamsbsy} (for bold
1246 symbols), @code{amsopnamsopn} (for operator names) and
1247 @code{amstextamstext} (for text embedded in mathematics) are also loaded.
1248 This package is part of the LaTeX required distribution; however, several
1249 contributed packages add still further to its appeal; examples are
1250 @code{empheqempheq}, which provides functions for decorating and highlighting
1251 mathematics, and @code{ntheoremntheorem}, for specifying theorem (and similar)
1253 (license license:lppl1.3c+)))
1255 (define-public texlive-latex-amscls
1257 (name "texlive-latex-amscls")
1258 (version (number->string %texlive-revision))
1261 (uri (texlive-ref "latex" "amscls"))
1264 "0jmcr37mcdi7drczppvr6lmz5d5yd9m67ii79gp2nglg1xpw934j"))))
1265 (build-system texlive-build-system)
1267 `(#:tex-directory "latex/amscls"))
1268 (home-page "http://www.ctan.org/pkg/amscls")
1269 (synopsis "AMS document classes for LaTeX")
1271 "This bundle contains three AMS classes: @code{amsartamsart} (for writing
1272 articles for the AMS), @code{amsbookamsbook} (for books) and
1273 @code{amsprocamsproc} (for proceedings), together with some supporting
1274 material. The material is made available as part of the AMS-LaTeX
1276 (license license:lppl1.3c+)))
1278 (define-public texlive-latex-babel
1280 (name "texlive-latex-babel")
1281 (version (number->string %texlive-revision))
1284 (uri (texlive-ref "latex" "babel"))
1287 "1n3i5adsyy7jw0imnzrm2i8wkf73i3mjk9h3ic8cb9cd19i4r9r3"))))
1288 (build-system texlive-build-system)
1290 '(#:tex-directory "latex/babel"
1292 (modify-phases %standard-phases
1293 ;; This package tries to produce babel.aux twice but refuses to
1294 ;; overwrite the first one.
1295 (add-before 'build 'fix-ins
1297 (substitute* "babel.ins"
1298 (("askonceonly") "askforoverwritefalse"))
1300 (home-page "http://www.ctan.org/pkg/babel")
1301 (synopsis "Multilingual support for Plain TeX or LaTeX")
1303 "The package manages culturally-determined typographical (and other)
1304 rules, and hyphenation patterns for a wide range of languages. A document may
1305 select a single language to be supported, or it may select several, in which
1306 case the document may switch from one language to another in a variety of
1307 ways. Babel uses contributed configuration files that provide the detail of
1308 what has to be done for each language. Users of XeTeX are advised to use the
1309 polyglossia package rather than Babel.")
1310 (license license:lppl1.3+)))
1312 (define-public texlive-latex-cyrillic
1314 (name "texlive-latex-cyrillic")
1315 (version (number->string %texlive-revision))
1318 (uri (texlive-ref "latex" "cyrillic"))
1321 "1mdhl35hwas68ki56qqngzar37dwv4mm64l2canihr255bz34lbv"))))
1322 (build-system texlive-build-system)
1324 '(#:tex-directory "latex/cyrillic"))
1325 (home-page "http://www.ctan.org/pkg/latex-cyrillic")
1326 (synopsis "Support for Cyrillic fonts in LaTeX")
1328 "This bundle of macros files provides macro support (including font
1329 encoding macros) for the use of Cyrillic characters in fonts encoded under the
1330 T2* and X2 encodings. These encodings cover (between them) pretty much every
1331 language that is written in a Cyrillic alphabet.")
1332 (license license:lppl1.3c+)))
1334 (define-public texlive-latex-psnfss
1336 (name "texlive-latex-psnfss")
1337 (version (number->string %texlive-revision))
1340 (uri (texlive-ref "latex" "psnfss"))
1343 "1920dcq8613yzprasbg80fh4fcjcidvvl54wkx438nimyxcri7qz"))))
1344 (build-system texlive-build-system)
1345 (arguments '(#:tex-directory "latex/psnfss"))
1346 (home-page "http://www.ctan.org/pkg/psnfss")
1347 (synopsis "Font support for common PostScript fonts")
1349 "The PSNFSS collection includes a set of files that provide a complete
1350 working setup of the LaTeX font selection scheme (NFSS2) for use with common
1351 PostScript fonts. It covers the so-called \"Base\" fonts (which are built
1352 into any Level 2 PostScript printing device and the Ghostscript interpreter)
1353 and a number of free fonts. It provides font definition files, macros and
1354 font metrics. The bundle as a whole is part of the LaTeX required set of
1356 (license license:lppl1.2+)))
1358 (define-public texlive-union
1359 (lambda* (#:optional (packages '()))
1360 "Return 'texlive-union' package which is a union of PACKAGES and the
1361 standard LaTeX packages."
1362 (let ((default-packages
1367 texlive-metafont-base
1369 ;; LaTeX packages from the "required" set.
1370 texlive-latex-amsmath
1371 texlive-latex-amscls
1373 texlive-latex-cyrillic
1374 texlive-latex-graphics
1375 texlive-latex-psnfss
1376 texlive-latex-tools)))
1378 (name "texlive-union")
1379 (version (number->string %texlive-revision))
1381 (build-system trivial-build-system)
1383 '(#:modules ((guix build union)
1385 (guix build texlive-build-system)
1386 (guix build gnu-build-system)
1387 (guix build gremlin)
1391 (use-modules (ice-9 match)
1395 (guix build texlive-build-system))
1396 (let* ((out (assoc-ref %outputs "out"))
1397 (texmf.cnf (string-append out "/share/texmf-dist/web2c/texmf.cnf")))
1398 ;; Build a modifiable union of all inputs (but exclude bash)
1399 (match (filter (match-lambda
1401 (not (string=? "bash" name))))
1403 (((names . directories) ...)
1404 (union-build (assoc-ref %outputs "out")
1406 #:create-all-directories? #t)))
1408 ;; The configuration file "texmf.cnf" is provided by the
1409 ;; "texlive-bin" package. We take it and override only the
1410 ;; setting for TEXMFROOT and TEXMF. This file won't be consulted
1411 ;; by default, though, so we still need to set TEXMFCNF.
1412 (substitute* texmf.cnf
1413 (("^TEXMFROOT = .*")
1414 (string-append "TEXMFROOT = " out "/share\n"))
1416 "TEXMF = $TEXMFROOT/share/texmf-dist\n"))
1417 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash")
1420 (cut wrap-program <>
1421 `("TEXMFCNF" ":" = (,(dirname texmf.cnf)))
1422 `("TEXMF" ":" = (,(string-append out "/share/texmf-dist"))))
1423 (find-files (string-append out "/bin") ".*"))
1427 ,@(map (lambda (package)
1428 (list (package-name package) package))
1429 (append default-packages packages))))
1430 (home-page (package-home-page texlive-bin))
1431 (synopsis "Union of TeX Live packages")
1432 (description "This package provides a subset of the TeX Live
1434 (license (fold (lambda (package result)
1435 (match (package-license package)
1437 (append lst result))
1438 ((? license:license? license)
1439 (cons license result))))
1441 (append default-packages packages)))))))
1443 (define texlive-texmf
1445 (name "texlive-texmf")
1447 (source texlive-texmf-src)
1448 (build-system gnu-build-system)
1450 `(("texlive-bin" ,texlive-bin)
1453 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
1457 `(#:modules ((guix build gnu-build-system)
1461 ;; This package takes 4 GiB, which we can't afford to distribute from
1466 (modify-phases (map (cut assq <> %standard-phases)
1467 '(set-paths unpack patch-source-shebangs))
1468 (add-after 'patch-source-shebangs 'install
1469 (lambda* (#:key outputs #:allow-other-keys)
1470 (let ((share (string-append (assoc-ref outputs "out") "/share")))
1472 (system* "mv" "texmf-dist" share))))
1473 (add-after 'install 'texmf-config
1474 (lambda* (#:key inputs outputs #:allow-other-keys)
1475 (let* ((out (assoc-ref outputs "out"))
1476 (share (string-append out "/share"))
1477 (texmfroot (string-append share "/texmf-dist/web2c"))
1478 (texmfcnf (string-append texmfroot "/texmf.cnf"))
1479 (texlive-bin (assoc-ref inputs "texlive-bin"))
1480 (texbin (string-append texlive-bin "/bin"))
1481 (tlpkg (string-append texlive-bin "/share/tlpkg")))
1482 ;; Register SHARE as TEXMFROOT in texmf.cnf.
1483 (substitute* texmfcnf
1484 (("TEXMFROOT = \\$SELFAUTOPARENT")
1485 (string-append "TEXMFROOT = " share))
1486 (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
1487 "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
1488 (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
1489 ;; Register paths in texmfcnf.lua, needed for context.
1490 (substitute* (string-append texmfroot "/texmfcnf.lua")
1491 (("selfautodir:") out)
1492 (("selfautoparent:") (string-append share "/")))
1493 ;; Set path to TeXLive Perl modules
1495 (string-append (getenv "PERL5LIB") ":" tlpkg))
1496 ;; Configure the texmf-dist tree; inspired from
1497 ;; http://slackbuilds.org/repository/13.37/office/texlive/
1498 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
1499 (setenv "TEXMFCNF" texmfroot)
1500 (system* "updmap-sys" "--nohash" "--syncwithtrees")
1501 (system* "mktexlsr")
1502 (system* "fmtutil-sys" "--all")))))))
1503 (properties `((max-silent-time . 9600))) ; don't time out while grafting
1504 (synopsis "TeX Live, a package of the TeX typesetting system")
1506 "TeX Live provides a comprehensive TeX document production system.
1507 It includes all the major TeX-related programs, macro packages, and fonts
1508 that are free software, including support for many languages around the
1511 This package contains the complete tree of texmf-dist data.")
1512 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1513 (home-page "https://www.tug.org/texlive/")))
1515 (define-public texlive
1520 (build-system trivial-build-system)
1521 (inputs `(("bash" ,bash) ; for wrap-program
1522 ("texlive-bin" ,texlive-bin)
1523 ("texlive-texmf" ,texlive-texmf)))
1524 (native-search-paths
1525 (list (search-path-specification
1526 (variable "TEXMFLOCAL")
1527 (files '("share/texmf-local")))))
1529 `(#:modules ((guix build utils))
1531 ;; Build the union of texlive-bin and texlive-texmf, but take the
1532 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
1534 (use-modules (guix build utils))
1535 (let ((out (assoc-ref %outputs "out"))
1536 (bin (assoc-ref %build-inputs "texlive-bin"))
1537 (texmf (assoc-ref %build-inputs "texlive-texmf"))
1538 (bash (assoc-ref %build-inputs "bash")))
1540 (with-directory-excursion out
1543 (symlink (string-append bin "/" name) name))
1546 (with-directory-excursion "bin"
1547 (setenv "PATH" (string-append bash "/bin"))
1550 (symlink name (basename name))
1554 (,(string-append texmf "/share/texmf-dist/web2c")))))
1555 (find-files (string-append bin "/bin/") "")))
1557 (with-directory-excursion "share"
1560 (symlink (string-append bin "/share/" name) name))
1561 '("info" "man" "tlpkg"))
1564 (symlink (string-append texmf "/share/" name) name))
1565 '("texmf-dist" "texmf-var"))))))))
1566 (synopsis "TeX Live, a package of the TeX typesetting system")
1568 "TeX Live provides a comprehensive TeX document production system.
1569 It includes all the major TeX-related programs, macro packages, and fonts
1570 that are free software, including support for many languages around the
1573 This package contains the complete TeX Live distribution.")
1574 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1575 (home-page "https://www.tug.org/texlive/")))
1578 ;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
1579 ;; in particular dropping documentation and fonts. It weighs in at 470 MiB
1580 ;; instead of 4 GiB.
1581 (define texlive-texmf-minimal
1582 (package (inherit texlive-texmf)
1583 (name "texlive-texmf-minimal")
1585 (substitute-keyword-arguments
1586 (package-arguments texlive-texmf)
1587 ((#:modules modules)
1592 `(modify-phases ,phases
1593 (add-after 'unpack 'prune
1595 (define (delete subdir exclude)
1596 "Delete all files and directories in SUBDIR except for those
1597 given in the list EXCLUDE."
1598 (with-directory-excursion subdir
1599 (for-each delete-file-recursively
1600 (lset-difference equal?
1604 (with-directory-excursion "texmf-dist"
1605 (for-each delete-file-recursively
1606 '("doc" "source" "tex4ht"))
1607 ;; Delete all subdirectories of "fonts", except for "tfm" and
1608 ;; any directories named "cm".
1609 (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
1610 (delete "fonts/afm" '("public"))
1611 (delete "fonts/afm/public" '("amsfonts"))
1612 (delete "fonts/afm/public/amsfonts" '("cm"))
1613 (delete "fonts/map" '("dvips"))
1614 (delete "fonts/map/dvips" '("cm"))
1615 (delete "fonts/source" '("public"))
1616 (delete "fonts/source/public" '("cm"))
1617 (delete "fonts/tfm" '("public"))
1618 (delete "fonts/type1" '("public"))
1619 (delete "fonts/type1/public" '("amsfonts"))
1620 (delete "fonts/type1/public/amsfonts" '("cm")))
1623 "TeX Live provides a comprehensive TeX document production system.
1624 It includes all the major TeX-related programs, macro packages, and fonts
1625 that are free software, including support for many languages around the
1628 This package contains a small subset of the texmf-dist data.")))
1631 ;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal
1632 ;; instead of the full texlive-texmf. It can be used, for instance, as a
1633 ;; native input to packages that need texlive to build their documentation.
1634 (define-public texlive-minimal
1635 (package (inherit texlive)
1636 (name "texlive-minimal")
1638 `(("texlive-texmf" ,texlive-texmf-minimal)
1639 ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
1640 (native-search-paths
1641 (list (search-path-specification
1642 (variable "TEXMFLOCAL")
1643 (files '("share/texmf-local")))))
1645 "TeX Live provides a comprehensive TeX document production system.
1646 It includes all the major TeX-related programs, macro packages, and fonts
1647 that are free software, including support for many languages around the
1650 This package contains a small working part of the TeX Live distribution.")))
1652 (define-public perl-text-bibtex
1654 (name "perl-text-bibtex")
1659 (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
1663 "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4"))))
1664 (build-system perl-build-system)
1667 (modify-phases %standard-phases
1668 (add-after 'unpack 'add-output-directory-to-rpath
1669 (lambda* (#:key outputs #:allow-other-keys)
1670 (substitute* "inc/MyBuilder.pm"
1672 (string-append "-Wl,-rpath="
1673 (assoc-ref outputs "out") "/lib " line)))
1675 (add-after 'unpack 'install-libraries-to-/lib
1676 (lambda* (#:key outputs #:allow-other-keys)
1677 (substitute* "Build.PL"
1681 `(("perl-capture-tiny" ,perl-capture-tiny)
1682 ("perl-config-autoconf" ,perl-config-autoconf)
1683 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1684 ("perl-module-build" ,perl-module-build)))
1685 (home-page "http://search.cpan.org/dist/Text-BibTeX")
1686 (synopsis "Interface to read and parse BibTeX files")
1687 (description "@code{Text::BibTeX} is a Perl library for reading, parsing,
1688 and processing BibTeX files. @code{Text::BibTeX} gives you access to the data
1689 at many different levels: you may work with BibTeX entries as simple field to
1690 string mappings, or get at the original form of the data as a list of simple
1691 values (strings, macros, or numbers) pasted together.")
1692 (license license:perl-license)))
1694 (define-public biber
1700 (uri (string-append "https://github.com/plk/biber/archive/v"
1702 (file-name (string-append name "-" version ".tar.gz"))
1705 "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp"))))
1706 (build-system perl-build-system)
1709 (modify-phases %standard-phases
1710 (add-after 'install 'wrap-programs
1711 (lambda* (#:key outputs #:allow-other-keys)
1712 (let* ((out (assoc-ref outputs "out"))
1713 (perl5lib (getenv "PERL5LIB")))
1714 (wrap-program (string-append out "/bin/biber")
1715 `("PERL5LIB" ":" prefix
1716 (,(string-append perl5lib ":" out
1717 "/lib/perl5/site_perl")))))
1720 `(("perl-autovivification" ,perl-autovivification)
1721 ("perl-class-accessor" ,perl-class-accessor)
1722 ("perl-data-dump" ,perl-data-dump)
1723 ("perl-data-compare" ,perl-data-compare)
1724 ("perl-data-uniqid" ,perl-data-uniqid)
1725 ("perl-datetime-format-builder" ,perl-datetime-format-builder)
1726 ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian)
1727 ("perl-file-slurp" ,perl-file-slurp)
1728 ("perl-ipc-cmd" ,perl-ipc-cmd)
1729 ("perl-ipc-run3" ,perl-ipc-run3)
1730 ("perl-list-allutils" ,perl-list-allutils)
1731 ("perl-list-moreutils" ,perl-list-moreutils)
1732 ("perl-mozilla-ca" ,perl-mozilla-ca)
1733 ("perl-regexp-common" ,perl-regexp-common)
1734 ("perl-log-log4perl" ,perl-log-log4perl)
1735 ;; We cannot use perl-unicode-collate here, because otherwise the
1736 ;; hardcoded hashes in the tests would differ. See
1737 ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html
1738 ;;("perl-unicode-collate" ,perl-unicode-collate)
1739 ("perl-unicode-normalize" ,perl-unicode-normalize)
1740 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
1741 ("perl-encode-eucjpascii" ,perl-encode-eucjpascii)
1742 ("perl-encode-jis2k" ,perl-encode-jis2k)
1743 ("perl-encode-hanextra" ,perl-encode-hanextra)
1744 ("perl-xml-libxml" ,perl-xml-libxml)
1745 ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)
1746 ("perl-xml-libxslt" ,perl-xml-libxslt)
1747 ("perl-xml-writer" ,perl-xml-writer)
1748 ("perl-sort-key" ,perl-sort-key)
1749 ("perl-text-csv" ,perl-text-csv)
1750 ("perl-text-csv-xs" ,perl-text-csv-xs)
1751 ("perl-text-roman" ,perl-text-roman)
1752 ("perl-uri" ,perl-uri)
1753 ("perl-text-bibtex" ,perl-text-bibtex)
1754 ("perl-libwww" ,perl-libwww)
1755 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
1756 ("perl-business-isbn" ,perl-business-isbn)
1757 ("perl-business-issn" ,perl-business-issn)
1758 ("perl-business-ismn" ,perl-business-ismn)
1759 ("perl-lingua-translit" ,perl-lingua-translit)))
1761 `(("perl-config-autoconf" ,perl-config-autoconf)
1762 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1763 ("perl-module-build" ,perl-module-build)
1765 ("perl-file-which" ,perl-file-which)
1766 ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient
1767 ("perl-test-differences" ,perl-test-differences)))
1768 (home-page "http://biblatex-biber.sourceforge.net/")
1769 (synopsis "Backend for the BibLaTeX citation management tool")
1770 (description "Biber is a BibTeX replacement for users of biblatex. Among
1771 other things it comes with full Unicode support.")
1772 (license license:artistic2.0)))
1774 ;; Our version of texlive comes with biblatex 3.4, which is only compatible
1775 ;; with biber 2.5 according to the compatibility matrix in the biber
1777 (define-public biber-2.5
1778 (package (inherit biber)
1783 (uri (string-append "https://github.com/plk/biber/archive/v"
1785 (file-name (string-append name "-" version ".tar.gz"))
1788 "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv"))))
1790 (substitute-keyword-arguments (package-arguments biber)
1792 `(modify-phases ,phases
1793 (add-before 'check 'delete-failing-test
1795 (delete-file "t/sort-order.t")
1798 `(("perl-date-simple" ,perl-date-simple)
1799 ,@(package-inputs biber)))))
1801 (define-public rubber
1807 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
1808 version "/+download/rubber-"
1810 (string-append "http://ebeffara.free.fr/pub/rubber-"
1811 version ".tar.gz")))
1814 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
1815 (build-system gnu-build-system)
1816 (arguments '(#:tests? #f)) ; no `check' target
1817 (inputs `(("texinfo" ,texinfo)
1818 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
1820 (home-page "https://launchpad.net/rubber")
1821 (synopsis "Wrapper for LaTeX and friends")
1823 "Rubber is a program whose purpose is to handle all tasks related to the
1824 compilation of LaTeX documents. This includes compiling the document itself,
1825 of course, enough times so that all references are defined, and running BibTeX
1826 to manage bibliographic references. Automatic execution of dvips to produce
1827 PostScript documents is also included, as well as usage of pdfLaTeX to produce
1829 (license license:gpl2+)))
1831 (define-public texmaker
1837 (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
1838 version ".tar.bz2"))
1841 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
1842 (build-system gnu-build-system)
1845 (modify-phases %standard-phases
1846 ;; Qt has its own configuration utility.
1848 (lambda* (#:key outputs #:allow-other-keys)
1849 (let ((out (assoc-ref outputs "out")))
1850 (zero? (system* "qmake"
1851 (string-append "PREFIX=" out)
1852 (string-append "DESKTOPDIR=" out
1853 "/share/applications")
1854 (string-append "ICONDIR=" out "/share/pixmaps")
1855 "texmaker.pro"))))))))
1857 `(("poppler-qt5" ,poppler-qt5)
1859 ("qtscript" ,qtscript)
1860 ("qtwebkit" ,qtwebkit)
1863 `(("pkg-config" ,pkg-config)))
1864 (home-page "http://www.xm1math.net/texmaker/")
1865 (synopsis "LaTeX editor")
1866 (description "Texmaker is a program that integrates many tools needed to
1867 develop documents with LaTeX, in a single application.")
1868 (license license:gpl2+)))
1871 (define-public teximpatient
1873 (name "teximpatient")
1877 (uri (string-append "mirror://gnu/" name "/" name "-"
1881 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
1882 (build-system gnu-build-system)
1885 (modify-phases %standard-phases
1887 ;; Unfortunately some mistakes have been made in packaging.
1888 ;; Work around them here ...
1890 (lambda* (#:key inputs outputs #:allow-other-keys)
1891 (let ((srcdir "teximpatient-2.4"))
1892 (system* "tar" "-xzf" (assoc-ref inputs "source")
1893 (string-append "--one-top-level=" srcdir))
1894 (delete-file (string-append srcdir "/book.pdf"))
1897 (assoc-ref inputs "automake")
1900 (chdir srcdir)))))))
1902 `(("texlive" ,texlive)
1903 ("automake" ,automake)))
1904 (home-page "https://www.gnu.org/software/teximpatient/")
1905 (synopsis "Book on TeX, plain TeX and Eplain")
1906 (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
1907 plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
1909 (license license:fdl1.3+)))