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 (srfi srfi-1))
66 (define texlive-extra-src
69 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523-extra.tar.xz")
71 "0q4a92zmwhn4ry6xgrp4k8wq11ax2sg9rg9yrsrdkr719y0x887a"))))
73 (define texlive-texmf-src
76 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-texmf.tar.xz")
77 (patches (search-patches "texlive-texmf-CVE-2016-10243.patch"))
78 (patch-flags '("-p2"))
80 "1dv8vgfzpczqw82hv9g7a8djhhyzywljmrarlcyy6g2qi5q51glr"))))
89 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-source.tar.xz")
91 "1v91vahxlxkdra0qz3f132vvx5d9cx2jy84yl1hkch0agyj2rcx8"))))
92 (build-system gnu-build-system)
94 `(("texlive-extra-src" ,texlive-extra-src)
96 ("fontconfig" ,fontconfig)
97 ("fontforge" ,fontforge)
98 ("freetype" ,freetype)
101 ("ghostscript" ,ghostscript)
102 ("graphite2" ,graphite2)
103 ("harfbuzz" ,harfbuzz)
105 ("libpaper" ,libpaper)
114 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
119 ("zziplib" ,zziplib)))
121 `(("pkg-config" ,pkg-config)))
123 `(#:out-of-source? #t
125 `("--disable-native-texlive-build"
126 "--with-system-cairo"
127 "--with-system-freetype2"
130 "--with-system-graphite2"
131 "--with-system-harfbuzz"
133 "--with-system-libgs"
134 "--with-system-libpaper"
135 "--with-system-libpng"
137 "--with-system-pixman"
138 "--with-system-poppler"
139 "--with-system-potrace"
140 "--with-system-teckit"
143 "--with-system-zziplib")
145 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
146 ;; XXX FIXME fix luajit properly on mips64.
147 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
150 (modify-phases %standard-phases
151 (add-after 'install 'postint
152 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
153 (let* ((out (assoc-ref outputs "out"))
154 (share (string-append out "/share"))
155 (texlive-extra (assoc-ref inputs "texlive-extra-src"))
156 (unpack (assoc-ref %standard-phases 'unpack))
157 (patch-source-shebangs
158 (assoc-ref %standard-phases 'patch-source-shebangs)))
159 ;; Create symbolic links for the latex variants and their
161 (with-directory-excursion (string-append out "/bin/")
163 '("pdftex" "pdftex" "xetex" "luatex")
164 '("latex" "pdflatex" "xelatex" "lualatex")))
165 (with-directory-excursion (string-append share "/man/man1/")
166 (symlink "luatex.1" "lualatex.1"))
167 ;; Unpack texlive-extra and install tlpkg.
168 (mkdir "texlive-extra")
169 (with-directory-excursion "texlive-extra"
170 (apply unpack (list #:source texlive-extra))
171 (apply patch-source-shebangs (list #:source texlive-extra))
172 (system* "mv" "tlpkg" share))))))))
173 (synopsis "TeX Live, a package of the TeX typesetting system")
175 "TeX Live provides a comprehensive TeX document production system.
176 It includes all the major TeX-related programs, macro packages, and fonts
177 that are free software, including support for many languages around the
180 This package contains the binaries.")
181 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
182 (home-page "https://www.tug.org/texlive/")))
184 (define-public texlive-dvips
186 (name "texlive-dvips")
187 (version (number->string %texlive-revision))
191 (url (string-append "svn://www.tug.org/texlive/tags/"
192 %texlive-tag "/Master/texmf-dist/"
194 (revision %texlive-revision)))
197 "1k11yvz4q95bxyxczwvd4r177h6a2gg03xmf51kmgjgz8an2gq2w"))))
198 (build-system trivial-build-system)
200 `(#:modules ((guix build utils))
203 (use-modules (guix build utils))
204 (let ((target (string-append (assoc-ref %outputs "out")
205 "/share/texmf-dist/dvips")))
207 (copy-recursively (assoc-ref %build-inputs "source") target)
209 (home-page "http://www.ctan.org/pkg/dvips")
210 (synopsis "DVI to PostScript drivers")
211 (description "This package provides files needed for converting DVI files
213 ;; Various free software licenses apply to individual files.
214 (license (list license:lppl1.3c+
218 (define-public texlive-generic-unicode-data
220 (name "texlive-generic-unicode-data")
221 (version (number->string %texlive-revision))
225 (url (string-append "svn://www.tug.org/texlive/tags/"
226 %texlive-tag "/Master/texmf-dist/"
227 "/tex/generic/unicode-data"))
228 (revision %texlive-revision)))
231 "0ivrhp6jz31pl4z841g4ws41lmvdiwz4sslmhf02inlib79gz6r2"))))
232 (build-system trivial-build-system)
234 `(#:modules ((guix build utils))
237 (use-modules (guix build utils))
238 (let ((target (string-append (assoc-ref %outputs "out")
239 "/share/texmf-dist/tex/generic/unicode-data")))
241 (copy-recursively (assoc-ref %build-inputs "source") target)
243 (home-page "http://www.ctan.org/pkg/unicode-data")
244 (synopsis "Unicode data and loaders for TeX")
245 (description "This bundle provides generic access to Unicode Consortium
246 data for TeX use. It contains a set of text files provided by the Unicode
247 Consortium which are currently all from Unicode 8.0.0, with the exception of
248 @code{MathClass.txt} which is not currently part of the Unicode Character
249 Database. Accompanying these source data are generic TeX loader files
250 allowing this data to be used as part of TeX runs, in particular in building
251 format files. Currently there are two loader files: one for general character
252 set up and one for initializing XeTeX character classes as has been carried
253 out to date by @code{unicode-letters.tex}. ")
254 (license license:lppl1.3c+)))
256 (define-public texlive-generic-dehyph-exptl
258 (name "texlive-generic-dehyph-exptl")
259 (version (number->string %texlive-revision))
263 (url (string-append "svn://www.tug.org/texlive/tags/"
264 %texlive-tag "/Master/texmf-dist/"
265 "/tex/generic/dehyph-exptl"))
266 (revision %texlive-revision)))
269 "1l9wgv99qq0ysvlxqpj4g8bl0dywbzra4g8m2kmpg2fb0i0hczap"))))
270 (build-system trivial-build-system)
272 `(#:modules ((guix build utils))
275 (use-modules (guix build utils))
276 (let ((target (string-append (assoc-ref %outputs "out")
277 "/share/texmf-dist/tex/generic/dehyph-exptl")))
279 (copy-recursively (assoc-ref %build-inputs "source") target)
281 (home-page "http://projekte.dante.de/Trennmuster/WebHome")
282 (synopsis "Hyphenation patterns for German")
283 (description "The package provides experimental hyphenation patterns for
284 the German language, covering both traditional and reformed orthography. The
285 patterns can be used with packages Babel and hyphsubst from the Oberdiek
287 ;; Hyphenation patterns are under the Expat license; documentation is
289 (license (list license:expat license:lppl))))
291 (define-public texlive-generic-tex-ini-files
293 (name "texlive-generic-tex-ini-files")
294 (version (number->string %texlive-revision))
298 (url (string-append "svn://www.tug.org/texlive/tags/"
299 %texlive-tag "/Master/texmf-dist/"
300 "/tex/generic/tex-ini-files"))
301 (revision %texlive-revision)))
304 "1wh42n1lmzcvi3g6mm31nm3yd5ha5bl260xqc444jg1m9fdp3wz5"))))
305 (build-system trivial-build-system)
307 `(#:modules ((guix build utils))
310 (use-modules (guix build utils))
311 (let ((target (string-append (assoc-ref %outputs "out")
312 "/share/texmf-dist/tex/generic/tex-ini-files")))
314 (copy-recursively (assoc-ref %build-inputs "source") target)
316 (home-page "http://ctan.org/pkg/tex-ini-files")
317 (synopsis "Files for creating TeX formats")
318 (description "This bundle provides a collection of model \".ini\" files
319 for creating TeX formats. These files are commonly used to introduced
320 distribution-dependent variations in formats. They are also used to
321 allow existing format source files to be used with newer engines, for example
322 to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
323 (license license:public-domain)))
325 (define-public texlive-generic-hyph-utf8
327 (name "texlive-generic-hyph-utf8")
328 (version (number->string %texlive-revision))
332 (url (string-append "svn://www.tug.org/texlive/tags/"
333 %texlive-tag "/Master/texmf-dist/"
334 "/tex/generic/hyph-utf8"))
335 (revision %texlive-revision)))
338 "0ghizcz7ps16dzfqf66wwg5i181assc6qsm0g7g5dbmp909931vi"))))
339 (build-system trivial-build-system)
341 `(#:modules ((guix build utils))
344 (use-modules (guix build utils))
345 (let ((target (string-append (assoc-ref %outputs "out")
346 "/share/texmf-dist/tex/generic/hyph-utf8")))
348 (copy-recursively (assoc-ref %build-inputs "source") target)
350 (home-page "http://ctan.org/pkg/hyph-utf8")
351 (synopsis "Hyphenation patterns expressed in UTF-8")
352 (description "Modern native UTF-8 engines such as XeTeX and LuaTeX need
353 hyphenation patterns in UTF-8 format, whereas older systems require
354 hyphenation patterns in the 8-bit encoding of the font in use (such encodings
355 are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
356 etc). The present package offers a collection of conversions of existing
357 patterns to UTF-8 format, together with converters for use with 8-bit fonts in
358 older systems. Since hyphenation patterns for Knuthian-style TeX systems are
359 only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
360 converters, will completely supplant the older patterns.")
361 ;; Individual files each have their own license. Most of these files are
362 ;; independent hyphenation patterns.
363 (license (list license:lppl1.0+
378 license:public-domain
381 (define-public texlive-metafont-base
383 (name "texlive-metafont-base")
384 (version (number->string %texlive-revision))
388 (url (string-append "svn://www.tug.org/texlive/tags/"
389 %texlive-tag "/Master/texmf-dist/"
391 (revision %texlive-revision)))
394 "1yl4n8cn5xqk2nc22zgzq6ymd7bhm6xx1mz3azip7i3ki4bhb5q5"))))
395 (build-system gnu-build-system)
397 `(#:tests? #f ; no test target
399 (modify-phases %standard-phases
402 (lambda* (#:key inputs #:allow-other-keys)
403 (let ((cwd (getcwd)))
405 (string-append cwd "/base:"
412 (with-directory-excursion "build"
413 (zero? (system* "inimf" "mf.mf")))))
415 (lambda* (#:key outputs #:allow-other-keys)
416 (let* ((out (assoc-ref outputs "out"))
417 (base (string-append out "/share/texmf-dist/web2c"))
418 (mf (string-append out "/share/texmf-dist/metafont/base")))
421 (install-file "build/mf.base" base)
422 (copy-recursively "base" mf)
425 `(("texlive-bin" ,texlive-bin)))
426 (home-page "http://www.ctan.org/pkg/metafont")
427 (synopsis "Metafont base files")
428 (description "This package provides the Metafont base files needed to
429 build fonts using the Metafont system.")
430 (license license:knuth)))
432 (define-public texlive-fonts-cm
434 (name "texlive-fonts-cm")
435 (version (number->string %texlive-revision))
439 (url (string-append "svn://www.tug.org/texlive/tags/"
440 %texlive-tag "/Master/texmf-dist/"
441 "/fonts/source/public/cm"))
442 (revision %texlive-revision)))
445 "045k5b9rdmbxpy1a3006l1x96z1rd18vg3cwrvnld9bqybw5qz44"))))
446 (build-system gnu-build-system)
448 `(#:modules ((guix build gnu-build-system)
452 #:tests? #f ; no tests
454 (modify-phases %standard-phases
457 (lambda* (#:key inputs #:allow-other-keys)
458 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
459 ;; Tell mf where to find mf.base
460 (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
461 ;; Tell mf where to look for source files
463 (string-append (getcwd) ":"
464 mf "/share/texmf-dist/metafont/base")))
466 (every (lambda (font)
467 (format #t "building font ~a\n" font)
468 (zero? (system* "mf" "-progname=mf"
469 "-output-directory=build"
475 (basename font ".mf")))))
476 (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))))
478 (lambda* (#:key outputs #:allow-other-keys)
479 (let* ((out (assoc-ref outputs "out"))
481 out "/share/texmf-dist/fonts/tfm/public/cm"))
483 out "/share/texmf-dist/fonts/source/public/cm")))
484 (for-each (cut install-file <> tfm)
485 (find-files "build" "\\.*"))
486 (for-each (cut install-file <> mf)
487 (find-files "." "\\.mf"))
490 `(("texlive-bin" ,texlive-bin)
491 ("texlive-metafont-base" ,texlive-metafont-base)))
492 (home-page "http://www.ctan.org/pkg/cm")
493 (synopsis "Computer Modern fonts for TeX")
494 (description "This package provides the Computer Modern fonts by Donald
495 Knuth. The Computer Modern font family is a large collection of text,
496 display, and mathematical fonts in a range of styles, based on Monotype Modern
498 (license license:knuth)))
500 (define-public texlive-fonts-knuth-lib
502 (name "texlive-fonts-knuth-lib")
503 (version (number->string %texlive-revision))
507 (url (string-append "svn://www.tug.org/texlive/tags/"
508 %texlive-tag "/Master/texmf-dist/"
509 "/fonts/source/public/knuth-lib"))
510 (revision %texlive-revision)))
513 "0in9aqyi8jkyf9d16z0li50z5fpwj1iwgwm83gmvwqcf7chfs04y"))))
514 (build-system gnu-build-system)
516 `(#:modules ((guix build gnu-build-system)
519 #:tests? #f ; no tests
521 (modify-phases %standard-phases
524 (lambda* (#:key inputs #:allow-other-keys)
525 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
526 ;; Tell mf where to find mf.base
528 (string-append mf "/share/texmf-dist/web2c"))
529 ;; Tell mf where to look for source files
531 (string-append (getcwd) ":"
532 mf "/share/texmf-dist/metafont/base")))
534 (zero? (system* "mf" "-progname=mf"
535 "-output-directory=build"
542 (lambda* (#:key outputs #:allow-other-keys)
543 (let* ((out (assoc-ref outputs "out"))
545 out "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
547 out "/share/texmf-dist/fonts/source/public/knuth-lib")))
548 (for-each (cut install-file <> tfm)
549 (find-files "build" "\\.*"))
550 (for-each (cut install-file <> mf)
551 (find-files "." "\\.mf"))
554 `(("texlive-bin" ,texlive-bin)
555 ("texlive-metafont-base" ,texlive-metafont-base)))
556 (home-page "https://www.ctan.org/pkg/knuth-lib")
557 (synopsis "Small library of METAFONT sources")
558 (description "This is a collection of core TeX and METAFONT macro files
559 from Donald Knuth, including the plain format, plain base, and the MF logo
561 (license license:knuth)))
563 (define-public texlive-fonts-latex
565 (name "texlive-fonts-latex")
566 (version (number->string %texlive-revision))
570 (url (string-append "svn://www.tug.org/texlive/tags/"
571 %texlive-tag "/Master/texmf-dist/"
572 "/fonts/source/public/latex-fonts"))
573 (revision %texlive-revision)))
576 "0ypsm4xv9cw0jckk2qc7gi9hcmhf31mrg56pz3llyx3yd9vq2lps"))))
577 (build-system gnu-build-system)
579 `(#:modules ((guix build gnu-build-system)
583 #:tests? #f ; no tests
585 (modify-phases %standard-phases
588 (lambda* (#:key inputs #:allow-other-keys)
589 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
590 ;; Tell mf where to find mf.base
591 (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
592 ;; Tell mf where to look for source files
594 (string-append (getcwd) ":"
595 mf "/share/texmf-dist/metafont/base:"
596 (assoc-ref inputs "texlive-fonts-cm")
597 "/share/texmf-dist/fonts/source/public/cm")))
599 (every (lambda (font)
600 (format #t "building font ~a\n" font)
601 (zero? (system* "mf" "-progname=mf"
602 "-output-directory=build"
608 '("icmcsc10" "icmex10" "icmmi8" "icmsy8" "icmtt8"
609 "ilasy8" "ilcmss8" "ilcmssb8" "ilcmssi8"
610 "lasy5" "lasy6" "lasy7" "lasy8" "lasy9" "lasy10" "lasyb10"
611 "lcircle10" "lcirclew10" "lcmss8" "lcmssb8" "lcmssi8"
612 "line10" "linew10"))))
614 (lambda* (#:key outputs #:allow-other-keys)
615 (let* ((out (assoc-ref outputs "out"))
617 out "/share/texmf-dist/fonts/tfm/public/latex-fonts"))
619 out "/share/texmf-dist/fonts/source/public/latex-fonts")))
620 (for-each (cut install-file <> tfm)
621 (find-files "build" "\\.*"))
622 (for-each (cut install-file <> mf)
623 (find-files "." "\\.mf"))
626 `(("texlive-bin" ,texlive-bin)
627 ("texlive-metafont-base" ,texlive-metafont-base)
628 ("texlive-fonts-cm" ,texlive-fonts-cm)))
629 (home-page "http://www.ctan.org/pkg/latex-fonts")
630 (synopsis "Collection of fonts used in LaTeX distributions")
631 (description "This is a collection of fonts for use with standard LaTeX
632 packages and classes. It includes invisible fonts (for use with the slides
633 class), line and circle fonts (for use in the picture environment) and LaTeX
635 (license license:lppl1.2+)))
637 ;; This provides etex.src which is needed to build various formats, including
638 ;; luatex.fmt and pdflatex.fmt
639 (define-public texlive-tex-plain
641 (name "texlive-tex-plain")
642 (version (number->string %texlive-revision))
646 (url (string-append "svn://www.tug.org/texlive/tags/"
647 %texlive-tag "/Master/texmf-dist/"
649 (revision %texlive-revision)))
652 "1ifmbyl3ir8k0v1g25xjb5rcyy5vhj8a3fa2088nczga09hna5vn"))))
653 (build-system trivial-build-system)
655 `(#:modules ((guix build utils))
658 (use-modules (guix build utils))
659 (let ((target (string-append (assoc-ref %outputs "out")
660 "/share/texmf-dist/tex/plain")))
662 (copy-recursively (assoc-ref %build-inputs "source") target)
664 (home-page "https://www.ctan.org/pkg/plain")
665 (synopsis "Plain TeX format and supporting files")
667 "Contains files used to build the Plain TeX format, as described in the
668 TeXbook, together with various supporting files (some also discussed in the
670 (license license:knuth)))
672 (define-public texlive-latex-base
678 (url (string-append "svn://www.tug.org/texlive/tags/"
679 %texlive-tag "/Master/texmf-dist/"
681 (revision %texlive-revision)))
682 (sha256 (base32 hash))))))
684 (name "texlive-latex-base")
685 (version (number->string %texlive-revision))
688 (uri (texlive-ref "latex" "base"))
691 "1h9pir2hz6i9avc4lrl733p3zf4rpkg8537x1zdbhs91hvhikw9k"))))
692 (build-system gnu-build-system)
694 `(#:modules ((guix build gnu-build-system)
699 #:tests? #f ; no tests
701 (modify-phases %standard-phases
704 (lambda* (#:key inputs #:allow-other-keys)
705 ;; Find required fonts
707 (string-append (assoc-ref inputs "texlive-fonts-cm")
708 "/share/texmf-dist/fonts/tfm/public/cm:"
709 (assoc-ref inputs "texlive-fonts-latex")
710 "/share/texmf-dist/fonts/tfm/public/latex-fonts:"
711 (assoc-ref inputs "texlive-fonts-knuth-lib")
712 "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
718 (append-map (match-lambda
722 (eq? 'directory (stat:type stat)))
728 ;; Create an empty texsys.cfg, because latex.ltx wants to include
729 ;; it. This file must exist and it's fine if it's empty.
730 (with-output-to-file "texsys.cfg"
731 (lambda _ (format #t "%")))
735 (and (zero? (system* "luatex" "-ini" "-interaction=batchmode"
736 "-output-directory=build"
738 ;; LaTeX and XeTeX require e-TeX, which is enabled only in
739 ;; extended mode (activated with a leading asterisk). We
740 ;; should not use luatex here, because that would make the
741 ;; generated format files incompatible with any other TeX
744 ;; FIXME: XeTeX fails to build because neither
745 ;; \XeTeXuseglyphmetrics nor \XeTeXdashbreakstate are
749 (zero? (system* "latex" "-ini" "-interaction=batchmode"
750 "-output-directory=web2c"
751 "-translate-file=cp227.tcx"
752 (string-append "*" format ".ini"))))
757 (zero? (system* "luatex" "-ini" "-interaction=batchmode"
758 "-output-directory=web2c"
759 (string-append format ".ini"))))
760 '("dviluatex" "dvilualatex" "luatex" "lualatex" "xelatex")))))
762 (lambda* (#:key outputs #:allow-other-keys)
763 (let* ((out (assoc-ref outputs "out"))
764 (target (string-append
765 out "/share/texmf-dist/tex/latex/base"))
766 (web2c (string-append
767 out "/share/texmf-dist/web2c")))
770 (for-each delete-file (find-files "." "\\.(log|aux)$"))
771 (for-each (cut install-file <> target)
772 (find-files "build" ".*"))
773 (for-each (cut install-file <> web2c)
774 (find-files "web2c" ".*"))
777 `(("texlive-bin" ,texlive-bin)
778 ("texlive-generic-unicode-data" ,texlive-generic-unicode-data)
779 ("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl)
780 ("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files)
781 ("texlive-latex-latexconfig"
782 ,(texlive-dir "tex/latex/latexconfig/"
783 "1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf"))
784 ("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8)
785 ("texlive-generic-hyphen"
786 ,(texlive-dir "tex/generic/hyphen/"
787 "0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd"))
788 ("texlive-generic-ruhyphen"
789 ,(texlive-dir "tex/generic/ruhyphen/"
790 "14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd"))
791 ("texlive-generic-ukrhyph"
792 ,(texlive-dir "tex/generic/ukrhyph/"
793 "1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv"))
794 ("texlive-generic-config"
795 ,(texlive-dir "tex/generic/config/"
796 "19vj088p4kkp6xll0141m4kl6ssgdzhs3g10i232khb07aqiag8s"))
797 ("texlive-tex-plain" ,texlive-tex-plain)
798 ("texlive-fonts-cm" ,texlive-fonts-cm)
799 ("texlive-fonts-latex" ,texlive-fonts-latex)
800 ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)))
801 (home-page "http://www.ctan.org/pkg/latex-base")
802 (synopsis "Base sources of LaTeX")
804 "This bundle comprises the source of LaTeX itself, together with several
805 packages which are considered \"part of the kernel\". This bundle, together
806 with the required packages, constitutes what every LaTeX distribution should
808 (license license:lppl1.3c+))))
810 (define texlive-texmf
812 (name "texlive-texmf")
814 (source texlive-texmf-src)
815 (build-system gnu-build-system)
817 `(("texlive-bin" ,texlive-bin)
820 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
824 `(#:modules ((guix build gnu-build-system)
828 ;; This package takes 4 GiB, which we can't afford to distribute from
833 (modify-phases (map (cut assq <> %standard-phases)
834 '(set-paths unpack patch-source-shebangs))
835 (add-after 'patch-source-shebangs 'install
836 (lambda* (#:key outputs #:allow-other-keys)
837 (let ((share (string-append (assoc-ref outputs "out") "/share")))
839 (system* "mv" "texmf-dist" share))))
840 (add-after 'install 'texmf-config
841 (lambda* (#:key inputs outputs #:allow-other-keys)
842 (let* ((out (assoc-ref outputs "out"))
843 (share (string-append out "/share"))
844 (texmfroot (string-append share "/texmf-dist/web2c"))
845 (texmfcnf (string-append texmfroot "/texmf.cnf"))
846 (texlive-bin (assoc-ref inputs "texlive-bin"))
847 (texbin (string-append texlive-bin "/bin"))
848 (tlpkg (string-append texlive-bin "/share/tlpkg")))
849 ;; Register SHARE as TEXMFROOT in texmf.cnf.
850 (substitute* texmfcnf
851 (("TEXMFROOT = \\$SELFAUTOPARENT")
852 (string-append "TEXMFROOT = " share))
853 (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
854 "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
855 (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
856 ;; Register paths in texmfcnf.lua, needed for context.
857 (substitute* (string-append texmfroot "/texmfcnf.lua")
858 (("selfautodir:") out)
859 (("selfautoparent:") (string-append share "/")))
860 ;; Set path to TeXLive Perl modules
862 (string-append (getenv "PERL5LIB") ":" tlpkg))
863 ;; Configure the texmf-dist tree; inspired from
864 ;; http://slackbuilds.org/repository/13.37/office/texlive/
865 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
866 (setenv "TEXMFCNF" texmfroot)
867 (system* "updmap-sys" "--nohash" "--syncwithtrees")
869 (system* "fmtutil-sys" "--all")))))))
870 (properties `((max-silent-time . 9600))) ; don't time out while grafting
871 (synopsis "TeX Live, a package of the TeX typesetting system")
873 "TeX Live provides a comprehensive TeX document production system.
874 It includes all the major TeX-related programs, macro packages, and fonts
875 that are free software, including support for many languages around the
878 This package contains the complete tree of texmf-dist data.")
879 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
880 (home-page "https://www.tug.org/texlive/")))
882 (define-public texlive
887 (build-system trivial-build-system)
888 (inputs `(("bash" ,bash) ; for wrap-program
889 ("texlive-bin" ,texlive-bin)
890 ("texlive-texmf" ,texlive-texmf)))
892 (list (search-path-specification
893 (variable "TEXMFLOCAL")
894 (files '("share/texmf-local")))))
896 `(#:modules ((guix build utils))
898 ;; Build the union of texlive-bin and texlive-texmf, but take the
899 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
901 (use-modules (guix build utils))
902 (let ((out (assoc-ref %outputs "out"))
903 (bin (assoc-ref %build-inputs "texlive-bin"))
904 (texmf (assoc-ref %build-inputs "texlive-texmf"))
905 (bash (assoc-ref %build-inputs "bash")))
907 (with-directory-excursion out
910 (symlink (string-append bin "/" name) name))
913 (with-directory-excursion "bin"
914 (setenv "PATH" (string-append bash "/bin"))
917 (symlink name (basename name))
921 (,(string-append texmf "/share/texmf-dist/web2c")))))
922 (find-files (string-append bin "/bin/") "")))
924 (with-directory-excursion "share"
927 (symlink (string-append bin "/share/" name) name))
928 '("info" "man" "tlpkg"))
931 (symlink (string-append texmf "/share/" name) name))
932 '("texmf-dist" "texmf-var"))))))))
933 (synopsis "TeX Live, a package of the TeX typesetting system")
935 "TeX Live provides a comprehensive TeX document production system.
936 It includes all the major TeX-related programs, macro packages, and fonts
937 that are free software, including support for many languages around the
940 This package contains the complete TeX Live distribution.")
941 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
942 (home-page "https://www.tug.org/texlive/")))
945 ;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
946 ;; in particular dropping documentation and fonts. It weighs in at 470 MiB
948 (define texlive-texmf-minimal
949 (package (inherit texlive-texmf)
950 (name "texlive-texmf-minimal")
952 (substitute-keyword-arguments
953 (package-arguments texlive-texmf)
959 `(modify-phases ,phases
960 (add-after 'unpack 'prune
962 (define (delete subdir exclude)
963 "Delete all files and directories in SUBDIR except for those
964 given in the list EXCLUDE."
965 (with-directory-excursion subdir
966 (for-each delete-file-recursively
967 (lset-difference equal?
971 (with-directory-excursion "texmf-dist"
972 (for-each delete-file-recursively
973 '("doc" "source" "tex4ht"))
974 ;; Delete all subdirectories of "fonts", except for "tfm" and
975 ;; any directories named "cm".
976 (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
977 (delete "fonts/afm" '("public"))
978 (delete "fonts/afm/public" '("amsfonts"))
979 (delete "fonts/afm/public/amsfonts" '("cm"))
980 (delete "fonts/map" '("dvips"))
981 (delete "fonts/map/dvips" '("cm"))
982 (delete "fonts/source" '("public"))
983 (delete "fonts/source/public" '("cm"))
984 (delete "fonts/tfm" '("public"))
985 (delete "fonts/type1" '("public"))
986 (delete "fonts/type1/public" '("amsfonts"))
987 (delete "fonts/type1/public/amsfonts" '("cm")))
990 "TeX Live provides a comprehensive TeX document production system.
991 It includes all the major TeX-related programs, macro packages, and fonts
992 that are free software, including support for many languages around the
995 This package contains a small subset of the texmf-dist data.")))
998 ;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal
999 ;; instead of the full texlive-texmf. It can be used, for instance, as a
1000 ;; native input to packages that need texlive to build their documentation.
1001 (define-public texlive-minimal
1002 (package (inherit texlive)
1003 (name "texlive-minimal")
1005 `(("texlive-texmf" ,texlive-texmf-minimal)
1006 ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
1007 (native-search-paths
1008 (list (search-path-specification
1009 (variable "TEXMFLOCAL")
1010 (files '("share/texmf-local")))))
1012 "TeX Live provides a comprehensive TeX document production system.
1013 It includes all the major TeX-related programs, macro packages, and fonts
1014 that are free software, including support for many languages around the
1017 This package contains a small working part of the TeX Live distribution.")))
1019 (define-public perl-text-bibtex
1021 (name "perl-text-bibtex")
1026 (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
1030 "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4"))))
1031 (build-system perl-build-system)
1034 (modify-phases %standard-phases
1035 (add-after 'unpack 'add-output-directory-to-rpath
1036 (lambda* (#:key outputs #:allow-other-keys)
1037 (substitute* "inc/MyBuilder.pm"
1039 (string-append "-Wl,-rpath="
1040 (assoc-ref outputs "out") "/lib " line)))
1042 (add-after 'unpack 'install-libraries-to-/lib
1043 (lambda* (#:key outputs #:allow-other-keys)
1044 (substitute* "Build.PL"
1048 `(("perl-capture-tiny" ,perl-capture-tiny)
1049 ("perl-config-autoconf" ,perl-config-autoconf)
1050 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1051 ("perl-module-build" ,perl-module-build)))
1052 (home-page "http://search.cpan.org/dist/Text-BibTeX")
1053 (synopsis "Interface to read and parse BibTeX files")
1054 (description "@code{Text::BibTeX} is a Perl library for reading, parsing,
1055 and processing BibTeX files. @code{Text::BibTeX} gives you access to the data
1056 at many different levels: you may work with BibTeX entries as simple field to
1057 string mappings, or get at the original form of the data as a list of simple
1058 values (strings, macros, or numbers) pasted together.")
1059 (license license:perl-license)))
1061 (define-public biber
1067 (uri (string-append "https://github.com/plk/biber/archive/v"
1069 (file-name (string-append name "-" version ".tar.gz"))
1072 "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp"))))
1073 (build-system perl-build-system)
1076 (modify-phases %standard-phases
1077 (add-after 'install 'wrap-programs
1078 (lambda* (#:key outputs #:allow-other-keys)
1079 (let* ((out (assoc-ref outputs "out"))
1080 (perl5lib (getenv "PERL5LIB")))
1081 (wrap-program (string-append out "/bin/biber")
1082 `("PERL5LIB" ":" prefix
1083 (,(string-append perl5lib ":" out
1084 "/lib/perl5/site_perl")))))
1087 `(("perl-autovivification" ,perl-autovivification)
1088 ("perl-class-accessor" ,perl-class-accessor)
1089 ("perl-data-dump" ,perl-data-dump)
1090 ("perl-data-compare" ,perl-data-compare)
1091 ("perl-data-uniqid" ,perl-data-uniqid)
1092 ("perl-datetime-format-builder" ,perl-datetime-format-builder)
1093 ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian)
1094 ("perl-file-slurp" ,perl-file-slurp)
1095 ("perl-ipc-cmd" ,perl-ipc-cmd)
1096 ("perl-ipc-run3" ,perl-ipc-run3)
1097 ("perl-list-allutils" ,perl-list-allutils)
1098 ("perl-list-moreutils" ,perl-list-moreutils)
1099 ("perl-mozilla-ca" ,perl-mozilla-ca)
1100 ("perl-regexp-common" ,perl-regexp-common)
1101 ("perl-log-log4perl" ,perl-log-log4perl)
1102 ;; We cannot use perl-unicode-collate here, because otherwise the
1103 ;; hardcoded hashes in the tests would differ. See
1104 ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html
1105 ;;("perl-unicode-collate" ,perl-unicode-collate)
1106 ("perl-unicode-normalize" ,perl-unicode-normalize)
1107 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
1108 ("perl-encode-eucjpascii" ,perl-encode-eucjpascii)
1109 ("perl-encode-jis2k" ,perl-encode-jis2k)
1110 ("perl-encode-hanextra" ,perl-encode-hanextra)
1111 ("perl-xml-libxml" ,perl-xml-libxml)
1112 ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)
1113 ("perl-xml-libxslt" ,perl-xml-libxslt)
1114 ("perl-xml-writer" ,perl-xml-writer)
1115 ("perl-sort-key" ,perl-sort-key)
1116 ("perl-text-csv" ,perl-text-csv)
1117 ("perl-text-csv-xs" ,perl-text-csv-xs)
1118 ("perl-text-roman" ,perl-text-roman)
1119 ("perl-uri" ,perl-uri)
1120 ("perl-text-bibtex" ,perl-text-bibtex)
1121 ("perl-libwww" ,perl-libwww)
1122 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
1123 ("perl-business-isbn" ,perl-business-isbn)
1124 ("perl-business-issn" ,perl-business-issn)
1125 ("perl-business-ismn" ,perl-business-ismn)
1126 ("perl-lingua-translit" ,perl-lingua-translit)))
1128 `(("perl-config-autoconf" ,perl-config-autoconf)
1129 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1130 ("perl-module-build" ,perl-module-build)
1132 ("perl-file-which" ,perl-file-which)
1133 ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient
1134 ("perl-test-differences" ,perl-test-differences)))
1135 (home-page "http://biblatex-biber.sourceforge.net/")
1136 (synopsis "Backend for the BibLaTeX citation management tool")
1137 (description "Biber is a BibTeX replacement for users of biblatex. Among
1138 other things it comes with full Unicode support.")
1139 (license license:artistic2.0)))
1141 ;; Our version of texlive comes with biblatex 3.4, which is only compatible
1142 ;; with biber 2.5 according to the compatibility matrix in the biber
1144 (define-public biber-2.5
1145 (package (inherit biber)
1150 (uri (string-append "https://github.com/plk/biber/archive/v"
1152 (file-name (string-append name "-" version ".tar.gz"))
1155 "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv"))))
1157 (substitute-keyword-arguments (package-arguments biber)
1159 `(modify-phases ,phases
1160 (add-before 'check 'delete-failing-test
1162 (delete-file "t/sort-order.t")
1165 `(("perl-date-simple" ,perl-date-simple)
1166 ,@(package-inputs biber)))))
1168 (define-public rubber
1174 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
1175 version "/+download/rubber-"
1177 (string-append "http://ebeffara.free.fr/pub/rubber-"
1178 version ".tar.gz")))
1181 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
1182 (build-system gnu-build-system)
1183 (arguments '(#:tests? #f)) ; no `check' target
1184 (inputs `(("texinfo" ,texinfo)
1185 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
1187 (home-page "https://launchpad.net/rubber")
1188 (synopsis "Wrapper for LaTeX and friends")
1190 "Rubber is a program whose purpose is to handle all tasks related to the
1191 compilation of LaTeX documents. This includes compiling the document itself,
1192 of course, enough times so that all references are defined, and running BibTeX
1193 to manage bibliographic references. Automatic execution of dvips to produce
1194 PostScript documents is also included, as well as usage of pdfLaTeX to produce
1196 (license license:gpl2+)))
1198 (define-public texmaker
1204 (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
1205 version ".tar.bz2"))
1208 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
1209 (build-system gnu-build-system)
1212 (modify-phases %standard-phases
1213 ;; Qt has its own configuration utility.
1215 (lambda* (#:key outputs #:allow-other-keys)
1216 (let ((out (assoc-ref outputs "out")))
1217 (zero? (system* "qmake"
1218 (string-append "PREFIX=" out)
1219 (string-append "DESKTOPDIR=" out
1220 "/share/applications")
1221 (string-append "ICONDIR=" out "/share/pixmaps")
1222 "texmaker.pro"))))))))
1224 `(("poppler-qt5" ,poppler-qt5)
1226 ("qtscript" ,qtscript)
1227 ("qtwebkit" ,qtwebkit)
1230 `(("pkg-config" ,pkg-config)))
1231 (home-page "http://www.xm1math.net/texmaker/")
1232 (synopsis "LaTeX editor")
1233 (description "Texmaker is a program that integrates many tools needed to
1234 develop documents with LaTeX, in a single application.")
1235 (license license:gpl2+)))
1238 (define-public teximpatient
1240 (name "teximpatient")
1244 (uri (string-append "mirror://gnu/" name "/" name "-"
1248 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
1249 (build-system gnu-build-system)
1252 (modify-phases %standard-phases
1254 ;; Unfortunately some mistakes have been made in packaging.
1255 ;; Work around them here ...
1257 (lambda* (#:key inputs outputs #:allow-other-keys)
1258 (let ((srcdir "teximpatient-2.4"))
1259 (system* "tar" "-xzf" (assoc-ref inputs "source")
1260 (string-append "--one-top-level=" srcdir))
1261 (delete-file (string-append srcdir "/book.pdf"))
1264 (assoc-ref inputs "automake")
1267 (chdir srcdir)))))))
1269 `(("texlive" ,texlive)
1270 ("automake" ,automake)))
1271 (home-page "https://www.gnu.org/software/teximpatient/")
1272 (synopsis "Book on TeX, plain TeX and Eplain")
1273 (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
1274 plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
1276 (license license:fdl1.3+)))