gnu: Add texlive-union.
[jackhill/guix/guix.git] / gnu / packages / tex.scm
CommitLineData
eb0119ef 1;;; GNU Guix --- Functional package management for GNU
4a6635f3 2;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
42e1394b 3;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
d2e84281 4;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4791876c 5;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
7a15a68f 6;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
2d634d9b 7;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
bd917486 8;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
9d913b25 9;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
eb0119ef
AE
10;;;
11;;; This file is part of GNU Guix.
12;;;
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.
17;;;
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.
22;;;
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/>.
25
8f9ac901 26(define-module (gnu packages tex)
b5b73a82 27 #:use-module ((guix licenses) #:prefix license:)
eb0119ef
AE
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu)
ebcf74da 31 #:use-module (guix build-system perl)
0aa34e82 32 #:use-module (guix build-system trivial)
205794c8 33 #:use-module (guix build-system texlive)
6b5eb840 34 #:use-module (guix utils)
83457fe0 35 #:use-module (guix git-download)
9d913b25 36 #:use-module (guix svn-download)
eb0119ef 37 #:use-module (gnu packages)
83457fe0 38 #:use-module (gnu packages autotools)
0aa34e82 39 #:use-module (gnu packages bash)
eb0119ef 40 #:use-module (gnu packages compression)
a86177d6 41 #:use-module (gnu packages fontutils)
fd89b36b 42 #:use-module (gnu packages gd)
eb0119ef 43 #:use-module (gnu packages ghostscript)
fd89b36b 44 #:use-module (gnu packages gtk)
eb0119ef 45 #:use-module (gnu packages icu4c)
e55354b8 46 #:use-module (gnu packages image)
0aa34e82 47 #:use-module (gnu packages lua)
0256c746 48 #:use-module (gnu packages multiprecision)
eb0119ef
AE
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)
4791876c 53 #:use-module (gnu packages qt)
b32c8549 54 #:use-module (gnu packages ruby)
b7194849 55 #:use-module (gnu packages shells)
ce0614dd 56 #:use-module (gnu packages base)
d4000680
RW
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages xml)
c0589f75 59 #:use-module (gnu packages xorg)
ece9b417 60 #:use-module (gnu packages xdisorg)
231eae53 61 #:use-module (gnu packages zip)
6b5eb840
AE
62 #:autoload (gnu packages texinfo) (texinfo)
63 #:use-module (ice-9 ftw)
cb7bc20a 64 #:use-module (ice-9 match)
e93f472d 65 #:use-module ((srfi srfi-1) #:hide (zip)))
eb0119ef
AE
66
67(define texlive-extra-src
68 (origin
69 (method url-fetch)
7a15a68f 70 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523-extra.tar.xz")
eb0119ef 71 (sha256 (base32
7a15a68f 72 "0q4a92zmwhn4ry6xgrp4k8wq11ax2sg9rg9yrsrdkr719y0x887a"))))
eb0119ef
AE
73
74(define texlive-texmf-src
75 (origin
76 (method url-fetch)
29a56d8e 77 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-texmf.tar.xz")
e20784e6
LF
78 (patches (search-patches "texlive-texmf-CVE-2016-10243.patch"))
79 (patch-flags '("-p2"))
eb0119ef 80 (sha256 (base32
29a56d8e 81 "1dv8vgfzpczqw82hv9g7a8djhhyzywljmrarlcyy6g2qi5q51glr"))))
eb0119ef 82
8bcdc23f 83(define texlive-bin
eb0119ef 84 (package
0aa34e82 85 (name "texlive-bin")
7a15a68f 86 (version "2016")
0aa34e82
AE
87 (source
88 (origin
89 (method url-fetch)
29a56d8e 90 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-source.tar.xz")
0aa34e82 91 (sha256 (base32
29a56d8e 92 "1v91vahxlxkdra0qz3f132vvx5d9cx2jy84yl1hkch0agyj2rcx8"))))
eb0119ef 93 (build-system gnu-build-system)
0aa34e82
AE
94 (inputs
95 `(("texlive-extra-src" ,texlive-extra-src)
96 ("cairo" ,cairo)
97 ("fontconfig" ,fontconfig)
98 ("fontforge" ,fontforge)
99 ("freetype" ,freetype)
100 ("gd" ,gd)
0256c746 101 ("gmp" ,gmp)
0aa34e82
AE
102 ("ghostscript" ,ghostscript)
103 ("graphite2" ,graphite2)
104 ("harfbuzz" ,harfbuzz)
105 ("icu4c" ,icu4c)
106 ("libpaper" ,libpaper)
107 ("libpng" ,libpng)
108 ("libxaw" ,libxaw)
109 ("libxt" ,libxt)
0256c746 110 ("mpfr" ,mpfr)
0aa34e82
AE
111 ("perl" ,perl)
112 ("pixman" ,pixman)
113 ("poppler" ,poppler)
114 ("potrace" ,potrace)
115 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
116 ("ruby" ,ruby)
117 ("tcsh" ,tcsh)
118 ("teckit" ,teckit)
119 ("zlib" ,zlib)
120 ("zziplib" ,zziplib)))
c4c4cc05 121 (native-inputs
e9a6d225 122 `(("pkg-config" ,pkg-config)))
eb0119ef
AE
123 (arguments
124 `(#:out-of-source? #t
125 #:configure-flags
126 `("--disable-native-texlive-build"
fd89b36b 127 "--with-system-cairo"
eb0119ef 128 "--with-system-freetype2"
fd89b36b 129 "--with-system-gd"
0256c746 130 "--with-system-gmp"
be2c88ca 131 "--with-system-graphite2"
c70cf7eb 132 "--with-system-harfbuzz"
eb0119ef
AE
133 "--with-system-icu"
134 "--with-system-libgs"
609578a7 135 "--with-system-libpaper"
eb0119ef 136 "--with-system-libpng"
0256c746 137 "--with-system-mpfr"
fd89b36b 138 "--with-system-pixman"
eb0119ef 139 "--with-system-poppler"
75916982 140 "--with-system-potrace"
eb0119ef
AE
141 "--with-system-teckit"
142 "--with-system-xpdf"
143 "--with-system-zlib"
144 "--with-system-zziplib")
2f4640e3
MW
145
146 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
147 ;; XXX FIXME fix luajit properly on mips64.
d2e84281 148 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
2f4640e3 149 (%current-system))))
eb0119ef 150 #:phases
4a6635f3
AE
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
161 ;; man pages.
162 (with-directory-excursion (string-append out "/bin/")
163 (for-each symlink
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))))))))
0aa34e82
AE
174 (synopsis "TeX Live, a package of the TeX typesetting system")
175 (description
176 "TeX Live provides a comprehensive TeX document production system.
177It includes all the major TeX-related programs, macro packages, and fonts
178that are free software, including support for many languages around the
179world.
180
181This package contains the binaries.")
132e14b4
EF
182 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
183 (home-page "https://www.tug.org/texlive/")))
0aa34e82 184
9d913b25
RW
185(define-public texlive-dvips
186 (package
187 (name "texlive-dvips")
188 (version (number->string %texlive-revision))
189 (source (origin
190 (method svn-fetch)
191 (uri (svn-reference
192 (url (string-append "svn://www.tug.org/texlive/tags/"
193 %texlive-tag "/Master/texmf-dist/"
194 "/dvips"))
195 (revision %texlive-revision)))
196 (sha256
197 (base32
198 "1k11yvz4q95bxyxczwvd4r177h6a2gg03xmf51kmgjgz8an2gq2w"))))
199 (build-system trivial-build-system)
200 (arguments
201 `(#:modules ((guix build utils))
202 #:builder
203 (begin
204 (use-modules (guix build utils))
205 (let ((target (string-append (assoc-ref %outputs "out")
206 "/share/texmf-dist/dvips")))
207 (mkdir-p target)
208 (copy-recursively (assoc-ref %build-inputs "source") target)
209 #t))))
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
213to PostScript.")
214 ;; Various free software licenses apply to individual files.
215 (license (list license:lppl1.3c+
216 license:expat
217 license:lgpl3+))))
218
99952c53
RW
219(define-public texlive-generic-unicode-data
220 (package
221 (name "texlive-generic-unicode-data")
222 (version (number->string %texlive-revision))
223 (source (origin
224 (method svn-fetch)
225 (uri (svn-reference
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)))
230 (sha256
231 (base32
232 "0ivrhp6jz31pl4z841g4ws41lmvdiwz4sslmhf02inlib79gz6r2"))))
233 (build-system trivial-build-system)
234 (arguments
235 `(#:modules ((guix build utils))
236 #:builder
237 (begin
238 (use-modules (guix build utils))
239 (let ((target (string-append (assoc-ref %outputs "out")
240 "/share/texmf-dist/tex/generic/unicode-data")))
241 (mkdir-p target)
242 (copy-recursively (assoc-ref %build-inputs "source") target)
243 #t))))
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
247data for TeX use. It contains a set of text files provided by the Unicode
248Consortium 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
250Database. Accompanying these source data are generic TeX loader files
251allowing this data to be used as part of TeX runs, in particular in building
252format files. Currently there are two loader files: one for general character
253set up and one for initializing XeTeX character classes as has been carried
254out to date by @code{unicode-letters.tex}. ")
255 (license license:lppl1.3c+)))
256
9e99b1b4
RW
257(define-public texlive-generic-dehyph-exptl
258 (package
259 (name "texlive-generic-dehyph-exptl")
260 (version (number->string %texlive-revision))
261 (source (origin
262 (method svn-fetch)
263 (uri (svn-reference
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)))
268 (sha256
269 (base32
270 "1l9wgv99qq0ysvlxqpj4g8bl0dywbzra4g8m2kmpg2fb0i0hczap"))))
271 (build-system trivial-build-system)
272 (arguments
273 `(#:modules ((guix build utils))
274 #:builder
275 (begin
276 (use-modules (guix build utils))
277 (let ((target (string-append (assoc-ref %outputs "out")
278 "/share/texmf-dist/tex/generic/dehyph-exptl")))
279 (mkdir-p target)
280 (copy-recursively (assoc-ref %build-inputs "source") target)
281 #t))))
282 (home-page "http://projekte.dante.de/Trennmuster/WebHome")
283 (synopsis "Hyphenation patterns for German")
284 (description "The package provides experimental hyphenation patterns for
285the German language, covering both traditional and reformed orthography. The
286patterns can be used with packages Babel and hyphsubst from the Oberdiek
287bundle.")
288 ;; Hyphenation patterns are under the Expat license; documentation is
289 ;; under LPPL.
290 (license (list license:expat license:lppl))))
291
453aae66
RW
292(define-public texlive-generic-tex-ini-files
293 (package
294 (name "texlive-generic-tex-ini-files")
295 (version (number->string %texlive-revision))
296 (source (origin
297 (method svn-fetch)
298 (uri (svn-reference
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)))
303 (sha256
304 (base32
305 "1wh42n1lmzcvi3g6mm31nm3yd5ha5bl260xqc444jg1m9fdp3wz5"))))
306 (build-system trivial-build-system)
307 (arguments
308 `(#:modules ((guix build utils))
309 #:builder
310 (begin
311 (use-modules (guix build utils))
312 (let ((target (string-append (assoc-ref %outputs "out")
313 "/share/texmf-dist/tex/generic/tex-ini-files")))
314 (mkdir-p target)
315 (copy-recursively (assoc-ref %build-inputs "source") target)
316 #t))))
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
320for creating TeX formats. These files are commonly used to introduced
321distribution-dependent variations in formats. They are also used to
322allow existing format source files to be used with newer engines, for example
323to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
324 (license license:public-domain)))
325
9b134da8
RW
326(define-public texlive-generic-hyph-utf8
327 (package
328 (name "texlive-generic-hyph-utf8")
329 (version (number->string %texlive-revision))
330 (source (origin
331 (method svn-fetch)
332 (uri (svn-reference
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)))
337 (sha256
338 (base32
339 "0ghizcz7ps16dzfqf66wwg5i181assc6qsm0g7g5dbmp909931vi"))))
340 (build-system trivial-build-system)
341 (arguments
342 `(#:modules ((guix build utils))
343 #:builder
344 (begin
345 (use-modules (guix build utils))
346 (let ((target (string-append (assoc-ref %outputs "out")
347 "/share/texmf-dist/tex/generic/hyph-utf8")))
348 (mkdir-p target)
349 (copy-recursively (assoc-ref %build-inputs "source") target)
350 #t))))
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
354hyphenation patterns in UTF-8 format, whereas older systems require
355hyphenation patterns in the 8-bit encoding of the font in use (such encodings
356are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
357etc). The present package offers a collection of conversions of existing
358patterns to UTF-8 format, together with converters for use with 8-bit fonts in
359older systems. Since hyphenation patterns for Knuthian-style TeX systems are
360only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
361converters, 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+
365 license:lppl1.2+
366 license:lppl1.3
367 license:lppl1.3+
368 license:lppl1.3a+
369 license:lgpl2.1
370 license:lgpl2.1+
371 license:lgpl3+
372 license:gpl2+
373 license:gpl3+
374 license:mpl1.1
375 license:asl2.0
376 license:expat
377 license:bsd-3
378 license:cc0
379 license:public-domain
380 license:wtfpl2))))
381
8ada0f0b
RW
382(define-public texlive-metafont-base
383 (package
384 (name "texlive-metafont-base")
385 (version (number->string %texlive-revision))
386 (source (origin
387 (method svn-fetch)
388 (uri (svn-reference
389 (url (string-append "svn://www.tug.org/texlive/tags/"
390 %texlive-tag "/Master/texmf-dist/"
391 "/metafont"))
392 (revision %texlive-revision)))
393 (sha256
394 (base32
395 "1yl4n8cn5xqk2nc22zgzq6ymd7bhm6xx1mz3azip7i3ki4bhb5q5"))))
396 (build-system gnu-build-system)
397 (arguments
398 `(#:tests? #f ; no test target
399 #:phases
400 (modify-phases %standard-phases
401 (delete 'configure)
402 (replace 'build
403 (lambda* (#:key inputs #:allow-other-keys)
404 (let ((cwd (getcwd)))
405 (setenv "MFINPUTS"
406 (string-append cwd "/base:"
407 cwd "/misc:"
408 cwd "/roex:"
409 cwd "/feynmf:"
410 cwd "/mfpic:"
411 cwd "/config")))
412 (mkdir "build")
413 (with-directory-excursion "build"
414 (zero? (system* "inimf" "mf.mf")))))
415 (replace 'install
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")))
420 (mkdir-p base)
421 (mkdir-p mf)
422 (install-file "build/mf.base" base)
423 (copy-recursively "base" mf)
424 #t))))))
425 (native-inputs
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
430build fonts using the Metafont system.")
431 (license license:knuth)))
432
3c4f1ec7
RW
433(define-public texlive-fonts-cm
434 (package
435 (name "texlive-fonts-cm")
436 (version (number->string %texlive-revision))
437 (source (origin
438 (method svn-fetch)
439 (uri (svn-reference
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)))
444 (sha256
445 (base32
446 "045k5b9rdmbxpy1a3006l1x96z1rd18vg3cwrvnld9bqybw5qz44"))))
447 (build-system gnu-build-system)
448 (arguments
449 `(#:modules ((guix build gnu-build-system)
450 (guix build utils)
451 (srfi srfi-1)
452 (srfi srfi-26))
453 #:tests? #f ; no tests
454 #:phases
455 (modify-phases %standard-phases
456 (delete 'configure)
457 (replace 'build
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
463 (setenv "MFINPUTS"
464 (string-append (getcwd) ":"
465 mf "/share/texmf-dist/metafont/base")))
466 (mkdir "build")
467 (every (lambda (font)
468 (format #t "building font ~a\n" font)
469 (zero? (system* "mf" "-progname=mf"
470 "-output-directory=build"
471 (string-append "\\"
472 "mode:=ljfour; "
473 "mag:=1; "
474 "batchmode; "
475 "input "
476 (basename font ".mf")))))
477 (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))))
478 (replace 'install
479 (lambda* (#:key outputs #:allow-other-keys)
480 (let* ((out (assoc-ref outputs "out"))
481 (tfm (string-append
482 out "/share/texmf-dist/fonts/tfm/public/cm"))
483 (mf (string-append
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"))
489 #t))))))
490 (native-inputs
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
496Knuth. The Computer Modern font family is a large collection of text,
497display, and mathematical fonts in a range of styles, based on Monotype Modern
4988A.")
499 (license license:knuth)))
500
5ebba61a
RW
501(define-public texlive-fonts-knuth-lib
502 (package
503 (name "texlive-fonts-knuth-lib")
504 (version (number->string %texlive-revision))
505 (source (origin
506 (method svn-fetch)
507 (uri (svn-reference
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)))
512 (sha256
513 (base32
514 "0in9aqyi8jkyf9d16z0li50z5fpwj1iwgwm83gmvwqcf7chfs04y"))))
515 (build-system gnu-build-system)
516 (arguments
517 `(#:modules ((guix build gnu-build-system)
518 (guix build utils)
519 (srfi srfi-26))
520 #:tests? #f ; no tests
521 #:phases
522 (modify-phases %standard-phases
523 (delete 'configure)
524 (replace 'build
525 (lambda* (#:key inputs #:allow-other-keys)
526 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
527 ;; Tell mf where to find mf.base
528 (setenv "MFBASES"
529 (string-append mf "/share/texmf-dist/web2c"))
530 ;; Tell mf where to look for source files
531 (setenv "MFINPUTS"
532 (string-append (getcwd) ":"
533 mf "/share/texmf-dist/metafont/base")))
534 (mkdir "build")
535 (zero? (system* "mf" "-progname=mf"
536 "-output-directory=build"
537 (string-append "\\"
538 "mode:=ljfour; "
539 "mag:=1; "
540 "batchmode; "
541 "input manfnt")))))
542 (replace 'install
543 (lambda* (#:key outputs #:allow-other-keys)
544 (let* ((out (assoc-ref outputs "out"))
545 (tfm (string-append
546 out "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
547 (mf (string-append
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"))
553 #t))))))
554 (native-inputs
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
560from Donald Knuth, including the plain format, plain base, and the MF logo
561fonts.")
562 (license license:knuth)))
563
a00d5933
RW
564(define-public texlive-fonts-latex
565 (package
566 (name "texlive-fonts-latex")
567 (version (number->string %texlive-revision))
568 (source (origin
569 (method svn-fetch)
570 (uri (svn-reference
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)))
575 (sha256
576 (base32
577 "0ypsm4xv9cw0jckk2qc7gi9hcmhf31mrg56pz3llyx3yd9vq2lps"))))
578 (build-system gnu-build-system)
579 (arguments
580 `(#:modules ((guix build gnu-build-system)
581 (guix build utils)
582 (srfi srfi-1)
583 (srfi srfi-26))
584 #:tests? #f ; no tests
585 #:phases
586 (modify-phases %standard-phases
587 (delete 'configure)
588 (replace 'build
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
594 (setenv "MFINPUTS"
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")))
599 (mkdir "build")
600 (every (lambda (font)
601 (format #t "building font ~a\n" font)
602 (zero? (system* "mf" "-progname=mf"
603 "-output-directory=build"
604 (string-append "\\"
605 "mode:=ljfour; "
606 "mag:=1; "
607 "batchmode; "
608 "input " font))))
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"))))
614 (replace 'install
615 (lambda* (#:key outputs #:allow-other-keys)
616 (let* ((out (assoc-ref outputs "out"))
617 (tfm (string-append
618 out "/share/texmf-dist/fonts/tfm/public/latex-fonts"))
619 (mf (string-append
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"))
625 #t))))))
626 (native-inputs
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
633packages and classes. It includes invisible fonts (for use with the slides
634class), line and circle fonts (for use in the picture environment) and LaTeX
635symbol fonts.")
636 (license license:lppl1.2+)))
637
566e95f7
RW
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
641 (package
642 (name "texlive-tex-plain")
643 (version (number->string %texlive-revision))
644 (source (origin
645 (method svn-fetch)
646 (uri (svn-reference
647 (url (string-append "svn://www.tug.org/texlive/tags/"
648 %texlive-tag "/Master/texmf-dist/"
649 "/tex/plain"))
650 (revision %texlive-revision)))
651 (sha256
652 (base32
653 "1ifmbyl3ir8k0v1g25xjb5rcyy5vhj8a3fa2088nczga09hna5vn"))))
654 (build-system trivial-build-system)
655 (arguments
656 `(#:modules ((guix build utils))
657 #:builder
658 (begin
659 (use-modules (guix build utils))
660 (let ((target (string-append (assoc-ref %outputs "out")
661 "/share/texmf-dist/tex/plain")))
662 (mkdir-p target)
663 (copy-recursively (assoc-ref %build-inputs "source") target)
664 #t))))
665 (home-page "https://www.ctan.org/pkg/plain")
666 (synopsis "Plain TeX format and supporting files")
667 (description
668 "Contains files used to build the Plain TeX format, as described in the
669TeXbook, together with various supporting files (some also discussed in the
670book).")
671 (license license:knuth)))
672
010f476f
RW
673(define-public texlive-latex-base
674 (let ((texlive-dir
675 (lambda (dir hash)
676 (origin
677 (method svn-fetch)
678 (uri (svn-reference
679 (url (string-append "svn://www.tug.org/texlive/tags/"
680 %texlive-tag "/Master/texmf-dist/"
681 dir))
682 (revision %texlive-revision)))
683 (sha256 (base32 hash))))))
684 (package
685 (name "texlive-latex-base")
686 (version (number->string %texlive-revision))
687 (source (origin
688 (method svn-fetch)
689 (uri (texlive-ref "latex" "base"))
690 (sha256
691 (base32
692 "1h9pir2hz6i9avc4lrl733p3zf4rpkg8537x1zdbhs91hvhikw9k"))))
693 (build-system gnu-build-system)
694 (arguments
695 `(#:modules ((guix build gnu-build-system)
696 (guix build utils)
697 (ice-9 match)
698 (srfi srfi-1)
699 (srfi srfi-26))
700 #:tests? #f ; no tests
701 #:phases
702 (modify-phases %standard-phases
703 (delete 'configure)
704 (replace 'build
705 (lambda* (#:key inputs #:allow-other-keys)
706 ;; Find required fonts
707 (setenv "TFMFONTS"
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"))
714 (setenv "TEXINPUTS"
715 (string-append
716 (getcwd) ":"
717 (getcwd) "/build:"
718 (string-join
719 (append-map (match-lambda
720 ((_ . dir)
721 (find-files dir
722 (lambda (_ stat)
723 (eq? 'directory (stat:type stat)))
724 #:directories? #t
725 #:stat stat)))
726 inputs)
727 ":")))
728
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 "%")))
733
734 (mkdir "build")
735 (mkdir "web2c")
736 (and (zero? (system* "luatex" "-ini" "-interaction=batchmode"
737 "-output-directory=build"
738 "unpack.ins"))
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
743 ;; engine.
744
745 ;; FIXME: XeTeX fails to build because neither
746 ;; \XeTeXuseglyphmetrics nor \XeTeXdashbreakstate are
747 ;; defined.
748 (every
749 (lambda (format)
750 (zero? (system* "latex" "-ini" "-interaction=batchmode"
751 "-output-directory=web2c"
752 "-translate-file=cp227.tcx"
753 (string-append "*" format ".ini"))))
754 '("latex" ;"xetex"
755 ))
756 (every
757 (lambda (format)
758 (zero? (system* "luatex" "-ini" "-interaction=batchmode"
759 "-output-directory=web2c"
760 (string-append format ".ini"))))
761 '("dviluatex" "dvilualatex" "luatex" "lualatex" "xelatex")))))
762 (replace 'install
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")))
769 (mkdir-p target)
770 (mkdir-p 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" ".*"))
776 #t))))))
777 (native-inputs
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")
804 (description
805 "This bundle comprises the source of LaTeX itself, together with several
806packages which are considered \"part of the kernel\". This bundle, together
807with the required packages, constitutes what every LaTeX distribution should
808contain.")
809 (license license:lppl1.3c+))))
810
3e485ed2
RW
811(define-public texlive-latex-filecontents
812 (package
813 (name "texlive-latex-filecontents")
814 (version (number->string %texlive-revision))
815 (source (origin
816 (method svn-fetch)
817 (uri (texlive-ref "latex" "filecontents"))
818 (sha256
819 (base32
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")
825 (description
826 "LaTeX2e's @code{filecontents} and @code{filecontents*} environments
827enable a LaTeX source file to generate external files as it runs through
828LaTeX. However, there are two limitations of these environments: they refuse
829to overwrite existing files, and they can only be used in the preamble of a
830document. The filecontents package removes these limitations, letting you
831overwrite existing files and letting you use @code{filecontents} /
832@code{filecontents*} anywhere.")
833 (license license:lppl1.3c+)))
834
1193aa89
RW
835(define-public texlive-generic-ifxetex
836 (package
837 (name "texlive-generic-ifxetex")
838 (version "0.6")
839 (source (origin
840 (method svn-fetch)
841 (uri (texlive-ref "generic" "ifxetex"))
842 (sha256
843 (base32
844 "0w2xj7n0szavj329kds09q626szkc378p3w0sk022q0ln4ksz86d"))))
845 (build-system texlive-build-system)
846 (arguments
847 '(#:tex-directory "generic/ifxetex"
848 #:tex-format "xelatex"))
849 (inputs
850 `(("texlive-latex-filecontents" ,texlive-latex-filecontents)))
851 (home-page "http://www.ctan.org/pkg/ifxetex")
852 (synopsis "Am I running under XeTeX?")
853 (description
854 "This is a simple package which provides an @code{\\ifxetex} conditional,
855so that other code can determine that it is running under XeTeX. The package
856requires the etexe-TeX extensions to the TeX primitive set.")
857 (license license:lppl1.3c+)))
858
437822a1
RW
859(define-public texlive-latex-fancyvrb
860 (package
861 (name "texlive-latex-fancyvrb")
862 (version (number->string %texlive-revision))
863 (source (origin
864 (method svn-fetch)
865 (uri (texlive-ref "latex" "fancyvrb"))
866 (sha256
867 (base32
868 "03l7140y031rr14h02i4z9zqsfvrbn7wzwxbjsrjcgrk6sdr71wv"))))
869 (build-system texlive-build-system)
870 (arguments
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")
877 (description
878 "This package provides tools for the flexible handling of verbatim text
879including: verbatim commands in footnotes; a variety of verbatim environments
880with many parameters; ability to define new customized verbatim environments;
881save and restore verbatim text and environments; write and read files in
882verbatim mode; build \"example\" environments (showing both result and
883verbatim source).")
884 (license license:lppl1.0+)))
885
4eebd2cd
RW
886(define-public texlive-latex-graphics
887 (package
888 (name "texlive-latex-graphics")
889 (version (number->string %texlive-revision))
890 (source (origin
891 (method svn-fetch)
892 (uri (texlive-ref "latex" "graphics"))
893 (sha256
894 (base32
895 "17ka701xr9nqsjlhz30hphr8d9j4zzwgv5zl5r2f118yzqh9c34v"))))
896 (build-system texlive-build-system)
897 (arguments
898 '(#:tex-directory "latex/graphics"
899 #:phases
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")))
906 (mkdir-p target)
907 (install-file (string-append cfg "/graphics.cfg") target)
908 (install-file (string-append cfg "/color.cfg") target)
909 #t)))
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")))
915 (mkdir-p target)
916 (copy-recursively def target)
917 #t))))))
918 (native-inputs
919 `(("graphics-cfg"
920 ,(origin
921 (method git-fetch)
922 (uri (git-reference
923 (url "https://github.com/latex3/graphics-cfg.git")
924 (commit "19d1238af17df376cd46333b229579b0f7f3a41f")))
925 (sha256
926 (base32
927 "12kbgbm52gmmgn8zajb74s8n5rvnxcfdvs3iyj8vcw5vrsw5i6mh"))))
928 ("graphics-def"
929 ,(origin
930 (method svn-fetch)
931 (uri (svn-reference
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)))
936 (sha256
937 (base32
938 "1q5l0x3jsy74v0zq4c9g0x0rb9jfzf7cbhdzkbchyydv49iav802"))))))
939 (home-page "http://www.ctan.org/pkg/latex-graphics")
940 (synopsis "LaTeX standard graphics bundle")
941 (description
942 "This is a collection of LaTeX packages for producing color, including
943graphics (e.g. PostScript) files, and rotation and scaling of text in LaTeX
944documents. It comprises the packages color, graphics, graphicx, trig, epsfig,
945keyval, and lscape.")
946 ;; The configuration files are released under CC0.
947 (license (list license:lppl1.3c+
948 license:cc0))))
949
f5a6af42
RW
950(define-public texlive-latex-xcolor
951 (package
952 (name "texlive-latex-xcolor")
953 (version (number->string %texlive-revision))
954 (source (origin
955 (method svn-fetch)
956 (uri (texlive-ref "latex" "xcolor"))
957 (sha256
958 (base32
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")
964 (description
965 "The package starts from the basic facilities of the colorcolor package,
966and provides easy driver-independent access to several kinds of color tints,
967shades, tones, and mixes of arbitrary colors. It allows a user to select a
968document-wide target color model and offers complete tools for conversion
969between eight color models. Additionally, there is a command for alternating
970row colors plus repeated non-aligned material (like horizontal lines) in
971tables.")
972 (license license:lppl1.2+)))
973
4d660fdf
RW
974(define-public texlive-latex-hyperref
975 (package
976 (name "texlive-latex-hyperref")
977 (version "6.84a2")
978 ;; The sources in the TeX Live SVN repository do not contain hluatex.dtx,
979 ;; so we fetch the release from GitHub.
980 (source (origin
981 (method url-fetch)
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"))
985 (sha256
986 (base32
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")
992 (description
993 "The hyperref package is used to handle cross-referencing commands in
994LaTeX to produce hypertext links in the document. The package provides
995backends for the special set defined for HyperTeX DVI processors; for embedded
996pdfmark commands for processing by Acrobat Distiller (dvips and dvipsone); for
997dviwindo; for PDF control within pdfTeX and dvipdfm; for TeX4ht; and for VTeX
998pdf and HTML backends. The package is distributed with the backref and
999nameref packages, which make use of the facilities of hyperref.")
1000 (license license:lppl1.3+)))
1001
c3455b7d
RW
1002(define-public texlive-latex-oberdiek
1003 (package
1004 (name "texlive-latex-oberdiek")
1005 (version (number->string %texlive-revision))
1006 (source (origin
1007 (method svn-fetch)
1008 (uri (texlive-ref "latex" "oberdiek"))
1009 (sha256
1010 (base32
1011 "0aswvsxgsn709xmvpcg50d2xl7vcy1ckdxb9c1cligqqfjjvviqf"))))
1012 (build-system texlive-build-system)
1013 (arguments
1014 '(#:tex-directory "latex/oberdiek"
1015 #:phases
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
1019 (lambda _
1020 (substitute* "oberdiek.ins"
1021 (("\\\\batchinput\\{ifpdf.ins\\}") ""))
1022 #t)))))
1023 (home-page "http://www.ctan.org/pkg/oberdiek")
1024 (synopsis "Bundle of packages submitted by Heiko Oberdiek")
1025 (description
1026 "The bundle comprises various LaTeX packages, providing among others:
1027better accessibility support for PDF files; extensible chemists reaction
1028arrows; record information about document class(es) used; and many more.")
1029 (license license:lppl1.3+)))
1030
f2536af2
RW
1031(define-public texlive-latex-tools
1032 (package
1033 (name "texlive-latex-tools")
1034 (version (number->string %texlive-revision))
1035 (source (origin
1036 (method svn-fetch)
1037 (uri (texlive-ref "latex" "tools"))
1038 (sha256
1039 (base32
1040 "052a0pch2k5zls5jlay9xxcf93rw3i60a2x28y3ip3rhbsv3xgiz"))))
1041 (build-system texlive-build-system)
1042 (arguments
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")
1047 (description
1048 "This package is a collection of (variously) simple tools provided as
1049part of the LaTeX required tools distribution, comprising the following
1050packages: afterpage, array, bm, calc, dcolumn, delarray, enumerate, fileerr,
1051fontsmpl, ftnright, hhline, indentfirst, layout, longtable, multicol,
1052rawfonts, showkeys, somedefs, tabularx, theorem, trace, varioref, verbatim,
1053xr, and xspace.")
1054 (license license:lppl1.3+)))
1055
35adcc3a
RW
1056(define-public texlive-latex-url
1057 (package
1058 (name "texlive-latex-url")
1059 (version (number->string %texlive-revision))
1060 (source (origin
1061 (method svn-fetch)
1062 (uri (svn-reference
1063 (url (string-append "svn://www.tug.org/texlive/tags/"
1064 %texlive-tag "/Master/texmf-dist/"
1065 "/tex/latex/url"))
1066 (revision %texlive-revision)))
1067 (sha256
1068 (base32
1069 "184s2543cwia5l7iibhlkl1ffbncfhjpv5p56zq0c15by5sghlac"))))
1070 (build-system trivial-build-system)
1071 (arguments
1072 `(#:modules ((guix build utils))
1073 #:builder
1074 (begin
1075 (use-modules (guix build utils))
1076 (let ((target (string-append (assoc-ref %outputs "out")
1077 "/share/texmf-dist/tex/latex/url")))
1078 (mkdir-p target)
1079 (copy-recursively (assoc-ref %build-inputs "source") target)
1080 #t))))
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
1084allows linebreaks at certain characters or combinations of characters, accepts
1085reconfiguration, and can usually be used in the argument to another command.
1086The command is intended for email addresses, hypertext links,
1087directories/paths, etc., which normally have no spaces, so by default the
1088package ignores spaces in its argument. However, a package option allows
1089spaces, which is useful for operating systems where spaces are a common part
1090of file names.")
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+)))
1094
a5b1ef84
RW
1095(define-public texlive-latex-l3kernel
1096 (package
1097 (name "texlive-latex-l3kernel")
1098 (version (number->string %texlive-revision))
1099 (source (origin
1100 (method svn-fetch)
1101 (uri (texlive-ref "latex" "l3kernel"))
1102 (sha256
1103 (base32
1104 "0ndqw0flhl20f4ny5lssp8rqpnj5kglyg59whbdrxbh2zc7w7j0b"))))
1105 (build-system texlive-build-system)
1106 (arguments
1107 '(#:tex-directory "latex/l3kernel"))
1108 (home-page "http://www.ctan.org/pkg/l3kernel")
1109 (synopsis "LaTeX3 programmers’ interface")
1110 (description
1111 "The l3kernel bundle provides an implementation of the LaTeX3
1112programmers’ interface, as a set of packages that run under LaTeX 2e. The
1113interface provides the foundation on which the LaTeX3 kernel and other future
1114code are built: it is an API for TeX programmers. The packages are set up so
1115that the LaTeX3 conventions can be used with regular LaTeX 2e packages.")
1116 (license license:lppl1.3c+)))
1117
cc09d48b
RW
1118(define-public texlive-latex-l3packages
1119 (package
1120 (name "texlive-latex-l3packages")
1121 (version (number->string %texlive-revision))
1122 (source (origin
1123 (method svn-fetch)
1124 (uri (texlive-ref "latex" "l3packages"))
1125 (sha256
1126 (base32
1127 "1p1y9my6ccmp2ab91fzqqgih8ifrk4y3wyh397kagiq9f6a6v91f"))))
1128 (build-system texlive-build-system)
1129 (arguments
1130 '(#:tex-directory "latex/l3packages"
1131 #:phases
1132 (modify-phases %standard-phases
1133 ;; All package sources are in sub-directories, so we need to add them
1134 ;; to TEXINPUTS.
1135 (add-after 'unpack 'set-TEXINPUTS
1136 (lambda _
1137 (let ((cwd (getcwd)))
1138 (setenv "TEXINPUTS"
1139 (string-append cwd "/l3keys2e:"
1140 cwd "/xparse:"
1141 cwd "/xfrac:"
1142 cwd "/xfp:"
1143 cwd "/xtemplate")))
1144 #t)))))
1145 (inputs
1146 `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1147 (home-page "http://www.ctan.org/pkg/l3packages")
1148 (synopsis "High-level LaTeX3 concepts")
1149 (description
1150 "This bundle holds prototype implementations of concepts for a LaTeX
1151designer interface, to be used with the experimental LaTeX kernel as
1152programming tools and kernel sup­port. Packages provided in this release are:
1153
1154@enumerate
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
1159 commands; and
1160@item xtemplate, which provides a means of defining generic functions using a
1161 key-value syntax.
1162@end enumerate\n")
1163 (license license:lppl1.3c+)))
1164
58308491
RW
1165(define-public texlive-latex-fontspec
1166 (package
1167 (name "texlive-latex-fontspec")
1168 (version (number->string %texlive-revision))
1169 (source (origin
1170 (method svn-fetch)
1171 (uri (texlive-ref "latex" "fontspec"))
1172 (sha256
1173 (base32
1174 "1rx43y5xmjqvc27pjdnmqwp4pcw3czcfd6nfpmzc1gnqfl1hlc0q"))))
1175 (build-system texlive-build-system)
1176 (arguments
1177 '(#:tex-directory "latex/fontspec"
1178 #:build-targets '("fontspec.dtx")))
1179 (inputs
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")
1183 (description
1184 "Fontspec is a package for XeLaTeX and LuaLaTeX. It provides an
1185automatic and unified interface to feature-rich AAT and OpenType fonts through
1186the NFSS in LaTeX running on XeTeX or LuaTeX engines. The package requires
1187the l3kernel and xparse bundles from the LaTeX 3 development team.")
1188 (license license:lppl1.3+)))
1189
e93f472d
RW
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
1194 (package
1195 (name "texlive-luatex-lualibs")
1196 (version "2.5")
1197 (source (origin
1198 (method url-fetch)
1199 (uri (string-append "https://github.com/lualatex/lualibs/"
1200 "releases/download/v"
1201 version "/lualibs.zip"))
1202 (sha256
1203 (base32
1204 "1xx9blvrmx9hyhrl345lpai9m6xxnw997261a1ahn1bm5r2j5fqy"))))
1205 (build-system gnu-build-system)
1206 (arguments
1207 `(#:make-flags
1208 (list (string-append "DESTDIR="
1209 (assoc-ref %outputs "out")
1210 "/share/texmf-dist"))
1211 #:phases
1212 (modify-phases %standard-phases
1213 (delete 'configure))))
1214 (native-inputs
1215 `(("texlive-bin" ,texlive-bin)
1216 ("unzip" ,unzip)
1217 ("zip" ,zip)))
1218 (home-page "https://github.com/lualatex/lualibs")
1219 (synopsis "Lua modules for general programming (in the (La)TeX world)")
1220 (description
1221 "Lualibs is a collection of Lua modules useful for general programming.
1222The bundle is based on Lua modules shipped with ConTeXt, and made available in
1223this bundle for use independent of ConTeXt.")
1224 ;; GPL version 2 only
1225 (license license:gpl2)))
1226
2573163a
RW
1227(define-public texlive-latex-amsmath
1228 (package
1229 (name "texlive-latex-amsmath")
1230 (version (number->string %texlive-revision))
1231 (source (origin
1232 (method svn-fetch)
1233 (uri (texlive-ref "latex" "amsmath"))
1234 (sha256
1235 (base32
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")
1241 (description
1242 "This is the principal package in the AMS-LaTeX distribution. It adapts
1243for use in LaTeX most of the mathematical features found in AMS-TeX; it is
1244highly recommended as an adjunct to serious mathematical typesetting in LaTeX.
1245When amsmath is loaded, AMS-LaTeX packages @code{amsbsyamsbsy} (for bold
1246symbols), @code{amsopnamsopn} (for operator names) and
1247@code{amstextamstext} (for text embedded in mathematics) are also loaded.
1248This package is part of the LaTeX required distribution; however, several
1249contributed packages add still further to its appeal; examples are
1250@code{empheqempheq}, which provides functions for decorating and highlighting
1251mathematics, and @code{ntheoremntheorem}, for specifying theorem (and similar)
1252definitions.")
1253 (license license:lppl1.3c+)))
1254
18e366e8
RW
1255(define-public texlive-latex-amscls
1256 (package
1257 (name "texlive-latex-amscls")
1258 (version (number->string %texlive-revision))
1259 (source (origin
1260 (method svn-fetch)
1261 (uri (texlive-ref "latex" "amscls"))
1262 (sha256
1263 (base32
1264 "0jmcr37mcdi7drczppvr6lmz5d5yd9m67ii79gp2nglg1xpw934j"))))
1265 (build-system texlive-build-system)
1266 (arguments
1267 `(#:tex-directory "latex/amscls"))
1268 (home-page "http://www.ctan.org/pkg/amscls")
1269 (synopsis "AMS document classes for LaTeX")
1270 (description
1271 "This bundle contains three AMS classes: @code{amsartamsart} (for writing
1272articles for the AMS), @code{amsbookamsbook} (for books) and
1273@code{amsprocamsproc} (for proceedings), together with some supporting
1274material. The material is made available as part of the AMS-LaTeX
1275distribution.")
1276 (license license:lppl1.3c+)))
1277
f84d5a09
RW
1278(define-public texlive-latex-babel
1279 (package
1280 (name "texlive-latex-babel")
1281 (version (number->string %texlive-revision))
1282 (source (origin
1283 (method svn-fetch)
1284 (uri (texlive-ref "latex" "babel"))
1285 (sha256
1286 (base32
1287 "1n3i5adsyy7jw0imnzrm2i8wkf73i3mjk9h3ic8cb9cd19i4r9r3"))))
1288 (build-system texlive-build-system)
1289 (arguments
1290 '(#:tex-directory "latex/babel"
1291 #:phases
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
1296 (lambda _
1297 (substitute* "babel.ins"
1298 (("askonceonly") "askforoverwritefalse"))
1299 #t)))))
1300 (home-page "http://www.ctan.org/pkg/babel")
1301 (synopsis "Multilingual support for Plain TeX or LaTeX")
1302 (description
1303 "The package manages culturally-determined typographical (and other)
1304rules, and hyphenation patterns for a wide range of languages. A document may
1305select a single language to be supported, or it may select several, in which
1306case the document may switch from one language to another in a variety of
1307ways. Babel uses contributed configuration files that provide the detail of
1308what has to be done for each language. Users of XeTeX are advised to use the
1309polyglossia package rather than Babel.")
1310 (license license:lppl1.3+)))
1311
93286d38
RW
1312(define-public texlive-latex-cyrillic
1313 (package
1314 (name "texlive-latex-cyrillic")
1315 (version (number->string %texlive-revision))
1316 (source (origin
1317 (method svn-fetch)
1318 (uri (texlive-ref "latex" "cyrillic"))
1319 (sha256
1320 (base32
1321 "1mdhl35hwas68ki56qqngzar37dwv4mm64l2canihr255bz34lbv"))))
1322 (build-system texlive-build-system)
1323 (arguments
1324 '(#:tex-directory "latex/cyrillic"))
1325 (home-page "http://www.ctan.org/pkg/latex-cyrillic")
1326 (synopsis "Support for Cyrillic fonts in LaTeX")
1327 (description
1328 "This bundle of macros files provides macro support (including font
1329encoding macros) for the use of Cyrillic characters in fonts encoded under the
1330T2* and X2 encodings. These encodings cover (between them) pretty much every
1331language that is written in a Cyrillic alphabet.")
1332 (license license:lppl1.3c+)))
1333
83fe6231
RW
1334(define-public texlive-latex-psnfss
1335 (package
1336 (name "texlive-latex-psnfss")
1337 (version (number->string %texlive-revision))
1338 (source (origin
1339 (method svn-fetch)
1340 (uri (texlive-ref "latex" "psnfss"))
1341 (sha256
1342 (base32
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")
1348 (description
1349 "The PSNFSS collection includes a set of files that provide a complete
1350working setup of the LaTeX font selection scheme (NFSS2) for use with common
1351PostScript fonts. It covers the so-called \"Base\" fonts (which are built
1352into any Level 2 PostScript printing device and the Ghostscript interpreter)
1353and a number of free fonts. It provides font definition files, macros and
1354font metrics. The bundle as a whole is part of the LaTeX required set of
1355packages.")
1356 (license license:lppl1.2+)))
1357
cb7bc20a
RW
1358(define-public texlive-union
1359 (lambda* (#:optional (packages '()))
1360 "Return 'texlive-union' package which is a union of PACKAGES and the
1361standard LaTeX packages."
1362 (let ((default-packages
1363 (list texlive-bin
1364 texlive-dvips
1365 texlive-fonts-cm
1366 texlive-fonts-latex
1367 texlive-metafont-base
1368 texlive-latex-base
1369 ;; LaTeX packages from the "required" set.
1370 texlive-latex-amsmath
1371 texlive-latex-amscls
1372 texlive-latex-babel
1373 texlive-latex-cyrillic
1374 texlive-latex-graphics
1375 texlive-latex-psnfss
1376 texlive-latex-tools)))
1377 (package
1378 (name "texlive-union")
1379 (version (number->string %texlive-revision))
1380 (source #f)
1381 (build-system trivial-build-system)
1382 (arguments
1383 '(#:modules ((guix build union)
1384 (guix build utils)
1385 (guix build texlive-build-system)
1386 (guix build gnu-build-system)
1387 (guix build gremlin)
1388 (guix elf))
1389 #:builder
1390 (begin
1391 (use-modules (ice-9 match)
1392 (srfi srfi-26)
1393 (guix build union)
1394 (guix build utils)
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
1400 ((name . _)
1401 (not (string=? "bash" name))))
1402 %build-inputs)
1403 (((names . directories) ...)
1404 (union-build (assoc-ref %outputs "out")
1405 directories
1406 #:create-all-directories? #t)))
1407
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"))
1415 (("^TEXMF = .*")
1416 "TEXMF = $TEXMFROOT/share/texmf-dist\n"))
1417 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash")
1418 "/bin"))
1419 (for-each
1420 (cut wrap-program <>
1421 `("TEXMFCNF" ":" = (,(dirname texmf.cnf)))
1422 `("TEXMF" ":" = (,(string-append out "/share/texmf-dist"))))
1423 (find-files (string-append out "/bin") ".*"))
1424 #t))))
1425 (inputs
1426 `(("bash" ,bash)
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
1433distribution.")
1434 (license (fold (lambda (package result)
1435 (match (package-license package)
1436 ((lst ...)
1437 (append lst result))
1438 ((? license:license? license)
1439 (cons license result))))
1440 '()
1441 (append default-packages packages)))))))
1442
8bcdc23f 1443(define texlive-texmf
0aa34e82
AE
1444 (package
1445 (name "texlive-texmf")
7a15a68f 1446 (version "2016")
0aa34e82
AE
1447 (source texlive-texmf-src)
1448 (build-system gnu-build-system)
1449 (inputs
1450 `(("texlive-bin" ,texlive-bin)
1451 ("lua" ,lua)
1452 ("perl" ,perl)
1453 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
1454 ("ruby" ,ruby)
1455 ("tcsh" ,tcsh)))
1456 (arguments
1457 `(#:modules ((guix build gnu-build-system)
1458 (guix build utils)
1459 (srfi srfi-26))
a348af40
LC
1460
1461 ;; This package takes 4 GiB, which we can't afford to distribute from
1462 ;; our servers.
1463 #:substitutable? #f
1464
0aa34e82 1465 #:phases
4a6635f3
AE
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")))
1471 (mkdir-p 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")
2d634d9b
FB
1485 (string-append "TEXMFROOT = " share))
1486 (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
1487 "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
1488 (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
4a6635f3
AE
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
1494 (setenv "PERL5LIB"
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")))))))
7a15a68f 1503 (properties `((max-silent-time . 9600))) ; don't time out while grafting
0aa34e82 1504 (synopsis "TeX Live, a package of the TeX typesetting system")
eb0119ef
AE
1505 (description
1506 "TeX Live provides a comprehensive TeX document production system.
1507It includes all the major TeX-related programs, macro packages, and fonts
1508that are free software, including support for many languages around the
0aa34e82
AE
1509world.
1510
1511This package contains the complete tree of texmf-dist data.")
132e14b4
EF
1512 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1513 (home-page "https://www.tug.org/texlive/")))
0aa34e82
AE
1514
1515(define-public texlive
1516 (package
1517 (name "texlive")
7a15a68f 1518 (version "2016")
0aa34e82
AE
1519 (source #f)
1520 (build-system trivial-build-system)
1521 (inputs `(("bash" ,bash) ; for wrap-program
1522 ("texlive-bin" ,texlive-bin)
1523 ("texlive-texmf" ,texlive-texmf)))
2d634d9b
FB
1524 (native-search-paths
1525 (list (search-path-specification
1526 (variable "TEXMFLOCAL")
1527 (files '("share/texmf-local")))))
0aa34e82
AE
1528 (arguments
1529 `(#:modules ((guix build utils))
1530 #:builder
1531 ;; Build the union of texlive-bin and texlive-texmf, but take the
1532 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
1533 (begin
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")))
1539 (mkdir out)
1540 (with-directory-excursion out
1541 (for-each
1542 (lambda (name)
1543 (symlink (string-append bin "/" name) name))
1544 '("include" "lib"))
1545 (mkdir "bin")
1546 (with-directory-excursion "bin"
1547 (setenv "PATH" (string-append bash "/bin"))
1548 (for-each
1549 (lambda (name)
1550 (symlink name (basename name))
1551 (wrap-program
1552 (basename name)
1553 `("TEXMFCNF" =
1554 (,(string-append texmf "/share/texmf-dist/web2c")))))
1555 (find-files (string-append bin "/bin/") "")))
1556 (mkdir "share")
1557 (with-directory-excursion "share"
1558 (for-each
1559 (lambda (name)
1560 (symlink (string-append bin "/share/" name) name))
1561 '("info" "man" "tlpkg"))
1562 (for-each
1563 (lambda (name)
1564 (symlink (string-append texmf "/share/" name) name))
1565 '("texmf-dist" "texmf-var"))))))))
1566 (synopsis "TeX Live, a package of the TeX typesetting system")
1567 (description
1568 "TeX Live provides a comprehensive TeX document production system.
1569It includes all the major TeX-related programs, macro packages, and fonts
1570that are free software, including support for many languages around the
1571world.
1572
1573This package contains the complete TeX Live distribution.")
132e14b4
EF
1574 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1575 (home-page "https://www.tug.org/texlive/")))
231eae53 1576
6b5eb840
AE
1577
1578;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
a348af40
LC
1579;; in particular dropping documentation and fonts. It weighs in at 470 MiB
1580;; instead of 4 GiB.
6b5eb840
AE
1581(define texlive-texmf-minimal
1582 (package (inherit texlive-texmf)
1583 (name "texlive-texmf-minimal")
1584 (arguments
1585 (substitute-keyword-arguments
1586 (package-arguments texlive-texmf)
1587 ((#:modules modules)
1588 `((ice-9 ftw)
1589 (srfi srfi-1)
1590 ,@modules))
1591 ((#:phases phases)
1592 `(modify-phases ,phases
1593 (add-after 'unpack 'prune
1594 (lambda _
1595 (define (delete subdir exclude)
1596 "Delete all files and directories in SUBDIR except for those
1597given in the list EXCLUDE."
1598 (with-directory-excursion subdir
1599 (for-each delete-file-recursively
1600 (lset-difference equal?
1601 (scandir ".")
1602 (append '("." "..")
1603 exclude)))))
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")))
1621 #t))))))
1622 (description
1623 "TeX Live provides a comprehensive TeX document production system.
1624It includes all the major TeX-related programs, macro packages, and fonts
1625that are free software, including support for many languages around the
1626world.
1627
1628This package contains a small subset of the texmf-dist data.")))
1629
1630
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")
1637 (inputs
1638 `(("texlive-texmf" ,texlive-texmf-minimal)
1639 ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
2d634d9b
FB
1640 (native-search-paths
1641 (list (search-path-specification
1642 (variable "TEXMFLOCAL")
1643 (files '("share/texmf-local")))))
6b5eb840
AE
1644 (description
1645 "TeX Live provides a comprehensive TeX document production system.
1646It includes all the major TeX-related programs, macro packages, and fonts
1647that are free software, including support for many languages around the
1648world.
1649
1650This package contains a small working part of the TeX Live distribution.")))
1651
ebcf74da
RW
1652(define-public perl-text-bibtex
1653 (package
1654 (name "perl-text-bibtex")
1655 (version "0.77")
1656 (source
1657 (origin
1658 (method url-fetch)
1659 (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
1660 version ".tar.gz"))
1661 (sha256
1662 (base32
1663 "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4"))))
1664 (build-system perl-build-system)
1665 (arguments
1666 `(#:phases
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"
1671 (("-Lbtparse" line)
1672 (string-append "-Wl,-rpath="
1673 (assoc-ref outputs "out") "/lib " line)))
1674 #t))
1675 (add-after 'unpack 'install-libraries-to-/lib
1676 (lambda* (#:key outputs #:allow-other-keys)
1677 (substitute* "Build.PL"
1678 (("lib64") "lib"))
1679 #t)))))
1680 (native-inputs
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,
1688and processing BibTeX files. @code{Text::BibTeX} gives you access to the data
1689at many different levels: you may work with BibTeX entries as simple field to
1690string mappings, or get at the original form of the data as a list of simple
1691values (strings, macros, or numbers) pasted together.")
2f3108ad 1692 (license license:perl-license)))
ebcf74da 1693
d4000680
RW
1694(define-public biber
1695 (package
1696 (name "biber-next")
1697 (version "2.6")
1698 (source (origin
1699 (method url-fetch)
1700 (uri (string-append "https://github.com/plk/biber/archive/v"
1701 version ".tar.gz"))
1702 (file-name (string-append name "-" version ".tar.gz"))
1703 (sha256
1704 (base32
1705 "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp"))))
1706 (build-system perl-build-system)
1707 (arguments
1708 `(#:phases
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")))))
1718 #t)))))
1719 (inputs
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)))
1760 (native-inputs
1761 `(("perl-config-autoconf" ,perl-config-autoconf)
1762 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1763 ("perl-module-build" ,perl-module-build)
1764 ;; for tests
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
1771other things it comes with full Unicode support.")
1772 (license license:artistic2.0)))
1773
253cdd6c
RW
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
1776;; documentation.
1777(define-public biber-2.5
1778 (package (inherit biber)
1779 (name "biber")
1780 (version "2.5")
1781 (source (origin
1782 (method url-fetch)
1783 (uri (string-append "https://github.com/plk/biber/archive/v"
1784 version ".tar.gz"))
1785 (file-name (string-append name "-" version ".tar.gz"))
1786 (sha256
1787 (base32
1788 "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv"))))
1789 (arguments
1790 (substitute-keyword-arguments (package-arguments biber)
1791 ((#:phases phases)
1792 `(modify-phases ,phases
1793 (add-before 'check 'delete-failing-test
1794 (lambda _
1795 (delete-file "t/sort-order.t")
1796 #t))))))
1797 (inputs
1798 `(("perl-date-simple" ,perl-date-simple)
1799 ,@(package-inputs biber)))))
6b5eb840 1800
231eae53
LC
1801(define-public rubber
1802 (package
1803 (name "rubber")
1804 (version "1.1")
1805 (source (origin
1806 (method url-fetch)
1807 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
1808 version "/+download/rubber-"
1809 version ".tar.gz")
1810 (string-append "http://ebeffara.free.fr/pub/rubber-"
1811 version ".tar.gz")))
1812 (sha256
1813 (base32
1814 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
1815 (build-system gnu-build-system)
1816 (arguments '(#:tests? #f)) ; no `check' target
1817 (inputs `(("texinfo" ,texinfo)
9bee5d6c 1818 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
231eae53
LC
1819 ("which" ,which)))
1820 (home-page "https://launchpad.net/rubber")
35b9e423 1821 (synopsis "Wrapper for LaTeX and friends")
231eae53
LC
1822 (description
1823 "Rubber is a program whose purpose is to handle all tasks related to the
1824compilation of LaTeX documents. This includes compiling the document itself,
1825of course, enough times so that all references are defined, and running BibTeX
1826to manage bibliographic references. Automatic execution of dvips to produce
1827PostScript documents is also included, as well as usage of pdfLaTeX to produce
1828PDF documents.")
1829 (license license:gpl2+)))
4791876c
RJ
1830
1831(define-public texmaker
1832 (package
1833 (name "texmaker")
1834 (version "4.5")
1835 (source (origin
1836 (method url-fetch)
1837 (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
1838 version ".tar.bz2"))
1839 (sha256
1840 (base32
1841 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
1842 (build-system gnu-build-system)
1843 (arguments
1844 `(#:phases
1845 (modify-phases %standard-phases
1846 ;; Qt has its own configuration utility.
1847 (replace 'configure
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"))))))))
1856 (inputs
1857 `(("poppler-qt5" ,poppler-qt5)
bd917486
TD
1858 ("qtbase" ,qtbase)
1859 ("qtscript" ,qtscript)
1860 ("qtwebkit" ,qtwebkit)
4791876c
RJ
1861 ("zlib" ,zlib)))
1862 (native-inputs
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
1867develop documents with LaTeX, in a single application.")
1868 (license license:gpl2+)))
83457fe0
JD
1869
1870
1871(define-public teximpatient
1872 (package
1873 (name "teximpatient")
1874 (version "2.4")
1875 (source (origin
1876 (method url-fetch)
1877 (uri (string-append "mirror://gnu/" name "/" name "-"
1878 version ".tar.gz"))
1879 (sha256
1880 (base32
1881 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
1882 (build-system gnu-build-system)
1883 (arguments
1884 `(#:phases
1885 (modify-phases %standard-phases
1886 (delete 'check)
1887 ;; Unfortunately some mistakes have been made in packaging.
1888 ;; Work around them here ...
1889 (replace 'unpack
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"))
1895 (install-file (car
1896 (find-files
1897 (assoc-ref inputs "automake")
1898 "^install-sh$"))
1899 srcdir)
1900 (chdir srcdir)))))))
1901 (native-inputs
1902 `(("texlive" ,texlive)
1903 ("automake" ,automake)))
6fd52309 1904 (home-page "https://www.gnu.org/software/teximpatient/")
83457fe0
JD
1905 (synopsis "Book on TeX, plain TeX and Eplain")
1906 (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
1907plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
1908and Karl Berry.")
1909 (license license:fdl1.3+)))