gnu: Add texlive-latex-seminar.
[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)
6b5eb840
AE
61 #:autoload (gnu packages texinfo) (texinfo)
62 #:use-module (ice-9 ftw)
cb7bc20a 63 #:use-module (ice-9 match)
e93f472d 64 #:use-module ((srfi srfi-1) #:hide (zip)))
eb0119ef
AE
65
66(define texlive-extra-src
67 (origin
68 (method url-fetch)
7a15a68f 69 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523-extra.tar.xz")
eb0119ef 70 (sha256 (base32
7a15a68f 71 "0q4a92zmwhn4ry6xgrp4k8wq11ax2sg9rg9yrsrdkr719y0x887a"))))
eb0119ef
AE
72
73(define texlive-texmf-src
74 (origin
75 (method url-fetch)
29a56d8e 76 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-texmf.tar.xz")
e20784e6
LF
77 (patches (search-patches "texlive-texmf-CVE-2016-10243.patch"))
78 (patch-flags '("-p2"))
eb0119ef 79 (sha256 (base32
29a56d8e 80 "1dv8vgfzpczqw82hv9g7a8djhhyzywljmrarlcyy6g2qi5q51glr"))))
eb0119ef 81
3abe72bd 82(define-public texlive-bin
eb0119ef 83 (package
0aa34e82 84 (name "texlive-bin")
7a15a68f 85 (version "2016")
0aa34e82
AE
86 (source
87 (origin
88 (method url-fetch)
29a56d8e 89 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-source.tar.xz")
0aa34e82 90 (sha256 (base32
29a56d8e 91 "1v91vahxlxkdra0qz3f132vvx5d9cx2jy84yl1hkch0agyj2rcx8"))))
eb0119ef 92 (build-system gnu-build-system)
0aa34e82
AE
93 (inputs
94 `(("texlive-extra-src" ,texlive-extra-src)
95 ("cairo" ,cairo)
96 ("fontconfig" ,fontconfig)
97 ("fontforge" ,fontforge)
98 ("freetype" ,freetype)
99 ("gd" ,gd)
0256c746 100 ("gmp" ,gmp)
0aa34e82
AE
101 ("ghostscript" ,ghostscript)
102 ("graphite2" ,graphite2)
103 ("harfbuzz" ,harfbuzz)
104 ("icu4c" ,icu4c)
105 ("libpaper" ,libpaper)
106 ("libpng" ,libpng)
107 ("libxaw" ,libxaw)
108 ("libxt" ,libxt)
0256c746 109 ("mpfr" ,mpfr)
0aa34e82
AE
110 ("perl" ,perl)
111 ("pixman" ,pixman)
112 ("poppler" ,poppler)
113 ("potrace" ,potrace)
114 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
115 ("ruby" ,ruby)
116 ("tcsh" ,tcsh)
117 ("teckit" ,teckit)
118 ("zlib" ,zlib)
119 ("zziplib" ,zziplib)))
c4c4cc05 120 (native-inputs
e9a6d225 121 `(("pkg-config" ,pkg-config)))
eb0119ef
AE
122 (arguments
123 `(#:out-of-source? #t
124 #:configure-flags
125 `("--disable-native-texlive-build"
fd89b36b 126 "--with-system-cairo"
eb0119ef 127 "--with-system-freetype2"
fd89b36b 128 "--with-system-gd"
0256c746 129 "--with-system-gmp"
be2c88ca 130 "--with-system-graphite2"
c70cf7eb 131 "--with-system-harfbuzz"
eb0119ef
AE
132 "--with-system-icu"
133 "--with-system-libgs"
609578a7 134 "--with-system-libpaper"
eb0119ef 135 "--with-system-libpng"
0256c746 136 "--with-system-mpfr"
fd89b36b 137 "--with-system-pixman"
eb0119ef 138 "--with-system-poppler"
75916982 139 "--with-system-potrace"
eb0119ef
AE
140 "--with-system-teckit"
141 "--with-system-xpdf"
142 "--with-system-zlib"
143 "--with-system-zziplib")
2f4640e3
MW
144
145 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
146 ;; XXX FIXME fix luajit properly on mips64.
d2e84281 147 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
2f4640e3 148 (%current-system))))
eb0119ef 149 #:phases
4a6635f3
AE
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
160 ;; man pages.
161 (with-directory-excursion (string-append out "/bin/")
162 (for-each symlink
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))))))))
0aa34e82
AE
173 (synopsis "TeX Live, a package of the TeX typesetting system")
174 (description
175 "TeX Live provides a comprehensive TeX document production system.
176It includes all the major TeX-related programs, macro packages, and fonts
177that are free software, including support for many languages around the
178world.
179
180This package contains the binaries.")
132e14b4
EF
181 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
182 (home-page "https://www.tug.org/texlive/")))
0aa34e82 183
9d913b25
RW
184(define-public texlive-dvips
185 (package
186 (name "texlive-dvips")
187 (version (number->string %texlive-revision))
188 (source (origin
189 (method svn-fetch)
190 (uri (svn-reference
191 (url (string-append "svn://www.tug.org/texlive/tags/"
192 %texlive-tag "/Master/texmf-dist/"
193 "/dvips"))
194 (revision %texlive-revision)))
195 (sha256
196 (base32
15dc52e5 197 "0fcy2hpapbj01ncpjj3v39yhr0jjxb6rm13qaxjjw66s3vydxls1"))))
9d913b25
RW
198 (build-system trivial-build-system)
199 (arguments
200 `(#:modules ((guix build utils))
201 #:builder
202 (begin
203 (use-modules (guix build utils))
204 (let ((target (string-append (assoc-ref %outputs "out")
205 "/share/texmf-dist/dvips")))
206 (mkdir-p target)
207 (copy-recursively (assoc-ref %build-inputs "source") target)
208 #t))))
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
212to PostScript.")
213 ;; Various free software licenses apply to individual files.
214 (license (list license:lppl1.3c+
215 license:expat
216 license:lgpl3+))))
217
99952c53
RW
218(define-public texlive-generic-unicode-data
219 (package
220 (name "texlive-generic-unicode-data")
221 (version (number->string %texlive-revision))
222 (source (origin
223 (method svn-fetch)
224 (uri (svn-reference
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)))
229 (sha256
230 (base32
231 "0ivrhp6jz31pl4z841g4ws41lmvdiwz4sslmhf02inlib79gz6r2"))))
232 (build-system trivial-build-system)
233 (arguments
234 `(#:modules ((guix build utils))
235 #:builder
236 (begin
237 (use-modules (guix build utils))
238 (let ((target (string-append (assoc-ref %outputs "out")
239 "/share/texmf-dist/tex/generic/unicode-data")))
240 (mkdir-p target)
241 (copy-recursively (assoc-ref %build-inputs "source") target)
242 #t))))
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
246data for TeX use. It contains a set of text files provided by the Unicode
247Consortium 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
249Database. Accompanying these source data are generic TeX loader files
250allowing this data to be used as part of TeX runs, in particular in building
251format files. Currently there are two loader files: one for general character
252set up and one for initializing XeTeX character classes as has been carried
253out to date by @code{unicode-letters.tex}. ")
254 (license license:lppl1.3c+)))
255
9e99b1b4
RW
256(define-public texlive-generic-dehyph-exptl
257 (package
258 (name "texlive-generic-dehyph-exptl")
259 (version (number->string %texlive-revision))
260 (source (origin
261 (method svn-fetch)
262 (uri (svn-reference
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)))
267 (sha256
268 (base32
269 "1l9wgv99qq0ysvlxqpj4g8bl0dywbzra4g8m2kmpg2fb0i0hczap"))))
270 (build-system trivial-build-system)
271 (arguments
272 `(#:modules ((guix build utils))
273 #:builder
274 (begin
275 (use-modules (guix build utils))
276 (let ((target (string-append (assoc-ref %outputs "out")
277 "/share/texmf-dist/tex/generic/dehyph-exptl")))
278 (mkdir-p target)
279 (copy-recursively (assoc-ref %build-inputs "source") target)
280 #t))))
281 (home-page "http://projekte.dante.de/Trennmuster/WebHome")
282 (synopsis "Hyphenation patterns for German")
283 (description "The package provides experimental hyphenation patterns for
284the German language, covering both traditional and reformed orthography. The
285patterns can be used with packages Babel and hyphsubst from the Oberdiek
286bundle.")
287 ;; Hyphenation patterns are under the Expat license; documentation is
288 ;; under LPPL.
289 (license (list license:expat license:lppl))))
290
453aae66
RW
291(define-public texlive-generic-tex-ini-files
292 (package
293 (name "texlive-generic-tex-ini-files")
294 (version (number->string %texlive-revision))
295 (source (origin
296 (method svn-fetch)
297 (uri (svn-reference
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)))
302 (sha256
303 (base32
304 "1wh42n1lmzcvi3g6mm31nm3yd5ha5bl260xqc444jg1m9fdp3wz5"))))
305 (build-system trivial-build-system)
306 (arguments
307 `(#:modules ((guix build utils))
308 #:builder
309 (begin
310 (use-modules (guix build utils))
311 (let ((target (string-append (assoc-ref %outputs "out")
312 "/share/texmf-dist/tex/generic/tex-ini-files")))
313 (mkdir-p target)
314 (copy-recursively (assoc-ref %build-inputs "source") target)
315 #t))))
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
319for creating TeX formats. These files are commonly used to introduced
320distribution-dependent variations in formats. They are also used to
321allow existing format source files to be used with newer engines, for example
322to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
323 (license license:public-domain)))
324
9b134da8
RW
325(define-public texlive-generic-hyph-utf8
326 (package
327 (name "texlive-generic-hyph-utf8")
328 (version (number->string %texlive-revision))
329 (source (origin
330 (method svn-fetch)
331 (uri (svn-reference
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)))
336 (sha256
337 (base32
338 "0ghizcz7ps16dzfqf66wwg5i181assc6qsm0g7g5dbmp909931vi"))))
339 (build-system trivial-build-system)
340 (arguments
341 `(#:modules ((guix build utils))
342 #:builder
343 (begin
344 (use-modules (guix build utils))
345 (let ((target (string-append (assoc-ref %outputs "out")
346 "/share/texmf-dist/tex/generic/hyph-utf8")))
347 (mkdir-p target)
348 (copy-recursively (assoc-ref %build-inputs "source") target)
349 #t))))
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
353hyphenation patterns in UTF-8 format, whereas older systems require
354hyphenation patterns in the 8-bit encoding of the font in use (such encodings
355are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
356etc). The present package offers a collection of conversions of existing
357patterns to UTF-8 format, together with converters for use with 8-bit fonts in
358older systems. Since hyphenation patterns for Knuthian-style TeX systems are
359only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
360converters, 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+
364 license:lppl1.2+
365 license:lppl1.3
366 license:lppl1.3+
367 license:lppl1.3a+
368 license:lgpl2.1
369 license:lgpl2.1+
370 license:lgpl3+
371 license:gpl2+
372 license:gpl3+
373 license:mpl1.1
374 license:asl2.0
375 license:expat
376 license:bsd-3
377 license:cc0
378 license:public-domain
379 license:wtfpl2))))
380
8ada0f0b
RW
381(define-public texlive-metafont-base
382 (package
383 (name "texlive-metafont-base")
384 (version (number->string %texlive-revision))
385 (source (origin
386 (method svn-fetch)
387 (uri (svn-reference
388 (url (string-append "svn://www.tug.org/texlive/tags/"
389 %texlive-tag "/Master/texmf-dist/"
390 "/metafont"))
391 (revision %texlive-revision)))
392 (sha256
393 (base32
394 "1yl4n8cn5xqk2nc22zgzq6ymd7bhm6xx1mz3azip7i3ki4bhb5q5"))))
395 (build-system gnu-build-system)
396 (arguments
397 `(#:tests? #f ; no test target
398 #:phases
399 (modify-phases %standard-phases
400 (delete 'configure)
401 (replace 'build
402 (lambda* (#:key inputs #:allow-other-keys)
403 (let ((cwd (getcwd)))
404 (setenv "MFINPUTS"
405 (string-append cwd "/base:"
406 cwd "/misc:"
407 cwd "/roex:"
408 cwd "/feynmf:"
409 cwd "/mfpic:"
410 cwd "/config")))
411 (mkdir "build")
412 (with-directory-excursion "build"
413 (zero? (system* "inimf" "mf.mf")))))
414 (replace 'install
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")))
419 (mkdir-p base)
420 (mkdir-p mf)
421 (install-file "build/mf.base" base)
422 (copy-recursively "base" mf)
423 #t))))))
424 (native-inputs
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
429build fonts using the Metafont system.")
430 (license license:knuth)))
431
3c4f1ec7
RW
432(define-public texlive-fonts-cm
433 (package
434 (name "texlive-fonts-cm")
435 (version (number->string %texlive-revision))
436 (source (origin
437 (method svn-fetch)
438 (uri (svn-reference
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)))
443 (sha256
444 (base32
445 "045k5b9rdmbxpy1a3006l1x96z1rd18vg3cwrvnld9bqybw5qz44"))))
446 (build-system gnu-build-system)
447 (arguments
448 `(#:modules ((guix build gnu-build-system)
449 (guix build utils)
450 (srfi srfi-1)
451 (srfi srfi-26))
452 #:tests? #f ; no tests
453 #:phases
454 (modify-phases %standard-phases
455 (delete 'configure)
456 (replace 'build
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
462 (setenv "MFINPUTS"
463 (string-append (getcwd) ":"
464 mf "/share/texmf-dist/metafont/base")))
465 (mkdir "build")
466 (every (lambda (font)
467 (format #t "building font ~a\n" font)
468 (zero? (system* "mf" "-progname=mf"
469 "-output-directory=build"
470 (string-append "\\"
471 "mode:=ljfour; "
472 "mag:=1; "
473 "batchmode; "
474 "input "
475 (basename font ".mf")))))
476 (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))))
477 (replace 'install
478 (lambda* (#:key outputs #:allow-other-keys)
479 (let* ((out (assoc-ref outputs "out"))
480 (tfm (string-append
481 out "/share/texmf-dist/fonts/tfm/public/cm"))
482 (mf (string-append
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"))
488 #t))))))
489 (native-inputs
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
495Knuth. The Computer Modern font family is a large collection of text,
496display, and mathematical fonts in a range of styles, based on Monotype Modern
4978A.")
498 (license license:knuth)))
499
5ebba61a
RW
500(define-public texlive-fonts-knuth-lib
501 (package
502 (name "texlive-fonts-knuth-lib")
503 (version (number->string %texlive-revision))
504 (source (origin
505 (method svn-fetch)
506 (uri (svn-reference
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)))
511 (sha256
512 (base32
513 "0in9aqyi8jkyf9d16z0li50z5fpwj1iwgwm83gmvwqcf7chfs04y"))))
514 (build-system gnu-build-system)
515 (arguments
516 `(#:modules ((guix build gnu-build-system)
517 (guix build utils)
518 (srfi srfi-26))
519 #:tests? #f ; no tests
520 #:phases
521 (modify-phases %standard-phases
522 (delete 'configure)
523 (replace 'build
524 (lambda* (#:key inputs #:allow-other-keys)
525 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
526 ;; Tell mf where to find mf.base
527 (setenv "MFBASES"
528 (string-append mf "/share/texmf-dist/web2c"))
529 ;; Tell mf where to look for source files
530 (setenv "MFINPUTS"
531 (string-append (getcwd) ":"
532 mf "/share/texmf-dist/metafont/base")))
533 (mkdir "build")
534 (zero? (system* "mf" "-progname=mf"
535 "-output-directory=build"
536 (string-append "\\"
537 "mode:=ljfour; "
538 "mag:=1; "
539 "batchmode; "
540 "input manfnt")))))
541 (replace 'install
542 (lambda* (#:key outputs #:allow-other-keys)
543 (let* ((out (assoc-ref outputs "out"))
544 (tfm (string-append
545 out "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
546 (mf (string-append
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"))
552 #t))))))
553 (native-inputs
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
559from Donald Knuth, including the plain format, plain base, and the MF logo
560fonts.")
561 (license license:knuth)))
562
a00d5933
RW
563(define-public texlive-fonts-latex
564 (package
565 (name "texlive-fonts-latex")
566 (version (number->string %texlive-revision))
567 (source (origin
568 (method svn-fetch)
569 (uri (svn-reference
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)))
574 (sha256
575 (base32
576 "0ypsm4xv9cw0jckk2qc7gi9hcmhf31mrg56pz3llyx3yd9vq2lps"))))
577 (build-system gnu-build-system)
578 (arguments
579 `(#:modules ((guix build gnu-build-system)
580 (guix build utils)
581 (srfi srfi-1)
582 (srfi srfi-26))
583 #:tests? #f ; no tests
584 #:phases
585 (modify-phases %standard-phases
586 (delete 'configure)
587 (replace 'build
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
593 (setenv "MFINPUTS"
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")))
598 (mkdir "build")
599 (every (lambda (font)
600 (format #t "building font ~a\n" font)
601 (zero? (system* "mf" "-progname=mf"
602 "-output-directory=build"
603 (string-append "\\"
604 "mode:=ljfour; "
605 "mag:=1; "
606 "batchmode; "
607 "input " font))))
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"))))
613 (replace 'install
614 (lambda* (#:key outputs #:allow-other-keys)
615 (let* ((out (assoc-ref outputs "out"))
616 (tfm (string-append
617 out "/share/texmf-dist/fonts/tfm/public/latex-fonts"))
618 (mf (string-append
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"))
624 #t))))))
625 (native-inputs
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
632packages and classes. It includes invisible fonts (for use with the slides
633class), line and circle fonts (for use in the picture environment) and LaTeX
634symbol fonts.")
635 (license license:lppl1.2+)))
636
566e95f7
RW
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
640 (package
641 (name "texlive-tex-plain")
642 (version (number->string %texlive-revision))
643 (source (origin
644 (method svn-fetch)
645 (uri (svn-reference
646 (url (string-append "svn://www.tug.org/texlive/tags/"
647 %texlive-tag "/Master/texmf-dist/"
648 "/tex/plain"))
649 (revision %texlive-revision)))
650 (sha256
651 (base32
96c336be 652 "0mjgl3gscn3ps29yjambz1j9fg81ynnncb96vpprwx4xsijhsns0"))))
566e95f7
RW
653 (build-system trivial-build-system)
654 (arguments
655 `(#:modules ((guix build utils))
656 #:builder
657 (begin
658 (use-modules (guix build utils))
659 (let ((target (string-append (assoc-ref %outputs "out")
660 "/share/texmf-dist/tex/plain")))
661 (mkdir-p target)
662 (copy-recursively (assoc-ref %build-inputs "source") target)
663 #t))))
664 (home-page "https://www.ctan.org/pkg/plain")
665 (synopsis "Plain TeX format and supporting files")
666 (description
667 "Contains files used to build the Plain TeX format, as described in the
668TeXbook, together with various supporting files (some also discussed in the
669book).")
670 (license license:knuth)))
671
010f476f
RW
672(define-public texlive-latex-base
673 (let ((texlive-dir
674 (lambda (dir hash)
675 (origin
676 (method svn-fetch)
677 (uri (svn-reference
678 (url (string-append "svn://www.tug.org/texlive/tags/"
679 %texlive-tag "/Master/texmf-dist/"
680 dir))
681 (revision %texlive-revision)))
682 (sha256 (base32 hash))))))
683 (package
684 (name "texlive-latex-base")
685 (version (number->string %texlive-revision))
686 (source (origin
687 (method svn-fetch)
688 (uri (texlive-ref "latex" "base"))
689 (sha256
690 (base32
691 "1h9pir2hz6i9avc4lrl733p3zf4rpkg8537x1zdbhs91hvhikw9k"))))
692 (build-system gnu-build-system)
693 (arguments
694 `(#:modules ((guix build gnu-build-system)
695 (guix build utils)
696 (ice-9 match)
697 (srfi srfi-1)
698 (srfi srfi-26))
699 #:tests? #f ; no tests
700 #:phases
701 (modify-phases %standard-phases
702 (delete 'configure)
703 (replace 'build
704 (lambda* (#:key inputs #:allow-other-keys)
705 ;; Find required fonts
706 (setenv "TFMFONTS"
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"))
713 (setenv "TEXINPUTS"
714 (string-append
715 (getcwd) ":"
716 (getcwd) "/build:"
717 (string-join
718 (append-map (match-lambda
719 ((_ . dir)
720 (find-files dir
721 (lambda (_ stat)
722 (eq? 'directory (stat:type stat)))
723 #:directories? #t
724 #:stat stat)))
725 inputs)
726 ":")))
727
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 "%")))
732
733 (mkdir "build")
734 (mkdir "web2c")
735 (and (zero? (system* "luatex" "-ini" "-interaction=batchmode"
736 "-output-directory=build"
737 "unpack.ins"))
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
742 ;; engine.
743
744 ;; FIXME: XeTeX fails to build because neither
745 ;; \XeTeXuseglyphmetrics nor \XeTeXdashbreakstate are
746 ;; defined.
747 (every
748 (lambda (format)
749 (zero? (system* "latex" "-ini" "-interaction=batchmode"
750 "-output-directory=web2c"
751 "-translate-file=cp227.tcx"
752 (string-append "*" format ".ini"))))
753 '("latex" ;"xetex"
754 ))
755 (every
756 (lambda (format)
757 (zero? (system* "luatex" "-ini" "-interaction=batchmode"
758 "-output-directory=web2c"
759 (string-append format ".ini"))))
760 '("dviluatex" "dvilualatex" "luatex" "lualatex" "xelatex")))))
761 (replace 'install
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")))
768 (mkdir-p target)
769 (mkdir-p 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" ".*"))
775 #t))))))
776 (native-inputs
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")
803 (description
804 "This bundle comprises the source of LaTeX itself, together with several
805packages which are considered \"part of the kernel\". This bundle, together
806with the required packages, constitutes what every LaTeX distribution should
807contain.")
808 (license license:lppl1.3c+))))
809
3e485ed2
RW
810(define-public texlive-latex-filecontents
811 (package
812 (name "texlive-latex-filecontents")
813 (version (number->string %texlive-revision))
814 (source (origin
815 (method svn-fetch)
816 (uri (texlive-ref "latex" "filecontents"))
817 (sha256
818 (base32
819 "0swkbxv8vg0yizadfnvrwjb4cj0pn34v9wm6v7wqq903fdav7k7q"))))
820 (build-system texlive-build-system)
821 (arguments '(#:tex-directory "latex/filecontents"))
822 (home-page "http://www.ctan.org/pkg/filecontents")
823 (synopsis "Extended filecontents and filecontents* environments")
824 (description
825 "LaTeX2e's @code{filecontents} and @code{filecontents*} environments
826enable a LaTeX source file to generate external files as it runs through
827LaTeX. However, there are two limitations of these environments: they refuse
828to overwrite existing files, and they can only be used in the preamble of a
829document. The filecontents package removes these limitations, letting you
830overwrite existing files and letting you use @code{filecontents} /
831@code{filecontents*} anywhere.")
832 (license license:lppl1.3c+)))
833
1193aa89
RW
834(define-public texlive-generic-ifxetex
835 (package
836 (name "texlive-generic-ifxetex")
fea8eef3 837 (version (number->string %texlive-revision))
1193aa89
RW
838 (source (origin
839 (method svn-fetch)
840 (uri (texlive-ref "generic" "ifxetex"))
841 (sha256
842 (base32
843 "0w2xj7n0szavj329kds09q626szkc378p3w0sk022q0ln4ksz86d"))))
844 (build-system texlive-build-system)
845 (arguments
846 '(#:tex-directory "generic/ifxetex"
847 #:tex-format "xelatex"))
848 (inputs
849 `(("texlive-latex-filecontents" ,texlive-latex-filecontents)))
850 (home-page "http://www.ctan.org/pkg/ifxetex")
851 (synopsis "Am I running under XeTeX?")
852 (description
853 "This is a simple package which provides an @code{\\ifxetex} conditional,
854so that other code can determine that it is running under XeTeX. The package
855requires the etexe-TeX extensions to the TeX primitive set.")
856 (license license:lppl1.3c+)))
857
437822a1
RW
858(define-public texlive-latex-fancyvrb
859 (package
860 (name "texlive-latex-fancyvrb")
861 (version (number->string %texlive-revision))
862 (source (origin
863 (method svn-fetch)
864 (uri (texlive-ref "latex" "fancyvrb"))
865 (sha256
866 (base32
867 "03l7140y031rr14h02i4z9zqsfvrbn7wzwxbjsrjcgrk6sdr71wv"))))
868 (build-system texlive-build-system)
869 (arguments
870 '(#:tex-directory "latex/fancyvrb"
871 ;; We exclude "fvrb-ex" to avoid a dependency on texlive-luaotfload and
872 ;; thus texlive-luatex-lualibs.
873 #:build-targets '("fancyvrb.ins")))
874 (home-page "http://www.ctan.org/pkg/fancyvrb")
875 (synopsis "Sophisticated verbatim text")
876 (description
877 "This package provides tools for the flexible handling of verbatim text
878including: verbatim commands in footnotes; a variety of verbatim environments
879with many parameters; ability to define new customized verbatim environments;
880save and restore verbatim text and environments; write and read files in
881verbatim mode; build \"example\" environments (showing both result and
882verbatim source).")
883 (license license:lppl1.0+)))
884
4eebd2cd
RW
885(define-public texlive-latex-graphics
886 (package
887 (name "texlive-latex-graphics")
888 (version (number->string %texlive-revision))
889 (source (origin
890 (method svn-fetch)
891 (uri (texlive-ref "latex" "graphics"))
892 (sha256
893 (base32
e3c970fc 894 "07azyn0b1s49vbdlr6dmygrminxp72ndl24j1091hiiccvrjq3xc"))))
4eebd2cd
RW
895 (build-system texlive-build-system)
896 (arguments
897 '(#:tex-directory "latex/graphics"
898 #:phases
899 (modify-phases %standard-phases
900 (add-after 'install 'install-config
901 (lambda* (#:key inputs outputs #:allow-other-keys)
902 (let ((cfg (assoc-ref inputs "graphics-cfg"))
903 (target (string-append (assoc-ref outputs "out")
904 "/share/texmf-dist/tex/latex/graphics-cfg")))
905 (mkdir-p target)
906 (install-file (string-append cfg "/graphics.cfg") target)
907 (install-file (string-append cfg "/color.cfg") target)
908 #t)))
909 (add-after 'install 'install-defs
910 (lambda* (#:key inputs outputs #:allow-other-keys)
911 (let ((def (assoc-ref inputs "graphics-def"))
912 (target (string-append (assoc-ref outputs "out")
913 "/share/texmf-dist/tex/latex/graphics-def")))
914 (mkdir-p target)
915 (copy-recursively def target)
916 #t))))))
917 (native-inputs
918 `(("graphics-cfg"
919 ,(origin
920 (method git-fetch)
921 (uri (git-reference
922 (url "https://github.com/latex3/graphics-cfg.git")
923 (commit "19d1238af17df376cd46333b229579b0f7f3a41f")))
924 (sha256
925 (base32
926 "12kbgbm52gmmgn8zajb74s8n5rvnxcfdvs3iyj8vcw5vrsw5i6mh"))))
927 ("graphics-def"
928 ,(origin
929 (method svn-fetch)
930 (uri (svn-reference
931 (url (string-append "svn://www.tug.org/texlive/tags/"
932 %texlive-tag "/Master/texmf-dist/"
933 "/tex/latex/graphics-def"))
934 (revision %texlive-revision)))
935 (sha256
936 (base32
937 "1q5l0x3jsy74v0zq4c9g0x0rb9jfzf7cbhdzkbchyydv49iav802"))))))
938 (home-page "http://www.ctan.org/pkg/latex-graphics")
939 (synopsis "LaTeX standard graphics bundle")
940 (description
941 "This is a collection of LaTeX packages for producing color, including
942graphics (e.g. PostScript) files, and rotation and scaling of text in LaTeX
943documents. It comprises the packages color, graphics, graphicx, trig, epsfig,
944keyval, and lscape.")
945 ;; The configuration files are released under CC0.
946 (license (list license:lppl1.3c+
947 license:cc0))))
948
f5a6af42
RW
949(define-public texlive-latex-xcolor
950 (package
951 (name "texlive-latex-xcolor")
952 (version (number->string %texlive-revision))
953 (source (origin
954 (method svn-fetch)
955 (uri (texlive-ref "latex" "xcolor"))
956 (sha256
957 (base32
958 "01n613s7bcrd2n4jfawm0k4nn2ny3aaifp2jjfif3lz4sbv31494"))))
959 (build-system texlive-build-system)
960 (arguments '(#:tex-directory "latex/xcolor"))
961 (home-page "http://www.ctan.org/pkg/xcolor")
962 (synopsis "Driver-independent color extensions for LaTeX and pdfLaTeX")
963 (description
964 "The package starts from the basic facilities of the colorcolor package,
965and provides easy driver-independent access to several kinds of color tints,
966shades, tones, and mixes of arbitrary colors. It allows a user to select a
967document-wide target color model and offers complete tools for conversion
968between eight color models. Additionally, there is a command for alternating
969row colors plus repeated non-aligned material (like horizontal lines) in
970tables.")
971 (license license:lppl1.2+)))
972
4d660fdf
RW
973(define-public texlive-latex-hyperref
974 (package
975 (name "texlive-latex-hyperref")
976 (version "6.84a2")
977 ;; The sources in the TeX Live SVN repository do not contain hluatex.dtx,
978 ;; so we fetch the release from GitHub.
979 (source (origin
980 (method url-fetch)
981 (uri (string-append "https://github.com/ho-tex/hyperref/"
982 "archive/release-" version ".tar.gz"))
983 (file-name (string-append name "-" version ".tar.gz"))
984 (sha256
985 (base32
986 "1d3rmjgzh0025a1dza55zb6nzzlgd1y9snwx45wq1c1vf42m79h2"))))
987 (build-system texlive-build-system)
988 (arguments '(#:tex-directory "latex/hyperref"))
989 (home-page "http://www.ctan.org/pkg/hyperref")
990 (synopsis "Extensive support for hypertext in LaTeX")
991 (description
992 "The hyperref package is used to handle cross-referencing commands in
993LaTeX to produce hypertext links in the document. The package provides
994backends for the special set defined for HyperTeX DVI processors; for embedded
995pdfmark commands for processing by Acrobat Distiller (dvips and dvipsone); for
996dviwindo; for PDF control within pdfTeX and dvipdfm; for TeX4ht; and for VTeX
997pdf and HTML backends. The package is distributed with the backref and
998nameref packages, which make use of the facilities of hyperref.")
999 (license license:lppl1.3+)))
1000
c3455b7d
RW
1001(define-public texlive-latex-oberdiek
1002 (package
1003 (name "texlive-latex-oberdiek")
1004 (version (number->string %texlive-revision))
1005 (source (origin
1006 (method svn-fetch)
1007 (uri (texlive-ref "latex" "oberdiek"))
1008 (sha256
1009 (base32
1010 "0aswvsxgsn709xmvpcg50d2xl7vcy1ckdxb9c1cligqqfjjvviqf"))))
1011 (build-system texlive-build-system)
1012 (arguments
1013 '(#:tex-directory "latex/oberdiek"
1014 #:phases
1015 (modify-phases %standard-phases
1016 ;; "ifpdf.ins" is not generated, so we cannot process it.
1017 (add-after 'unpack 'do-not-process-ifpdf.ins
1018 (lambda _
1019 (substitute* "oberdiek.ins"
1020 (("\\\\batchinput\\{ifpdf.ins\\}") ""))
1021 #t)))))
1022 (home-page "http://www.ctan.org/pkg/oberdiek")
1023 (synopsis "Bundle of packages submitted by Heiko Oberdiek")
1024 (description
1025 "The bundle comprises various LaTeX packages, providing among others:
1026better accessibility support for PDF files; extensible chemists reaction
1027arrows; record information about document class(es) used; and many more.")
1028 (license license:lppl1.3+)))
1029
f2536af2
RW
1030(define-public texlive-latex-tools
1031 (package
1032 (name "texlive-latex-tools")
1033 (version (number->string %texlive-revision))
1034 (source (origin
1035 (method svn-fetch)
1036 (uri (texlive-ref "latex" "tools"))
1037 (sha256
1038 (base32
1039 "052a0pch2k5zls5jlay9xxcf93rw3i60a2x28y3ip3rhbsv3xgiz"))))
1040 (build-system texlive-build-system)
1041 (arguments
1042 '(#:tex-directory "latex/tools"
1043 #:build-targets '("tools.ins")))
1044 (home-page "http://www.ctan.org/pkg/latex-tools")
1045 (synopsis "LaTeX standard tools bundle")
1046 (description
1047 "This package is a collection of (variously) simple tools provided as
1048part of the LaTeX required tools distribution, comprising the following
1049packages: afterpage, array, bm, calc, dcolumn, delarray, enumerate, fileerr,
1050fontsmpl, ftnright, hhline, indentfirst, layout, longtable, multicol,
1051rawfonts, showkeys, somedefs, tabularx, theorem, trace, varioref, verbatim,
1052xr, and xspace.")
1053 (license license:lppl1.3+)))
1054
35adcc3a
RW
1055(define-public texlive-latex-url
1056 (package
1057 (name "texlive-latex-url")
1058 (version (number->string %texlive-revision))
1059 (source (origin
1060 (method svn-fetch)
1061 (uri (svn-reference
1062 (url (string-append "svn://www.tug.org/texlive/tags/"
1063 %texlive-tag "/Master/texmf-dist/"
1064 "/tex/latex/url"))
1065 (revision %texlive-revision)))
1066 (sha256
1067 (base32
1068 "184s2543cwia5l7iibhlkl1ffbncfhjpv5p56zq0c15by5sghlac"))))
1069 (build-system trivial-build-system)
1070 (arguments
1071 `(#:modules ((guix build utils))
1072 #:builder
1073 (begin
1074 (use-modules (guix build utils))
1075 (let ((target (string-append (assoc-ref %outputs "out")
1076 "/share/texmf-dist/tex/latex/url")))
1077 (mkdir-p target)
1078 (copy-recursively (assoc-ref %build-inputs "source") target)
1079 #t))))
1080 (home-page "https://www.ctan.org/pkg/url")
1081 (synopsis "Verbatim with URL-sensitive line breaks")
1082 (description "The command @code{\\url} is a form of verbatim command that
1083allows linebreaks at certain characters or combinations of characters, accepts
1084reconfiguration, and can usually be used in the argument to another command.
1085The command is intended for email addresses, hypertext links,
1086directories/paths, etc., which normally have no spaces, so by default the
1087package ignores spaces in its argument. However, a package option allows
1088spaces, which is useful for operating systems where spaces are a common part
1089of file names.")
1090 ;; The license header states that it is under LPPL version 2 or later, but
1091 ;; the latest version is 1.3c.
1092 (license license:lppl1.3c+)))
1093
a5b1ef84
RW
1094(define-public texlive-latex-l3kernel
1095 (package
1096 (name "texlive-latex-l3kernel")
1097 (version (number->string %texlive-revision))
1098 (source (origin
1099 (method svn-fetch)
1100 (uri (texlive-ref "latex" "l3kernel"))
1101 (sha256
1102 (base32
1f7d1010 1103 "0r0wfk594j8wkdqhh21haimwsfq8x5jch4ldm21hkzk5dnmvpbg6"))))
a5b1ef84
RW
1104 (build-system texlive-build-system)
1105 (arguments
1106 '(#:tex-directory "latex/l3kernel"))
1107 (home-page "http://www.ctan.org/pkg/l3kernel")
1108 (synopsis "LaTeX3 programmers’ interface")
1109 (description
1110 "The l3kernel bundle provides an implementation of the LaTeX3
1111programmers’ interface, as a set of packages that run under LaTeX 2e. The
1112interface provides the foundation on which the LaTeX3 kernel and other future
1113code are built: it is an API for TeX programmers. The packages are set up so
1114that the LaTeX3 conventions can be used with regular LaTeX 2e packages.")
1115 (license license:lppl1.3c+)))
1116
cc09d48b
RW
1117(define-public texlive-latex-l3packages
1118 (package
1119 (name "texlive-latex-l3packages")
1120 (version (number->string %texlive-revision))
1121 (source (origin
1122 (method svn-fetch)
1123 (uri (texlive-ref "latex" "l3packages"))
1124 (sha256
1125 (base32
83474718 1126 "16jplkvzdysfssijq9l051nsks65c2nrarsl17k8gjhc28yznj8y"))))
cc09d48b
RW
1127 (build-system texlive-build-system)
1128 (arguments
1129 '(#:tex-directory "latex/l3packages"
1130 #:phases
1131 (modify-phases %standard-phases
1132 ;; All package sources are in sub-directories, so we need to add them
1133 ;; to TEXINPUTS.
1134 (add-after 'unpack 'set-TEXINPUTS
1135 (lambda _
1136 (let ((cwd (getcwd)))
1137 (setenv "TEXINPUTS"
1138 (string-append cwd "/l3keys2e:"
1139 cwd "/xparse:"
1140 cwd "/xfrac:"
1141 cwd "/xfp:"
1142 cwd "/xtemplate")))
1143 #t)))))
1144 (inputs
1145 `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1146 (home-page "http://www.ctan.org/pkg/l3packages")
1147 (synopsis "High-level LaTeX3 concepts")
1148 (description
1149 "This bundle holds prototype implementations of concepts for a LaTeX
1150designer interface, to be used with the experimental LaTeX kernel as
1151programming tools and kernel sup­port. Packages provided in this release are:
1152
1153@enumerate
1154@item l3keys2e, which makes the facilities of the kernel module l3keys
1155 available for use by LaTeX 2e packages;
1156@item xfrac, which provides flexible splitlevel fractions;
1157@item xparse, which provides a high-level interface for declaring document
1158 commands; and
1159@item xtemplate, which provides a means of defining generic functions using a
1160 key-value syntax.
1161@end enumerate\n")
1162 (license license:lppl1.3c+)))
1163
58308491
RW
1164(define-public texlive-latex-fontspec
1165 (package
1166 (name "texlive-latex-fontspec")
1167 (version (number->string %texlive-revision))
1168 (source (origin
1169 (method svn-fetch)
1170 (uri (texlive-ref "latex" "fontspec"))
1171 (sha256
1172 (base32
1173 "1rx43y5xmjqvc27pjdnmqwp4pcw3czcfd6nfpmzc1gnqfl1hlc0q"))))
1174 (build-system texlive-build-system)
1175 (arguments
1176 '(#:tex-directory "latex/fontspec"
1177 #:build-targets '("fontspec.dtx")))
1178 (inputs
1179 `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1180 (home-page "http://www.ctan.org/pkg/fontspec")
1181 (synopsis "Advanced font selection in XeLaTeX and LuaLaTeX")
1182 (description
1183 "Fontspec is a package for XeLaTeX and LuaLaTeX. It provides an
1184automatic and unified interface to feature-rich AAT and OpenType fonts through
1185the NFSS in LaTeX running on XeTeX or LuaTeX engines. The package requires
1186the l3kernel and xparse bundles from the LaTeX 3 development team.")
1187 (license license:lppl1.3+)))
1188
e93f472d
RW
1189;; The SVN directory contains little more than a dtx file that generates three
1190;; of the many lua files that should be installed as part of this package.
1191;; This is why we take the release from GitHub instead.
1192(define-public texlive-luatex-lualibs
1193 (package
1194 (name "texlive-luatex-lualibs")
1195 (version "2.5")
1196 (source (origin
1197 (method url-fetch)
1198 (uri (string-append "https://github.com/lualatex/lualibs/"
1199 "releases/download/v"
1200 version "/lualibs.zip"))
1201 (sha256
1202 (base32
1203 "1xx9blvrmx9hyhrl345lpai9m6xxnw997261a1ahn1bm5r2j5fqy"))))
1204 (build-system gnu-build-system)
1205 (arguments
1206 `(#:make-flags
1207 (list (string-append "DESTDIR="
1208 (assoc-ref %outputs "out")
1209 "/share/texmf-dist"))
1210 #:phases
1211 (modify-phases %standard-phases
1212 (delete 'configure))))
1213 (native-inputs
1214 `(("texlive-bin" ,texlive-bin)
1215 ("unzip" ,unzip)
1216 ("zip" ,zip)))
1217 (home-page "https://github.com/lualatex/lualibs")
1218 (synopsis "Lua modules for general programming (in the (La)TeX world)")
1219 (description
1220 "Lualibs is a collection of Lua modules useful for general programming.
1221The bundle is based on Lua modules shipped with ConTeXt, and made available in
1222this bundle for use independent of ConTeXt.")
1223 ;; GPL version 2 only
1224 (license license:gpl2)))
1225
2573163a
RW
1226(define-public texlive-latex-amsmath
1227 (package
1228 (name "texlive-latex-amsmath")
1229 (version (number->string %texlive-revision))
1230 (source (origin
1231 (method svn-fetch)
1232 (uri (texlive-ref "latex" "amsmath"))
1233 (sha256
1234 (base32
1235 "178ywjpdlv78qmfzqdyn6gy14620zjsn2q9wap76fbr9s4hw6dba"))))
1236 (build-system texlive-build-system)
1237 (arguments '(#:tex-directory "latex/amsmath"))
1238 (home-page "http://www.ctan.org/pkg/amsmath")
1239 (synopsis "AMS mathematical facilities for LaTeX")
1240 (description
1241 "This is the principal package in the AMS-LaTeX distribution. It adapts
1242for use in LaTeX most of the mathematical features found in AMS-TeX; it is
1243highly recommended as an adjunct to serious mathematical typesetting in LaTeX.
1244When amsmath is loaded, AMS-LaTeX packages @code{amsbsyamsbsy} (for bold
1245symbols), @code{amsopnamsopn} (for operator names) and
1246@code{amstextamstext} (for text embedded in mathematics) are also loaded.
1247This package is part of the LaTeX required distribution; however, several
1248contributed packages add still further to its appeal; examples are
1249@code{empheqempheq}, which provides functions for decorating and highlighting
1250mathematics, and @code{ntheoremntheorem}, for specifying theorem (and similar)
1251definitions.")
1252 (license license:lppl1.3c+)))
1253
18e366e8
RW
1254(define-public texlive-latex-amscls
1255 (package
1256 (name "texlive-latex-amscls")
1257 (version (number->string %texlive-revision))
1258 (source (origin
1259 (method svn-fetch)
1260 (uri (texlive-ref "latex" "amscls"))
1261 (sha256
1262 (base32
1263 "0jmcr37mcdi7drczppvr6lmz5d5yd9m67ii79gp2nglg1xpw934j"))))
1264 (build-system texlive-build-system)
1265 (arguments
1266 `(#:tex-directory "latex/amscls"))
1267 (home-page "http://www.ctan.org/pkg/amscls")
1268 (synopsis "AMS document classes for LaTeX")
1269 (description
1270 "This bundle contains three AMS classes: @code{amsartamsart} (for writing
1271articles for the AMS), @code{amsbookamsbook} (for books) and
1272@code{amsprocamsproc} (for proceedings), together with some supporting
1273material. The material is made available as part of the AMS-LaTeX
1274distribution.")
1275 (license license:lppl1.3c+)))
1276
f84d5a09
RW
1277(define-public texlive-latex-babel
1278 (package
1279 (name "texlive-latex-babel")
1280 (version (number->string %texlive-revision))
1281 (source (origin
1282 (method svn-fetch)
1283 (uri (texlive-ref "latex" "babel"))
1284 (sha256
1285 (base32
1286 "1n3i5adsyy7jw0imnzrm2i8wkf73i3mjk9h3ic8cb9cd19i4r9r3"))))
1287 (build-system texlive-build-system)
1288 (arguments
1289 '(#:tex-directory "latex/babel"
1290 #:phases
1291 (modify-phases %standard-phases
1292 ;; This package tries to produce babel.aux twice but refuses to
1293 ;; overwrite the first one.
1294 (add-before 'build 'fix-ins
1295 (lambda _
1296 (substitute* "babel.ins"
1297 (("askonceonly") "askforoverwritefalse"))
1298 #t)))))
1299 (home-page "http://www.ctan.org/pkg/babel")
1300 (synopsis "Multilingual support for Plain TeX or LaTeX")
1301 (description
1302 "The package manages culturally-determined typographical (and other)
1303rules, and hyphenation patterns for a wide range of languages. A document may
1304select a single language to be supported, or it may select several, in which
1305case the document may switch from one language to another in a variety of
1306ways. Babel uses contributed configuration files that provide the detail of
1307what has to be done for each language. Users of XeTeX are advised to use the
1308polyglossia package rather than Babel.")
1309 (license license:lppl1.3+)))
1310
93286d38
RW
1311(define-public texlive-latex-cyrillic
1312 (package
1313 (name "texlive-latex-cyrillic")
1314 (version (number->string %texlive-revision))
1315 (source (origin
1316 (method svn-fetch)
1317 (uri (texlive-ref "latex" "cyrillic"))
1318 (sha256
1319 (base32
1320 "1mdhl35hwas68ki56qqngzar37dwv4mm64l2canihr255bz34lbv"))))
1321 (build-system texlive-build-system)
1322 (arguments
1323 '(#:tex-directory "latex/cyrillic"))
1324 (home-page "http://www.ctan.org/pkg/latex-cyrillic")
1325 (synopsis "Support for Cyrillic fonts in LaTeX")
1326 (description
1327 "This bundle of macros files provides macro support (including font
1328encoding macros) for the use of Cyrillic characters in fonts encoded under the
1329T2* and X2 encodings. These encodings cover (between them) pretty much every
1330language that is written in a Cyrillic alphabet.")
1331 (license license:lppl1.3c+)))
1332
83fe6231
RW
1333(define-public texlive-latex-psnfss
1334 (package
1335 (name "texlive-latex-psnfss")
1336 (version (number->string %texlive-revision))
1337 (source (origin
1338 (method svn-fetch)
1339 (uri (texlive-ref "latex" "psnfss"))
1340 (sha256
1341 (base32
1342 "1920dcq8613yzprasbg80fh4fcjcidvvl54wkx438nimyxcri7qz"))))
1343 (build-system texlive-build-system)
1344 (arguments '(#:tex-directory "latex/psnfss"))
1345 (home-page "http://www.ctan.org/pkg/psnfss")
1346 (synopsis "Font support for common PostScript fonts")
1347 (description
1348 "The PSNFSS collection includes a set of files that provide a complete
1349working setup of the LaTeX font selection scheme (NFSS2) for use with common
1350PostScript fonts. It covers the so-called \"Base\" fonts (which are built
1351into any Level 2 PostScript printing device and the Ghostscript interpreter)
1352and a number of free fonts. It provides font definition files, macros and
1353font metrics. The bundle as a whole is part of the LaTeX required set of
1354packages.")
1355 (license license:lppl1.2+)))
1356
cb7bc20a
RW
1357(define-public texlive-union
1358 (lambda* (#:optional (packages '()))
1359 "Return 'texlive-union' package which is a union of PACKAGES and the
1360standard LaTeX packages."
1361 (let ((default-packages
1362 (list texlive-bin
1363 texlive-dvips
1364 texlive-fonts-cm
1365 texlive-fonts-latex
1366 texlive-metafont-base
1367 texlive-latex-base
1368 ;; LaTeX packages from the "required" set.
1369 texlive-latex-amsmath
1370 texlive-latex-amscls
1371 texlive-latex-babel
1372 texlive-latex-cyrillic
1373 texlive-latex-graphics
1374 texlive-latex-psnfss
1375 texlive-latex-tools)))
1376 (package
1377 (name "texlive-union")
1378 (version (number->string %texlive-revision))
1379 (source #f)
1380 (build-system trivial-build-system)
1381 (arguments
1382 '(#:modules ((guix build union)
1383 (guix build utils)
1384 (guix build texlive-build-system)
1385 (guix build gnu-build-system)
1386 (guix build gremlin)
1387 (guix elf))
1388 #:builder
1389 (begin
1390 (use-modules (ice-9 match)
1391 (srfi srfi-26)
1392 (guix build union)
1393 (guix build utils)
1394 (guix build texlive-build-system))
1395 (let* ((out (assoc-ref %outputs "out"))
1396 (texmf.cnf (string-append out "/share/texmf-dist/web2c/texmf.cnf")))
1397 ;; Build a modifiable union of all inputs (but exclude bash)
1398 (match (filter (match-lambda
1399 ((name . _)
1400 (not (string=? "bash" name))))
1401 %build-inputs)
1402 (((names . directories) ...)
1403 (union-build (assoc-ref %outputs "out")
1404 directories
1405 #:create-all-directories? #t)))
1406
1407 ;; The configuration file "texmf.cnf" is provided by the
1408 ;; "texlive-bin" package. We take it and override only the
1409 ;; setting for TEXMFROOT and TEXMF. This file won't be consulted
1410 ;; by default, though, so we still need to set TEXMFCNF.
1411 (substitute* texmf.cnf
1412 (("^TEXMFROOT = .*")
1413 (string-append "TEXMFROOT = " out "/share\n"))
1414 (("^TEXMF = .*")
1415 "TEXMF = $TEXMFROOT/share/texmf-dist\n"))
1416 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash")
1417 "/bin"))
1418 (for-each
1419 (cut wrap-program <>
1420 `("TEXMFCNF" ":" = (,(dirname texmf.cnf)))
1421 `("TEXMF" ":" = (,(string-append out "/share/texmf-dist"))))
1422 (find-files (string-append out "/bin") ".*"))
1423 #t))))
1424 (inputs
1425 `(("bash" ,bash)
1426 ,@(map (lambda (package)
1427 (list (package-name package) package))
1428 (append default-packages packages))))
1429 (home-page (package-home-page texlive-bin))
1430 (synopsis "Union of TeX Live packages")
1431 (description "This package provides a subset of the TeX Live
1432distribution.")
1433 (license (fold (lambda (package result)
1434 (match (package-license package)
1435 ((lst ...)
1436 (append lst result))
1437 ((? license:license? license)
1438 (cons license result))))
1439 '()
1440 (append default-packages packages)))))))
1441
9d4f8dc2
RW
1442(define-public texlive-tiny
1443 (package
1444 (inherit (texlive-union))
1445 (name "texlive-tiny")
1446 (description "This is a very limited subset of the TeX Live distribution.
1447It includes little more than the required set of LaTeX packages.")))
1448
9b416042
RW
1449(define-public texlive-latex-natbib
1450 (package
1451 (name "texlive-latex-natbib")
1452 (version (number->string %texlive-revision))
1453 (source (origin
1454 (method svn-fetch)
1455 (uri (texlive-ref "latex" "natbib"))
1456 (sha256
1457 (base32
1458 "0aqliq0nwblxyrzhwhv77pnmk7qh2y3prgq7z7qhwcbgz5kisld7"))))
1459 (build-system texlive-build-system)
1460 (arguments '(#:tex-directory "latex/natbib"))
1461 (home-page "http://www.ctan.org/pkg/natbib")
1462 (synopsis "Flexible bibliography support")
1463 (description
1464 "This bundle provides a package that implements both author-year and
1465numbered references, as well as much detailed of support for other
1466bibliography use. Also provided are versions of the standard BibTeX styles
1467that are compatible with @code{natbib}: @code{plainnat}, @code{unsrtnat},
1468@code{abbrnat}. The bibliography styles produced by @code{custom-bib} are
1469designed from the start to be compatible with @code{natbib}.")
1470 (license license:lppl)))
1471
171160d5
RW
1472(define-public texlive-latex-seminar
1473 (package
1474 (name "texlive-latex-seminar")
1475 (version (number->string %texlive-revision))
1476 (source (origin
1477 (method svn-fetch)
1478 (uri (svn-reference
1479 (url (string-append "svn://www.tug.org/texlive/tags/"
1480 %texlive-tag "/Master/texmf-dist/"
1481 "/tex/latex/seminar"))
1482 (revision %texlive-revision)))
1483 (sha256
1484 (base32
1485 "0y4i651b75y6006n03x8n86bsqvjsailvvz9bhzy51dzsznqidq0"))))
1486 (build-system texlive-build-system)
1487 (arguments '(#:tex-directory "latex/seminar"))
1488 (home-page "http://www.ctan.org/pkg/seminar")
1489 (synopsis "Make overhead slides")
1490 ;; TODO: This package may need fancybox and xcomment at runtime.
1491 (description
1492 "This package provides a class that produces overhead
1493slides (transparencies), with many facilities. Seminar is not nowadays
1494reckoned a good basis for a presentation — users are advised to use more
1495recent classes such as powerdot or beamer, both of which are tuned to
149621st-century presentation styles.")
1497 (license license:lppl1.2+)))
1498
8bcdc23f 1499(define texlive-texmf
0aa34e82
AE
1500 (package
1501 (name "texlive-texmf")
7a15a68f 1502 (version "2016")
0aa34e82
AE
1503 (source texlive-texmf-src)
1504 (build-system gnu-build-system)
1505 (inputs
1506 `(("texlive-bin" ,texlive-bin)
1507 ("lua" ,lua)
1508 ("perl" ,perl)
1509 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
1510 ("ruby" ,ruby)
1511 ("tcsh" ,tcsh)))
1512 (arguments
1513 `(#:modules ((guix build gnu-build-system)
1514 (guix build utils)
1515 (srfi srfi-26))
a348af40
LC
1516
1517 ;; This package takes 4 GiB, which we can't afford to distribute from
1518 ;; our servers.
1519 #:substitutable? #f
1520
0aa34e82 1521 #:phases
4a6635f3
AE
1522 (modify-phases (map (cut assq <> %standard-phases)
1523 '(set-paths unpack patch-source-shebangs))
1524 (add-after 'patch-source-shebangs 'install
1525 (lambda* (#:key outputs #:allow-other-keys)
1526 (let ((share (string-append (assoc-ref outputs "out") "/share")))
1527 (mkdir-p share)
1528 (system* "mv" "texmf-dist" share))))
1529 (add-after 'install 'texmf-config
1530 (lambda* (#:key inputs outputs #:allow-other-keys)
1531 (let* ((out (assoc-ref outputs "out"))
1532 (share (string-append out "/share"))
1533 (texmfroot (string-append share "/texmf-dist/web2c"))
1534 (texmfcnf (string-append texmfroot "/texmf.cnf"))
1535 (texlive-bin (assoc-ref inputs "texlive-bin"))
1536 (texbin (string-append texlive-bin "/bin"))
1537 (tlpkg (string-append texlive-bin "/share/tlpkg")))
1538 ;; Register SHARE as TEXMFROOT in texmf.cnf.
1539 (substitute* texmfcnf
1540 (("TEXMFROOT = \\$SELFAUTOPARENT")
2d634d9b
FB
1541 (string-append "TEXMFROOT = " share))
1542 (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
1543 "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
1544 (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
4a6635f3
AE
1545 ;; Register paths in texmfcnf.lua, needed for context.
1546 (substitute* (string-append texmfroot "/texmfcnf.lua")
1547 (("selfautodir:") out)
1548 (("selfautoparent:") (string-append share "/")))
1549 ;; Set path to TeXLive Perl modules
1550 (setenv "PERL5LIB"
1551 (string-append (getenv "PERL5LIB") ":" tlpkg))
1552 ;; Configure the texmf-dist tree; inspired from
1553 ;; http://slackbuilds.org/repository/13.37/office/texlive/
1554 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
1555 (setenv "TEXMFCNF" texmfroot)
1556 (system* "updmap-sys" "--nohash" "--syncwithtrees")
1557 (system* "mktexlsr")
1558 (system* "fmtutil-sys" "--all")))))))
7a15a68f 1559 (properties `((max-silent-time . 9600))) ; don't time out while grafting
0aa34e82 1560 (synopsis "TeX Live, a package of the TeX typesetting system")
eb0119ef
AE
1561 (description
1562 "TeX Live provides a comprehensive TeX document production system.
1563It includes all the major TeX-related programs, macro packages, and fonts
1564that are free software, including support for many languages around the
0aa34e82
AE
1565world.
1566
1567This package contains the complete tree of texmf-dist data.")
132e14b4
EF
1568 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1569 (home-page "https://www.tug.org/texlive/")))
0aa34e82
AE
1570
1571(define-public texlive
1572 (package
1573 (name "texlive")
7a15a68f 1574 (version "2016")
0aa34e82
AE
1575 (source #f)
1576 (build-system trivial-build-system)
1577 (inputs `(("bash" ,bash) ; for wrap-program
1578 ("texlive-bin" ,texlive-bin)
1579 ("texlive-texmf" ,texlive-texmf)))
2d634d9b
FB
1580 (native-search-paths
1581 (list (search-path-specification
1582 (variable "TEXMFLOCAL")
1583 (files '("share/texmf-local")))))
0aa34e82
AE
1584 (arguments
1585 `(#:modules ((guix build utils))
1586 #:builder
1587 ;; Build the union of texlive-bin and texlive-texmf, but take the
1588 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
1589 (begin
1590 (use-modules (guix build utils))
1591 (let ((out (assoc-ref %outputs "out"))
1592 (bin (assoc-ref %build-inputs "texlive-bin"))
1593 (texmf (assoc-ref %build-inputs "texlive-texmf"))
1594 (bash (assoc-ref %build-inputs "bash")))
1595 (mkdir out)
1596 (with-directory-excursion out
1597 (for-each
1598 (lambda (name)
1599 (symlink (string-append bin "/" name) name))
1600 '("include" "lib"))
1601 (mkdir "bin")
1602 (with-directory-excursion "bin"
1603 (setenv "PATH" (string-append bash "/bin"))
1604 (for-each
1605 (lambda (name)
1606 (symlink name (basename name))
1607 (wrap-program
1608 (basename name)
1609 `("TEXMFCNF" =
1610 (,(string-append texmf "/share/texmf-dist/web2c")))))
1611 (find-files (string-append bin "/bin/") "")))
1612 (mkdir "share")
1613 (with-directory-excursion "share"
1614 (for-each
1615 (lambda (name)
1616 (symlink (string-append bin "/share/" name) name))
1617 '("info" "man" "tlpkg"))
1618 (for-each
1619 (lambda (name)
1620 (symlink (string-append texmf "/share/" name) name))
1621 '("texmf-dist" "texmf-var"))))))))
1622 (synopsis "TeX Live, a package of the TeX typesetting system")
1623 (description
1624 "TeX Live provides a comprehensive TeX document production system.
1625It includes all the major TeX-related programs, macro packages, and fonts
1626that are free software, including support for many languages around the
1627world.
1628
1629This package contains the complete TeX Live distribution.")
132e14b4
EF
1630 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1631 (home-page "https://www.tug.org/texlive/")))
231eae53 1632
6b5eb840
AE
1633
1634;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
a348af40
LC
1635;; in particular dropping documentation and fonts. It weighs in at 470 MiB
1636;; instead of 4 GiB.
6b5eb840
AE
1637(define texlive-texmf-minimal
1638 (package (inherit texlive-texmf)
1639 (name "texlive-texmf-minimal")
1640 (arguments
1641 (substitute-keyword-arguments
1642 (package-arguments texlive-texmf)
1643 ((#:modules modules)
1644 `((ice-9 ftw)
1645 (srfi srfi-1)
1646 ,@modules))
1647 ((#:phases phases)
1648 `(modify-phases ,phases
1649 (add-after 'unpack 'prune
1650 (lambda _
1651 (define (delete subdir exclude)
1652 "Delete all files and directories in SUBDIR except for those
1653given in the list EXCLUDE."
1654 (with-directory-excursion subdir
1655 (for-each delete-file-recursively
1656 (lset-difference equal?
1657 (scandir ".")
1658 (append '("." "..")
1659 exclude)))))
1660 (with-directory-excursion "texmf-dist"
1661 (for-each delete-file-recursively
1662 '("doc" "source" "tex4ht"))
1663 ;; Delete all subdirectories of "fonts", except for "tfm" and
1664 ;; any directories named "cm".
1665 (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
1666 (delete "fonts/afm" '("public"))
1667 (delete "fonts/afm/public" '("amsfonts"))
1668 (delete "fonts/afm/public/amsfonts" '("cm"))
1669 (delete "fonts/map" '("dvips"))
1670 (delete "fonts/map/dvips" '("cm"))
1671 (delete "fonts/source" '("public"))
1672 (delete "fonts/source/public" '("cm"))
1673 (delete "fonts/tfm" '("public"))
1674 (delete "fonts/type1" '("public"))
1675 (delete "fonts/type1/public" '("amsfonts"))
1676 (delete "fonts/type1/public/amsfonts" '("cm")))
1677 #t))))))
1678 (description
1679 "TeX Live provides a comprehensive TeX document production system.
1680It includes all the major TeX-related programs, macro packages, and fonts
1681that are free software, including support for many languages around the
1682world.
1683
1684This package contains a small subset of the texmf-dist data.")))
1685
1686
1687;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal
1688;; instead of the full texlive-texmf. It can be used, for instance, as a
1689;; native input to packages that need texlive to build their documentation.
1690(define-public texlive-minimal
1691 (package (inherit texlive)
1692 (name "texlive-minimal")
1693 (inputs
1694 `(("texlive-texmf" ,texlive-texmf-minimal)
1695 ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
2d634d9b
FB
1696 (native-search-paths
1697 (list (search-path-specification
1698 (variable "TEXMFLOCAL")
1699 (files '("share/texmf-local")))))
6b5eb840
AE
1700 (description
1701 "TeX Live provides a comprehensive TeX document production system.
1702It includes all the major TeX-related programs, macro packages, and fonts
1703that are free software, including support for many languages around the
1704world.
1705
1706This package contains a small working part of the TeX Live distribution.")))
1707
ebcf74da
RW
1708(define-public perl-text-bibtex
1709 (package
1710 (name "perl-text-bibtex")
1711 (version "0.77")
1712 (source
1713 (origin
1714 (method url-fetch)
1715 (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
1716 version ".tar.gz"))
1717 (sha256
1718 (base32
1719 "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4"))))
1720 (build-system perl-build-system)
1721 (arguments
1722 `(#:phases
1723 (modify-phases %standard-phases
1724 (add-after 'unpack 'add-output-directory-to-rpath
1725 (lambda* (#:key outputs #:allow-other-keys)
1726 (substitute* "inc/MyBuilder.pm"
1727 (("-Lbtparse" line)
1728 (string-append "-Wl,-rpath="
1729 (assoc-ref outputs "out") "/lib " line)))
1730 #t))
1731 (add-after 'unpack 'install-libraries-to-/lib
1732 (lambda* (#:key outputs #:allow-other-keys)
1733 (substitute* "Build.PL"
1734 (("lib64") "lib"))
1735 #t)))))
1736 (native-inputs
1737 `(("perl-capture-tiny" ,perl-capture-tiny)
1738 ("perl-config-autoconf" ,perl-config-autoconf)
1739 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1740 ("perl-module-build" ,perl-module-build)))
1741 (home-page "http://search.cpan.org/dist/Text-BibTeX")
1742 (synopsis "Interface to read and parse BibTeX files")
1743 (description "@code{Text::BibTeX} is a Perl library for reading, parsing,
1744and processing BibTeX files. @code{Text::BibTeX} gives you access to the data
1745at many different levels: you may work with BibTeX entries as simple field to
1746string mappings, or get at the original form of the data as a list of simple
1747values (strings, macros, or numbers) pasted together.")
2f3108ad 1748 (license license:perl-license)))
ebcf74da 1749
d4000680
RW
1750(define-public biber
1751 (package
1752 (name "biber-next")
1753 (version "2.6")
1754 (source (origin
1755 (method url-fetch)
1756 (uri (string-append "https://github.com/plk/biber/archive/v"
1757 version ".tar.gz"))
1758 (file-name (string-append name "-" version ".tar.gz"))
1759 (sha256
1760 (base32
1761 "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp"))))
1762 (build-system perl-build-system)
1763 (arguments
1764 `(#:phases
1765 (modify-phases %standard-phases
1766 (add-after 'install 'wrap-programs
1767 (lambda* (#:key outputs #:allow-other-keys)
1768 (let* ((out (assoc-ref outputs "out"))
1769 (perl5lib (getenv "PERL5LIB")))
1770 (wrap-program (string-append out "/bin/biber")
1771 `("PERL5LIB" ":" prefix
1772 (,(string-append perl5lib ":" out
1773 "/lib/perl5/site_perl")))))
1774 #t)))))
1775 (inputs
1776 `(("perl-autovivification" ,perl-autovivification)
1777 ("perl-class-accessor" ,perl-class-accessor)
1778 ("perl-data-dump" ,perl-data-dump)
1779 ("perl-data-compare" ,perl-data-compare)
1780 ("perl-data-uniqid" ,perl-data-uniqid)
1781 ("perl-datetime-format-builder" ,perl-datetime-format-builder)
1782 ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian)
1783 ("perl-file-slurp" ,perl-file-slurp)
1784 ("perl-ipc-cmd" ,perl-ipc-cmd)
1785 ("perl-ipc-run3" ,perl-ipc-run3)
1786 ("perl-list-allutils" ,perl-list-allutils)
1787 ("perl-list-moreutils" ,perl-list-moreutils)
1788 ("perl-mozilla-ca" ,perl-mozilla-ca)
1789 ("perl-regexp-common" ,perl-regexp-common)
1790 ("perl-log-log4perl" ,perl-log-log4perl)
1791 ;; We cannot use perl-unicode-collate here, because otherwise the
1792 ;; hardcoded hashes in the tests would differ. See
1793 ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html
1794 ;;("perl-unicode-collate" ,perl-unicode-collate)
1795 ("perl-unicode-normalize" ,perl-unicode-normalize)
1796 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
1797 ("perl-encode-eucjpascii" ,perl-encode-eucjpascii)
1798 ("perl-encode-jis2k" ,perl-encode-jis2k)
1799 ("perl-encode-hanextra" ,perl-encode-hanextra)
1800 ("perl-xml-libxml" ,perl-xml-libxml)
1801 ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)
1802 ("perl-xml-libxslt" ,perl-xml-libxslt)
1803 ("perl-xml-writer" ,perl-xml-writer)
1804 ("perl-sort-key" ,perl-sort-key)
1805 ("perl-text-csv" ,perl-text-csv)
1806 ("perl-text-csv-xs" ,perl-text-csv-xs)
1807 ("perl-text-roman" ,perl-text-roman)
1808 ("perl-uri" ,perl-uri)
1809 ("perl-text-bibtex" ,perl-text-bibtex)
1810 ("perl-libwww" ,perl-libwww)
1811 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
1812 ("perl-business-isbn" ,perl-business-isbn)
1813 ("perl-business-issn" ,perl-business-issn)
1814 ("perl-business-ismn" ,perl-business-ismn)
1815 ("perl-lingua-translit" ,perl-lingua-translit)))
1816 (native-inputs
1817 `(("perl-config-autoconf" ,perl-config-autoconf)
1818 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1819 ("perl-module-build" ,perl-module-build)
1820 ;; for tests
1821 ("perl-file-which" ,perl-file-which)
1822 ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient
1823 ("perl-test-differences" ,perl-test-differences)))
1824 (home-page "http://biblatex-biber.sourceforge.net/")
1825 (synopsis "Backend for the BibLaTeX citation management tool")
1826 (description "Biber is a BibTeX replacement for users of biblatex. Among
1827other things it comes with full Unicode support.")
1828 (license license:artistic2.0)))
1829
253cdd6c
RW
1830;; Our version of texlive comes with biblatex 3.4, which is only compatible
1831;; with biber 2.5 according to the compatibility matrix in the biber
1832;; documentation.
1833(define-public biber-2.5
1834 (package (inherit biber)
1835 (name "biber")
1836 (version "2.5")
1837 (source (origin
1838 (method url-fetch)
1839 (uri (string-append "https://github.com/plk/biber/archive/v"
1840 version ".tar.gz"))
1841 (file-name (string-append name "-" version ".tar.gz"))
1842 (sha256
1843 (base32
1844 "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv"))))
1845 (arguments
1846 (substitute-keyword-arguments (package-arguments biber)
1847 ((#:phases phases)
1848 `(modify-phases ,phases
1849 (add-before 'check 'delete-failing-test
1850 (lambda _
1851 (delete-file "t/sort-order.t")
1852 #t))))))
1853 (inputs
1854 `(("perl-date-simple" ,perl-date-simple)
1855 ,@(package-inputs biber)))))
6b5eb840 1856
231eae53
LC
1857(define-public rubber
1858 (package
1859 (name "rubber")
1860 (version "1.1")
1861 (source (origin
1862 (method url-fetch)
1863 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
1864 version "/+download/rubber-"
1865 version ".tar.gz")
1866 (string-append "http://ebeffara.free.fr/pub/rubber-"
1867 version ".tar.gz")))
1868 (sha256
1869 (base32
1870 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
1871 (build-system gnu-build-system)
1872 (arguments '(#:tests? #f)) ; no `check' target
1873 (inputs `(("texinfo" ,texinfo)
9bee5d6c 1874 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
231eae53
LC
1875 ("which" ,which)))
1876 (home-page "https://launchpad.net/rubber")
35b9e423 1877 (synopsis "Wrapper for LaTeX and friends")
231eae53
LC
1878 (description
1879 "Rubber is a program whose purpose is to handle all tasks related to the
1880compilation of LaTeX documents. This includes compiling the document itself,
1881of course, enough times so that all references are defined, and running BibTeX
1882to manage bibliographic references. Automatic execution of dvips to produce
1883PostScript documents is also included, as well as usage of pdfLaTeX to produce
1884PDF documents.")
1885 (license license:gpl2+)))
4791876c
RJ
1886
1887(define-public texmaker
1888 (package
1889 (name "texmaker")
1890 (version "4.5")
1891 (source (origin
1892 (method url-fetch)
1893 (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
1894 version ".tar.bz2"))
1895 (sha256
1896 (base32
1897 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
1898 (build-system gnu-build-system)
1899 (arguments
1900 `(#:phases
1901 (modify-phases %standard-phases
1902 ;; Qt has its own configuration utility.
1903 (replace 'configure
1904 (lambda* (#:key outputs #:allow-other-keys)
1905 (let ((out (assoc-ref outputs "out")))
1906 (zero? (system* "qmake"
1907 (string-append "PREFIX=" out)
1908 (string-append "DESKTOPDIR=" out
1909 "/share/applications")
1910 (string-append "ICONDIR=" out "/share/pixmaps")
1911 "texmaker.pro"))))))))
1912 (inputs
1913 `(("poppler-qt5" ,poppler-qt5)
bd917486
TD
1914 ("qtbase" ,qtbase)
1915 ("qtscript" ,qtscript)
1916 ("qtwebkit" ,qtwebkit)
4791876c
RJ
1917 ("zlib" ,zlib)))
1918 (native-inputs
1919 `(("pkg-config" ,pkg-config)))
1920 (home-page "http://www.xm1math.net/texmaker/")
1921 (synopsis "LaTeX editor")
1922 (description "Texmaker is a program that integrates many tools needed to
1923develop documents with LaTeX, in a single application.")
1924 (license license:gpl2+)))
83457fe0
JD
1925
1926
1927(define-public teximpatient
1928 (package
1929 (name "teximpatient")
1930 (version "2.4")
1931 (source (origin
1932 (method url-fetch)
1933 (uri (string-append "mirror://gnu/" name "/" name "-"
1934 version ".tar.gz"))
1935 (sha256
1936 (base32
1937 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
1938 (build-system gnu-build-system)
1939 (arguments
1940 `(#:phases
1941 (modify-phases %standard-phases
1942 (delete 'check)
1943 ;; Unfortunately some mistakes have been made in packaging.
1944 ;; Work around them here ...
1945 (replace 'unpack
1946 (lambda* (#:key inputs outputs #:allow-other-keys)
1947 (let ((srcdir "teximpatient-2.4"))
1948 (system* "tar" "-xzf" (assoc-ref inputs "source")
1949 (string-append "--one-top-level=" srcdir))
1950 (delete-file (string-append srcdir "/book.pdf"))
1951 (install-file (car
1952 (find-files
1953 (assoc-ref inputs "automake")
1954 "^install-sh$"))
1955 srcdir)
1956 (chdir srcdir)))))))
1957 (native-inputs
1958 `(("texlive" ,texlive)
1959 ("automake" ,automake)))
6fd52309 1960 (home-page "https://www.gnu.org/software/teximpatient/")
83457fe0
JD
1961 (synopsis "Book on TeX, plain TeX and Eplain")
1962 (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
1963plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
1964and Karl Berry.")
1965 (license license:fdl1.3+)))