gnu: Add texlive-latex-hyperref.
[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"))
bd6e2385
RW
738 (zero? (system* "tex" "-ini" "-interaction=batchmode"
739 "-output-directory=web2c"
740 "tex.ini"))
741 ;; LaTeX, pdfetex/pdftex, and XeTeX require e-TeX, which
742 ;; is enabled only in extended mode (activated with a
743 ;; leading asterisk). We should not use luatex here,
744 ;; because that would make the generated format files
745 ;; incompatible with any other TeX engine.
010f476f
RW
746
747 ;; FIXME: XeTeX fails to build because neither
748 ;; \XeTeXuseglyphmetrics nor \XeTeXdashbreakstate are
749 ;; defined.
750 (every
751 (lambda (format)
752 (zero? (system* "latex" "-ini" "-interaction=batchmode"
753 "-output-directory=web2c"
754 "-translate-file=cp227.tcx"
755 (string-append "*" format ".ini"))))
756 '("latex" ;"xetex"
bd6e2385
RW
757 "pdflatex"
758 "pdfetex"))
010f476f
RW
759 (every
760 (lambda (format)
761 (zero? (system* "luatex" "-ini" "-interaction=batchmode"
762 "-output-directory=web2c"
763 (string-append format ".ini"))))
764 '("dviluatex" "dvilualatex" "luatex" "lualatex" "xelatex")))))
765 (replace 'install
766 (lambda* (#:key outputs #:allow-other-keys)
767 (let* ((out (assoc-ref outputs "out"))
768 (target (string-append
769 out "/share/texmf-dist/tex/latex/base"))
770 (web2c (string-append
771 out "/share/texmf-dist/web2c")))
772 (mkdir-p target)
773 (mkdir-p web2c)
774 (for-each delete-file (find-files "." "\\.(log|aux)$"))
775 (for-each (cut install-file <> target)
776 (find-files "build" ".*"))
777 (for-each (cut install-file <> web2c)
778 (find-files "web2c" ".*"))
bd6e2385
RW
779 ;; pdftex is really just the same as pdfetex, but since it
780 ;; doesn't have its own format file, we need to copy it.
781 (copy-file "web2c/pdfetex.fmt"
782 (string-append web2c "/pdftex.fmt"))
010f476f
RW
783 #t))))))
784 (native-inputs
785 `(("texlive-bin" ,texlive-bin)
786 ("texlive-generic-unicode-data" ,texlive-generic-unicode-data)
787 ("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl)
788 ("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files)
789 ("texlive-latex-latexconfig"
790 ,(texlive-dir "tex/latex/latexconfig/"
791 "1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf"))
792 ("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8)
793 ("texlive-generic-hyphen"
794 ,(texlive-dir "tex/generic/hyphen/"
795 "0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd"))
796 ("texlive-generic-ruhyphen"
797 ,(texlive-dir "tex/generic/ruhyphen/"
798 "14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd"))
799 ("texlive-generic-ukrhyph"
800 ,(texlive-dir "tex/generic/ukrhyph/"
801 "1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv"))
802 ("texlive-generic-config"
803 ,(texlive-dir "tex/generic/config/"
804 "19vj088p4kkp6xll0141m4kl6ssgdzhs3g10i232khb07aqiag8s"))
805 ("texlive-tex-plain" ,texlive-tex-plain)
806 ("texlive-fonts-cm" ,texlive-fonts-cm)
807 ("texlive-fonts-latex" ,texlive-fonts-latex)
808 ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)))
809 (home-page "http://www.ctan.org/pkg/latex-base")
810 (synopsis "Base sources of LaTeX")
811 (description
812 "This bundle comprises the source of LaTeX itself, together with several
813packages which are considered \"part of the kernel\". This bundle, together
814with the required packages, constitutes what every LaTeX distribution should
815contain.")
816 (license license:lppl1.3c+))))
817
3e485ed2
RW
818(define-public texlive-latex-filecontents
819 (package
820 (name "texlive-latex-filecontents")
821 (version (number->string %texlive-revision))
822 (source (origin
823 (method svn-fetch)
824 (uri (texlive-ref "latex" "filecontents"))
825 (sha256
826 (base32
827 "0swkbxv8vg0yizadfnvrwjb4cj0pn34v9wm6v7wqq903fdav7k7q"))))
828 (build-system texlive-build-system)
829 (arguments '(#:tex-directory "latex/filecontents"))
830 (home-page "http://www.ctan.org/pkg/filecontents")
831 (synopsis "Extended filecontents and filecontents* environments")
832 (description
833 "LaTeX2e's @code{filecontents} and @code{filecontents*} environments
834enable a LaTeX source file to generate external files as it runs through
835LaTeX. However, there are two limitations of these environments: they refuse
836to overwrite existing files, and they can only be used in the preamble of a
837document. The filecontents package removes these limitations, letting you
838overwrite existing files and letting you use @code{filecontents} /
839@code{filecontents*} anywhere.")
840 (license license:lppl1.3c+)))
841
1193aa89
RW
842(define-public texlive-generic-ifxetex
843 (package
844 (name "texlive-generic-ifxetex")
fea8eef3 845 (version (number->string %texlive-revision))
1193aa89
RW
846 (source (origin
847 (method svn-fetch)
848 (uri (texlive-ref "generic" "ifxetex"))
849 (sha256
850 (base32
851 "0w2xj7n0szavj329kds09q626szkc378p3w0sk022q0ln4ksz86d"))))
852 (build-system texlive-build-system)
853 (arguments
854 '(#:tex-directory "generic/ifxetex"
855 #:tex-format "xelatex"))
856 (inputs
857 `(("texlive-latex-filecontents" ,texlive-latex-filecontents)))
858 (home-page "http://www.ctan.org/pkg/ifxetex")
859 (synopsis "Am I running under XeTeX?")
860 (description
861 "This is a simple package which provides an @code{\\ifxetex} conditional,
862so that other code can determine that it is running under XeTeX. The package
863requires the etexe-TeX extensions to the TeX primitive set.")
864 (license license:lppl1.3c+)))
865
437822a1
RW
866(define-public texlive-latex-fancyvrb
867 (package
868 (name "texlive-latex-fancyvrb")
869 (version (number->string %texlive-revision))
870 (source (origin
871 (method svn-fetch)
872 (uri (texlive-ref "latex" "fancyvrb"))
873 (sha256
874 (base32
875 "03l7140y031rr14h02i4z9zqsfvrbn7wzwxbjsrjcgrk6sdr71wv"))))
876 (build-system texlive-build-system)
877 (arguments
878 '(#:tex-directory "latex/fancyvrb"
879 ;; We exclude "fvrb-ex" to avoid a dependency on texlive-luaotfload and
880 ;; thus texlive-luatex-lualibs.
881 #:build-targets '("fancyvrb.ins")))
882 (home-page "http://www.ctan.org/pkg/fancyvrb")
883 (synopsis "Sophisticated verbatim text")
884 (description
885 "This package provides tools for the flexible handling of verbatim text
886including: verbatim commands in footnotes; a variety of verbatim environments
887with many parameters; ability to define new customized verbatim environments;
888save and restore verbatim text and environments; write and read files in
889verbatim mode; build \"example\" environments (showing both result and
890verbatim source).")
891 (license license:lppl1.0+)))
892
4eebd2cd
RW
893(define-public texlive-latex-graphics
894 (package
895 (name "texlive-latex-graphics")
896 (version (number->string %texlive-revision))
897 (source (origin
898 (method svn-fetch)
899 (uri (texlive-ref "latex" "graphics"))
900 (sha256
901 (base32
e3c970fc 902 "07azyn0b1s49vbdlr6dmygrminxp72ndl24j1091hiiccvrjq3xc"))))
4eebd2cd
RW
903 (build-system texlive-build-system)
904 (arguments
905 '(#:tex-directory "latex/graphics"
906 #:phases
907 (modify-phases %standard-phases
908 (add-after 'install 'install-config
909 (lambda* (#:key inputs outputs #:allow-other-keys)
910 (let ((cfg (assoc-ref inputs "graphics-cfg"))
911 (target (string-append (assoc-ref outputs "out")
912 "/share/texmf-dist/tex/latex/graphics-cfg")))
913 (mkdir-p target)
914 (install-file (string-append cfg "/graphics.cfg") target)
915 (install-file (string-append cfg "/color.cfg") target)
916 #t)))
917 (add-after 'install 'install-defs
918 (lambda* (#:key inputs outputs #:allow-other-keys)
919 (let ((def (assoc-ref inputs "graphics-def"))
920 (target (string-append (assoc-ref outputs "out")
921 "/share/texmf-dist/tex/latex/graphics-def")))
922 (mkdir-p target)
923 (copy-recursively def target)
924 #t))))))
925 (native-inputs
926 `(("graphics-cfg"
927 ,(origin
928 (method git-fetch)
929 (uri (git-reference
930 (url "https://github.com/latex3/graphics-cfg.git")
931 (commit "19d1238af17df376cd46333b229579b0f7f3a41f")))
932 (sha256
933 (base32
934 "12kbgbm52gmmgn8zajb74s8n5rvnxcfdvs3iyj8vcw5vrsw5i6mh"))))
935 ("graphics-def"
936 ,(origin
937 (method svn-fetch)
938 (uri (svn-reference
939 (url (string-append "svn://www.tug.org/texlive/tags/"
940 %texlive-tag "/Master/texmf-dist/"
941 "/tex/latex/graphics-def"))
942 (revision %texlive-revision)))
943 (sha256
944 (base32
51c15375 945 "0gi4qv6378nl84s8n1yx3hjqvv7r4lza7hpbymbl5rzwgw8qrnyb"))))))
4eebd2cd
RW
946 (home-page "http://www.ctan.org/pkg/latex-graphics")
947 (synopsis "LaTeX standard graphics bundle")
948 (description
949 "This is a collection of LaTeX packages for producing color, including
950graphics (e.g. PostScript) files, and rotation and scaling of text in LaTeX
951documents. It comprises the packages color, graphics, graphicx, trig, epsfig,
952keyval, and lscape.")
953 ;; The configuration files are released under CC0.
954 (license (list license:lppl1.3c+
955 license:cc0))))
956
f5a6af42
RW
957(define-public texlive-latex-xcolor
958 (package
959 (name "texlive-latex-xcolor")
960 (version (number->string %texlive-revision))
961 (source (origin
962 (method svn-fetch)
963 (uri (texlive-ref "latex" "xcolor"))
964 (sha256
965 (base32
966 "01n613s7bcrd2n4jfawm0k4nn2ny3aaifp2jjfif3lz4sbv31494"))))
967 (build-system texlive-build-system)
968 (arguments '(#:tex-directory "latex/xcolor"))
969 (home-page "http://www.ctan.org/pkg/xcolor")
970 (synopsis "Driver-independent color extensions for LaTeX and pdfLaTeX")
971 (description
972 "The package starts from the basic facilities of the colorcolor package,
973and provides easy driver-independent access to several kinds of color tints,
974shades, tones, and mixes of arbitrary colors. It allows a user to select a
975document-wide target color model and offers complete tools for conversion
976between eight color models. Additionally, there is a command for alternating
977row colors plus repeated non-aligned material (like horizontal lines) in
978tables.")
979 (license license:lppl1.2+)))
980
4d660fdf
RW
981(define-public texlive-latex-hyperref
982 (package
983 (name "texlive-latex-hyperref")
984 (version "6.84a2")
985 ;; The sources in the TeX Live SVN repository do not contain hluatex.dtx,
986 ;; so we fetch the release from GitHub.
987 (source (origin
988 (method url-fetch)
989 (uri (string-append "https://github.com/ho-tex/hyperref/"
990 "archive/release-" version ".tar.gz"))
991 (file-name (string-append name "-" version ".tar.gz"))
992 (sha256
993 (base32
994 "1d3rmjgzh0025a1dza55zb6nzzlgd1y9snwx45wq1c1vf42m79h2"))))
995 (build-system texlive-build-system)
996 (arguments '(#:tex-directory "latex/hyperref"))
997 (home-page "http://www.ctan.org/pkg/hyperref")
998 (synopsis "Extensive support for hypertext in LaTeX")
999 (description
1000 "The hyperref package is used to handle cross-referencing commands in
1001LaTeX to produce hypertext links in the document. The package provides
1002backends for the special set defined for HyperTeX DVI processors; for embedded
1003pdfmark commands for processing by Acrobat Distiller (dvips and dvipsone); for
1004dviwindo; for PDF control within pdfTeX and dvipdfm; for TeX4ht; and for VTeX
1005pdf and HTML backends. The package is distributed with the backref and
1006nameref packages, which make use of the facilities of hyperref.")
1007 (license license:lppl1.3+)))
1008
c3455b7d
RW
1009(define-public texlive-latex-oberdiek
1010 (package
1011 (name "texlive-latex-oberdiek")
1012 (version (number->string %texlive-revision))
1013 (source (origin
1014 (method svn-fetch)
1015 (uri (texlive-ref "latex" "oberdiek"))
1016 (sha256
1017 (base32
1018 "0aswvsxgsn709xmvpcg50d2xl7vcy1ckdxb9c1cligqqfjjvviqf"))))
1019 (build-system texlive-build-system)
1020 (arguments
1021 '(#:tex-directory "latex/oberdiek"
1022 #:phases
1023 (modify-phases %standard-phases
1024 ;; "ifpdf.ins" is not generated, so we cannot process it.
1025 (add-after 'unpack 'do-not-process-ifpdf.ins
1026 (lambda _
1027 (substitute* "oberdiek.ins"
1028 (("\\\\batchinput\\{ifpdf.ins\\}") ""))
1029 #t)))))
1030 (home-page "http://www.ctan.org/pkg/oberdiek")
1031 (synopsis "Bundle of packages submitted by Heiko Oberdiek")
1032 (description
1033 "The bundle comprises various LaTeX packages, providing among others:
1034better accessibility support for PDF files; extensible chemists reaction
1035arrows; record information about document class(es) used; and many more.")
1036 (license license:lppl1.3+)))
1037
f2536af2
RW
1038(define-public texlive-latex-tools
1039 (package
1040 (name "texlive-latex-tools")
1041 (version (number->string %texlive-revision))
1042 (source (origin
1043 (method svn-fetch)
1044 (uri (texlive-ref "latex" "tools"))
1045 (sha256
1046 (base32
1047 "052a0pch2k5zls5jlay9xxcf93rw3i60a2x28y3ip3rhbsv3xgiz"))))
1048 (build-system texlive-build-system)
1049 (arguments
1050 '(#:tex-directory "latex/tools"
1051 #:build-targets '("tools.ins")))
1052 (home-page "http://www.ctan.org/pkg/latex-tools")
1053 (synopsis "LaTeX standard tools bundle")
1054 (description
1055 "This package is a collection of (variously) simple tools provided as
1056part of the LaTeX required tools distribution, comprising the following
1057packages: afterpage, array, bm, calc, dcolumn, delarray, enumerate, fileerr,
1058fontsmpl, ftnright, hhline, indentfirst, layout, longtable, multicol,
1059rawfonts, showkeys, somedefs, tabularx, theorem, trace, varioref, verbatim,
1060xr, and xspace.")
1061 (license license:lppl1.3+)))
1062
35adcc3a
RW
1063(define-public texlive-latex-url
1064 (package
1065 (name "texlive-latex-url")
1066 (version (number->string %texlive-revision))
1067 (source (origin
1068 (method svn-fetch)
1069 (uri (svn-reference
1070 (url (string-append "svn://www.tug.org/texlive/tags/"
1071 %texlive-tag "/Master/texmf-dist/"
1072 "/tex/latex/url"))
1073 (revision %texlive-revision)))
1074 (sha256
1075 (base32
1076 "184s2543cwia5l7iibhlkl1ffbncfhjpv5p56zq0c15by5sghlac"))))
1077 (build-system trivial-build-system)
1078 (arguments
1079 `(#:modules ((guix build utils))
1080 #:builder
1081 (begin
1082 (use-modules (guix build utils))
1083 (let ((target (string-append (assoc-ref %outputs "out")
1084 "/share/texmf-dist/tex/latex/url")))
1085 (mkdir-p target)
1086 (copy-recursively (assoc-ref %build-inputs "source") target)
1087 #t))))
1088 (home-page "https://www.ctan.org/pkg/url")
1089 (synopsis "Verbatim with URL-sensitive line breaks")
1090 (description "The command @code{\\url} is a form of verbatim command that
1091allows linebreaks at certain characters or combinations of characters, accepts
1092reconfiguration, and can usually be used in the argument to another command.
1093The command is intended for email addresses, hypertext links,
1094directories/paths, etc., which normally have no spaces, so by default the
1095package ignores spaces in its argument. However, a package option allows
1096spaces, which is useful for operating systems where spaces are a common part
1097of file names.")
1098 ;; The license header states that it is under LPPL version 2 or later, but
1099 ;; the latest version is 1.3c.
1100 (license license:lppl1.3c+)))
1101
a5b1ef84
RW
1102(define-public texlive-latex-l3kernel
1103 (package
1104 (name "texlive-latex-l3kernel")
1105 (version (number->string %texlive-revision))
1106 (source (origin
1107 (method svn-fetch)
1108 (uri (texlive-ref "latex" "l3kernel"))
1109 (sha256
1110 (base32
1f7d1010 1111 "0r0wfk594j8wkdqhh21haimwsfq8x5jch4ldm21hkzk5dnmvpbg6"))))
a5b1ef84
RW
1112 (build-system texlive-build-system)
1113 (arguments
1114 '(#:tex-directory "latex/l3kernel"))
1115 (home-page "http://www.ctan.org/pkg/l3kernel")
1116 (synopsis "LaTeX3 programmers’ interface")
1117 (description
1118 "The l3kernel bundle provides an implementation of the LaTeX3
1119programmers’ interface, as a set of packages that run under LaTeX 2e. The
1120interface provides the foundation on which the LaTeX3 kernel and other future
1121code are built: it is an API for TeX programmers. The packages are set up so
1122that the LaTeX3 conventions can be used with regular LaTeX 2e packages.")
1123 (license license:lppl1.3c+)))
1124
cc09d48b
RW
1125(define-public texlive-latex-l3packages
1126 (package
1127 (name "texlive-latex-l3packages")
1128 (version (number->string %texlive-revision))
1129 (source (origin
1130 (method svn-fetch)
1131 (uri (texlive-ref "latex" "l3packages"))
1132 (sha256
1133 (base32
83474718 1134 "16jplkvzdysfssijq9l051nsks65c2nrarsl17k8gjhc28yznj8y"))))
cc09d48b
RW
1135 (build-system texlive-build-system)
1136 (arguments
1137 '(#:tex-directory "latex/l3packages"
1138 #:phases
1139 (modify-phases %standard-phases
1140 ;; All package sources are in sub-directories, so we need to add them
1141 ;; to TEXINPUTS.
1142 (add-after 'unpack 'set-TEXINPUTS
1143 (lambda _
1144 (let ((cwd (getcwd)))
1145 (setenv "TEXINPUTS"
1146 (string-append cwd "/l3keys2e:"
1147 cwd "/xparse:"
1148 cwd "/xfrac:"
1149 cwd "/xfp:"
1150 cwd "/xtemplate")))
1151 #t)))))
1152 (inputs
1153 `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1154 (home-page "http://www.ctan.org/pkg/l3packages")
1155 (synopsis "High-level LaTeX3 concepts")
1156 (description
1157 "This bundle holds prototype implementations of concepts for a LaTeX
1158designer interface, to be used with the experimental LaTeX kernel as
1159programming tools and kernel sup­port. Packages provided in this release are:
1160
1161@enumerate
1162@item l3keys2e, which makes the facilities of the kernel module l3keys
1163 available for use by LaTeX 2e packages;
1164@item xfrac, which provides flexible splitlevel fractions;
1165@item xparse, which provides a high-level interface for declaring document
1166 commands; and
1167@item xtemplate, which provides a means of defining generic functions using a
1168 key-value syntax.
1169@end enumerate\n")
1170 (license license:lppl1.3c+)))
1171
58308491
RW
1172(define-public texlive-latex-fontspec
1173 (package
1174 (name "texlive-latex-fontspec")
1175 (version (number->string %texlive-revision))
1176 (source (origin
1177 (method svn-fetch)
1178 (uri (texlive-ref "latex" "fontspec"))
1179 (sha256
1180 (base32
1181 "1rx43y5xmjqvc27pjdnmqwp4pcw3czcfd6nfpmzc1gnqfl1hlc0q"))))
1182 (build-system texlive-build-system)
1183 (arguments
1184 '(#:tex-directory "latex/fontspec"
1185 #:build-targets '("fontspec.dtx")))
1186 (inputs
1187 `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1188 (home-page "http://www.ctan.org/pkg/fontspec")
1189 (synopsis "Advanced font selection in XeLaTeX and LuaLaTeX")
1190 (description
1191 "Fontspec is a package for XeLaTeX and LuaLaTeX. It provides an
1192automatic and unified interface to feature-rich AAT and OpenType fonts through
1193the NFSS in LaTeX running on XeTeX or LuaTeX engines. The package requires
1194the l3kernel and xparse bundles from the LaTeX 3 development team.")
1195 (license license:lppl1.3+)))
1196
e93f472d
RW
1197;; The SVN directory contains little more than a dtx file that generates three
1198;; of the many lua files that should be installed as part of this package.
1199;; This is why we take the release from GitHub instead.
1200(define-public texlive-luatex-lualibs
1201 (package
1202 (name "texlive-luatex-lualibs")
1203 (version "2.5")
1204 (source (origin
1205 (method url-fetch)
1206 (uri (string-append "https://github.com/lualatex/lualibs/"
1207 "releases/download/v"
1208 version "/lualibs.zip"))
1209 (sha256
1210 (base32
1211 "1xx9blvrmx9hyhrl345lpai9m6xxnw997261a1ahn1bm5r2j5fqy"))))
1212 (build-system gnu-build-system)
1213 (arguments
1214 `(#:make-flags
1215 (list (string-append "DESTDIR="
1216 (assoc-ref %outputs "out")
1217 "/share/texmf-dist"))
1218 #:phases
1219 (modify-phases %standard-phases
1220 (delete 'configure))))
1221 (native-inputs
1222 `(("texlive-bin" ,texlive-bin)
1223 ("unzip" ,unzip)
1224 ("zip" ,zip)))
1225 (home-page "https://github.com/lualatex/lualibs")
1226 (synopsis "Lua modules for general programming (in the (La)TeX world)")
1227 (description
1228 "Lualibs is a collection of Lua modules useful for general programming.
1229The bundle is based on Lua modules shipped with ConTeXt, and made available in
1230this bundle for use independent of ConTeXt.")
1231 ;; GPL version 2 only
1232 (license license:gpl2)))
1233
2573163a
RW
1234(define-public texlive-latex-amsmath
1235 (package
1236 (name "texlive-latex-amsmath")
1237 (version (number->string %texlive-revision))
1238 (source (origin
1239 (method svn-fetch)
1240 (uri (texlive-ref "latex" "amsmath"))
1241 (sha256
1242 (base32
1243 "178ywjpdlv78qmfzqdyn6gy14620zjsn2q9wap76fbr9s4hw6dba"))))
1244 (build-system texlive-build-system)
1245 (arguments '(#:tex-directory "latex/amsmath"))
1246 (home-page "http://www.ctan.org/pkg/amsmath")
1247 (synopsis "AMS mathematical facilities for LaTeX")
1248 (description
1249 "This is the principal package in the AMS-LaTeX distribution. It adapts
1250for use in LaTeX most of the mathematical features found in AMS-TeX; it is
1251highly recommended as an adjunct to serious mathematical typesetting in LaTeX.
1252When amsmath is loaded, AMS-LaTeX packages @code{amsbsyamsbsy} (for bold
1253symbols), @code{amsopnamsopn} (for operator names) and
1254@code{amstextamstext} (for text embedded in mathematics) are also loaded.
1255This package is part of the LaTeX required distribution; however, several
1256contributed packages add still further to its appeal; examples are
1257@code{empheqempheq}, which provides functions for decorating and highlighting
1258mathematics, and @code{ntheoremntheorem}, for specifying theorem (and similar)
1259definitions.")
1260 (license license:lppl1.3c+)))
1261
18e366e8
RW
1262(define-public texlive-latex-amscls
1263 (package
1264 (name "texlive-latex-amscls")
1265 (version (number->string %texlive-revision))
1266 (source (origin
1267 (method svn-fetch)
1268 (uri (texlive-ref "latex" "amscls"))
1269 (sha256
1270 (base32
1271 "0jmcr37mcdi7drczppvr6lmz5d5yd9m67ii79gp2nglg1xpw934j"))))
1272 (build-system texlive-build-system)
1273 (arguments
1274 `(#:tex-directory "latex/amscls"))
1275 (home-page "http://www.ctan.org/pkg/amscls")
1276 (synopsis "AMS document classes for LaTeX")
1277 (description
1278 "This bundle contains three AMS classes: @code{amsartamsart} (for writing
1279articles for the AMS), @code{amsbookamsbook} (for books) and
1280@code{amsprocamsproc} (for proceedings), together with some supporting
1281material. The material is made available as part of the AMS-LaTeX
1282distribution.")
1283 (license license:lppl1.3c+)))
1284
f84d5a09
RW
1285(define-public texlive-latex-babel
1286 (package
1287 (name "texlive-latex-babel")
1288 (version (number->string %texlive-revision))
1289 (source (origin
1290 (method svn-fetch)
1291 (uri (texlive-ref "latex" "babel"))
1292 (sha256
1293 (base32
1294 "1n3i5adsyy7jw0imnzrm2i8wkf73i3mjk9h3ic8cb9cd19i4r9r3"))))
1295 (build-system texlive-build-system)
1296 (arguments
1297 '(#:tex-directory "latex/babel"
1298 #:phases
1299 (modify-phases %standard-phases
1300 ;; This package tries to produce babel.aux twice but refuses to
1301 ;; overwrite the first one.
1302 (add-before 'build 'fix-ins
1303 (lambda _
1304 (substitute* "babel.ins"
1305 (("askonceonly") "askforoverwritefalse"))
1306 #t)))))
1307 (home-page "http://www.ctan.org/pkg/babel")
1308 (synopsis "Multilingual support for Plain TeX or LaTeX")
1309 (description
1310 "The package manages culturally-determined typographical (and other)
1311rules, and hyphenation patterns for a wide range of languages. A document may
1312select a single language to be supported, or it may select several, in which
1313case the document may switch from one language to another in a variety of
1314ways. Babel uses contributed configuration files that provide the detail of
1315what has to be done for each language. Users of XeTeX are advised to use the
1316polyglossia package rather than Babel.")
1317 (license license:lppl1.3+)))
1318
93286d38
RW
1319(define-public texlive-latex-cyrillic
1320 (package
1321 (name "texlive-latex-cyrillic")
1322 (version (number->string %texlive-revision))
1323 (source (origin
1324 (method svn-fetch)
1325 (uri (texlive-ref "latex" "cyrillic"))
1326 (sha256
1327 (base32
1328 "1mdhl35hwas68ki56qqngzar37dwv4mm64l2canihr255bz34lbv"))))
1329 (build-system texlive-build-system)
1330 (arguments
1331 '(#:tex-directory "latex/cyrillic"))
1332 (home-page "http://www.ctan.org/pkg/latex-cyrillic")
1333 (synopsis "Support for Cyrillic fonts in LaTeX")
1334 (description
1335 "This bundle of macros files provides macro support (including font
1336encoding macros) for the use of Cyrillic characters in fonts encoded under the
1337T2* and X2 encodings. These encodings cover (between them) pretty much every
1338language that is written in a Cyrillic alphabet.")
1339 (license license:lppl1.3c+)))
1340
83fe6231
RW
1341(define-public texlive-latex-psnfss
1342 (package
1343 (name "texlive-latex-psnfss")
1344 (version (number->string %texlive-revision))
1345 (source (origin
1346 (method svn-fetch)
1347 (uri (texlive-ref "latex" "psnfss"))
1348 (sha256
1349 (base32
1350 "1920dcq8613yzprasbg80fh4fcjcidvvl54wkx438nimyxcri7qz"))))
1351 (build-system texlive-build-system)
1352 (arguments '(#:tex-directory "latex/psnfss"))
1353 (home-page "http://www.ctan.org/pkg/psnfss")
1354 (synopsis "Font support for common PostScript fonts")
1355 (description
1356 "The PSNFSS collection includes a set of files that provide a complete
1357working setup of the LaTeX font selection scheme (NFSS2) for use with common
1358PostScript fonts. It covers the so-called \"Base\" fonts (which are built
1359into any Level 2 PostScript printing device and the Ghostscript interpreter)
1360and a number of free fonts. It provides font definition files, macros and
1361font metrics. The bundle as a whole is part of the LaTeX required set of
1362packages.")
1363 (license license:lppl1.2+)))
1364
cb7bc20a
RW
1365(define-public texlive-union
1366 (lambda* (#:optional (packages '()))
1367 "Return 'texlive-union' package which is a union of PACKAGES and the
1368standard LaTeX packages."
1369 (let ((default-packages
1370 (list texlive-bin
1371 texlive-dvips
1372 texlive-fonts-cm
1373 texlive-fonts-latex
1374 texlive-metafont-base
1375 texlive-latex-base
1376 ;; LaTeX packages from the "required" set.
1377 texlive-latex-amsmath
1378 texlive-latex-amscls
1379 texlive-latex-babel
1380 texlive-latex-cyrillic
1381 texlive-latex-graphics
1382 texlive-latex-psnfss
1383 texlive-latex-tools)))
1384 (package
1385 (name "texlive-union")
1386 (version (number->string %texlive-revision))
1387 (source #f)
1388 (build-system trivial-build-system)
1389 (arguments
1390 '(#:modules ((guix build union)
1391 (guix build utils)
1392 (guix build texlive-build-system)
1393 (guix build gnu-build-system)
1394 (guix build gremlin)
1395 (guix elf))
1396 #:builder
1397 (begin
1398 (use-modules (ice-9 match)
1399 (srfi srfi-26)
1400 (guix build union)
1401 (guix build utils)
1402 (guix build texlive-build-system))
1403 (let* ((out (assoc-ref %outputs "out"))
1404 (texmf.cnf (string-append out "/share/texmf-dist/web2c/texmf.cnf")))
1405 ;; Build a modifiable union of all inputs (but exclude bash)
1406 (match (filter (match-lambda
1407 ((name . _)
1408 (not (string=? "bash" name))))
1409 %build-inputs)
1410 (((names . directories) ...)
1411 (union-build (assoc-ref %outputs "out")
1412 directories
1413 #:create-all-directories? #t)))
1414
1415 ;; The configuration file "texmf.cnf" is provided by the
1416 ;; "texlive-bin" package. We take it and override only the
1417 ;; setting for TEXMFROOT and TEXMF. This file won't be consulted
1418 ;; by default, though, so we still need to set TEXMFCNF.
1419 (substitute* texmf.cnf
1420 (("^TEXMFROOT = .*")
1421 (string-append "TEXMFROOT = " out "/share\n"))
1422 (("^TEXMF = .*")
1423 "TEXMF = $TEXMFROOT/share/texmf-dist\n"))
1424 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash")
1425 "/bin"))
1426 (for-each
1427 (cut wrap-program <>
1428 `("TEXMFCNF" ":" = (,(dirname texmf.cnf)))
1429 `("TEXMF" ":" = (,(string-append out "/share/texmf-dist"))))
1430 (find-files (string-append out "/bin") ".*"))
1431 #t))))
1432 (inputs
1433 `(("bash" ,bash)
1434 ,@(map (lambda (package)
1435 (list (package-name package) package))
1436 (append default-packages packages))))
1437 (home-page (package-home-page texlive-bin))
1438 (synopsis "Union of TeX Live packages")
1439 (description "This package provides a subset of the TeX Live
1440distribution.")
1441 (license (fold (lambda (package result)
1442 (match (package-license package)
1443 ((lst ...)
1444 (append lst result))
1445 ((? license:license? license)
1446 (cons license result))))
1447 '()
1448 (append default-packages packages)))))))
1449
9d4f8dc2
RW
1450(define-public texlive-tiny
1451 (package
1452 (inherit (texlive-union))
1453 (name "texlive-tiny")
1454 (description "This is a very limited subset of the TeX Live distribution.
1455It includes little more than the required set of LaTeX packages.")))
1456
9b416042
RW
1457(define-public texlive-latex-natbib
1458 (package
1459 (name "texlive-latex-natbib")
1460 (version (number->string %texlive-revision))
1461 (source (origin
1462 (method svn-fetch)
1463 (uri (texlive-ref "latex" "natbib"))
1464 (sha256
1465 (base32
1466 "0aqliq0nwblxyrzhwhv77pnmk7qh2y3prgq7z7qhwcbgz5kisld7"))))
1467 (build-system texlive-build-system)
1468 (arguments '(#:tex-directory "latex/natbib"))
1469 (home-page "http://www.ctan.org/pkg/natbib")
1470 (synopsis "Flexible bibliography support")
1471 (description
1472 "This bundle provides a package that implements both author-year and
1473numbered references, as well as much detailed of support for other
1474bibliography use. Also provided are versions of the standard BibTeX styles
1475that are compatible with @code{natbib}: @code{plainnat}, @code{unsrtnat},
1476@code{abbrnat}. The bibliography styles produced by @code{custom-bib} are
1477designed from the start to be compatible with @code{natbib}.")
1478 (license license:lppl)))
1479
171160d5
RW
1480(define-public texlive-latex-seminar
1481 (package
1482 (name "texlive-latex-seminar")
1483 (version (number->string %texlive-revision))
1484 (source (origin
1485 (method svn-fetch)
1486 (uri (svn-reference
1487 (url (string-append "svn://www.tug.org/texlive/tags/"
1488 %texlive-tag "/Master/texmf-dist/"
1489 "/tex/latex/seminar"))
1490 (revision %texlive-revision)))
1491 (sha256
1492 (base32
1493 "0y4i651b75y6006n03x8n86bsqvjsailvvz9bhzy51dzsznqidq0"))))
1494 (build-system texlive-build-system)
1495 (arguments '(#:tex-directory "latex/seminar"))
1496 (home-page "http://www.ctan.org/pkg/seminar")
1497 (synopsis "Make overhead slides")
1498 ;; TODO: This package may need fancybox and xcomment at runtime.
1499 (description
1500 "This package provides a class that produces overhead
1501slides (transparencies), with many facilities. Seminar is not nowadays
1502reckoned a good basis for a presentation — users are advised to use more
1503recent classes such as powerdot or beamer, both of which are tuned to
150421st-century presentation styles.")
1505 (license license:lppl1.2+)))
1506
9f86ef85
RW
1507(define-public texlive-latex-hyperref
1508 (package
1509 (name "texlive-latex-hyperref")
1510 (version (number->string %texlive-revision))
1511 (source (origin
1512 (method svn-fetch)
1513 (uri (texlive-ref "latex" "hyperref"))
1514 (sha256
1515 (base32
1516 "03arf3xvz1jsbvlpgc5qxbxbl9wmk8k09cn6b8gv9pzgpjy4vx4j"))))
1517 (build-system texlive-build-system)
1518 (arguments
1519 '(#:tex-directory "latex/hyperref"
1520 #:phases
1521 (modify-phases %standard-phases
1522 (add-after 'unpack 'remove-hluatex.def
1523 (lambda _
1524 ;; This depends on hluatex.dtx, which does not exist and is
1525 ;; nowhere to be found in the sources of the TeX Live
1526 ;; distribution.
1527 (substitute* "hyperref.ins"
1528 (("\\\\file\\{hluatex.def\\}.*") ""))
1529 #t)))))
1530 ;; The package depends on the kvoptions, ltxcmds, and refcount packages,
1531 ;; which are part of the oberdiek bundle.
1532 (inputs
1533 `(("texlive-latex-oberdiek" ,texlive-latex-oberdiek)))
1534 (home-page "http://www.ctan.org/pkg/hyperref")
1535 (synopsis "Extensive support for hypertext in LaTeX")
1536 (description
1537 "The @code{hyperref} package is used to handle cross-referencing commands
1538in LaTeX to produce hypertext links in the document. The package provides
1539backends for the @code{\\special} set defined for HyperTeX DVI processors; for
1540embedded @code{pdfmark} commands for processing by Acrobat
1541Distiller (@code{dvips} and Y&Y's @code{dvipsone}); for Y&Y's @code{dviwindo};
1542for PDF control within pdfTeX and @code{dvipdfm}; for TeX4ht; and for VTeX's
1543pdf and HTML backends. The package is distributed with the @code{backref} and
1544@code{nameref} packages, which make use of the facilities of @code{hyperref}.")
1545 (license license:lppl1.3+)))
1546
8bcdc23f 1547(define texlive-texmf
0aa34e82
AE
1548 (package
1549 (name "texlive-texmf")
7a15a68f 1550 (version "2016")
0aa34e82
AE
1551 (source texlive-texmf-src)
1552 (build-system gnu-build-system)
1553 (inputs
1554 `(("texlive-bin" ,texlive-bin)
1555 ("lua" ,lua)
1556 ("perl" ,perl)
1557 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
1558 ("ruby" ,ruby)
1559 ("tcsh" ,tcsh)))
1560 (arguments
1561 `(#:modules ((guix build gnu-build-system)
1562 (guix build utils)
1563 (srfi srfi-26))
a348af40
LC
1564
1565 ;; This package takes 4 GiB, which we can't afford to distribute from
1566 ;; our servers.
1567 #:substitutable? #f
1568
0aa34e82 1569 #:phases
4a6635f3
AE
1570 (modify-phases (map (cut assq <> %standard-phases)
1571 '(set-paths unpack patch-source-shebangs))
1572 (add-after 'patch-source-shebangs 'install
1573 (lambda* (#:key outputs #:allow-other-keys)
1574 (let ((share (string-append (assoc-ref outputs "out") "/share")))
1575 (mkdir-p share)
1576 (system* "mv" "texmf-dist" share))))
1577 (add-after 'install 'texmf-config
1578 (lambda* (#:key inputs outputs #:allow-other-keys)
1579 (let* ((out (assoc-ref outputs "out"))
1580 (share (string-append out "/share"))
1581 (texmfroot (string-append share "/texmf-dist/web2c"))
1582 (texmfcnf (string-append texmfroot "/texmf.cnf"))
1583 (texlive-bin (assoc-ref inputs "texlive-bin"))
1584 (texbin (string-append texlive-bin "/bin"))
1585 (tlpkg (string-append texlive-bin "/share/tlpkg")))
1586 ;; Register SHARE as TEXMFROOT in texmf.cnf.
1587 (substitute* texmfcnf
1588 (("TEXMFROOT = \\$SELFAUTOPARENT")
2d634d9b
FB
1589 (string-append "TEXMFROOT = " share))
1590 (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
1591 "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
1592 (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
4a6635f3
AE
1593 ;; Register paths in texmfcnf.lua, needed for context.
1594 (substitute* (string-append texmfroot "/texmfcnf.lua")
1595 (("selfautodir:") out)
1596 (("selfautoparent:") (string-append share "/")))
1597 ;; Set path to TeXLive Perl modules
1598 (setenv "PERL5LIB"
1599 (string-append (getenv "PERL5LIB") ":" tlpkg))
1600 ;; Configure the texmf-dist tree; inspired from
1601 ;; http://slackbuilds.org/repository/13.37/office/texlive/
1602 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
1603 (setenv "TEXMFCNF" texmfroot)
1604 (system* "updmap-sys" "--nohash" "--syncwithtrees")
1605 (system* "mktexlsr")
1606 (system* "fmtutil-sys" "--all")))))))
7a15a68f 1607 (properties `((max-silent-time . 9600))) ; don't time out while grafting
0aa34e82 1608 (synopsis "TeX Live, a package of the TeX typesetting system")
eb0119ef
AE
1609 (description
1610 "TeX Live provides a comprehensive TeX document production system.
1611It includes all the major TeX-related programs, macro packages, and fonts
1612that are free software, including support for many languages around the
0aa34e82
AE
1613world.
1614
1615This package contains the complete tree of texmf-dist data.")
132e14b4
EF
1616 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1617 (home-page "https://www.tug.org/texlive/")))
0aa34e82
AE
1618
1619(define-public texlive
1620 (package
1621 (name "texlive")
7a15a68f 1622 (version "2016")
0aa34e82
AE
1623 (source #f)
1624 (build-system trivial-build-system)
1625 (inputs `(("bash" ,bash) ; for wrap-program
1626 ("texlive-bin" ,texlive-bin)
1627 ("texlive-texmf" ,texlive-texmf)))
2d634d9b
FB
1628 (native-search-paths
1629 (list (search-path-specification
1630 (variable "TEXMFLOCAL")
1631 (files '("share/texmf-local")))))
0aa34e82
AE
1632 (arguments
1633 `(#:modules ((guix build utils))
1634 #:builder
1635 ;; Build the union of texlive-bin and texlive-texmf, but take the
1636 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
1637 (begin
1638 (use-modules (guix build utils))
1639 (let ((out (assoc-ref %outputs "out"))
1640 (bin (assoc-ref %build-inputs "texlive-bin"))
1641 (texmf (assoc-ref %build-inputs "texlive-texmf"))
1642 (bash (assoc-ref %build-inputs "bash")))
1643 (mkdir out)
1644 (with-directory-excursion out
1645 (for-each
1646 (lambda (name)
1647 (symlink (string-append bin "/" name) name))
1648 '("include" "lib"))
1649 (mkdir "bin")
1650 (with-directory-excursion "bin"
1651 (setenv "PATH" (string-append bash "/bin"))
1652 (for-each
1653 (lambda (name)
1654 (symlink name (basename name))
1655 (wrap-program
1656 (basename name)
1657 `("TEXMFCNF" =
1658 (,(string-append texmf "/share/texmf-dist/web2c")))))
1659 (find-files (string-append bin "/bin/") "")))
1660 (mkdir "share")
1661 (with-directory-excursion "share"
1662 (for-each
1663 (lambda (name)
1664 (symlink (string-append bin "/share/" name) name))
1665 '("info" "man" "tlpkg"))
1666 (for-each
1667 (lambda (name)
1668 (symlink (string-append texmf "/share/" name) name))
1669 '("texmf-dist" "texmf-var"))))))))
1670 (synopsis "TeX Live, a package of the TeX typesetting system")
1671 (description
1672 "TeX Live provides a comprehensive TeX document production system.
1673It includes all the major TeX-related programs, macro packages, and fonts
1674that are free software, including support for many languages around the
1675world.
1676
1677This package contains the complete TeX Live distribution.")
132e14b4
EF
1678 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
1679 (home-page "https://www.tug.org/texlive/")))
231eae53 1680
6b5eb840
AE
1681
1682;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
a348af40
LC
1683;; in particular dropping documentation and fonts. It weighs in at 470 MiB
1684;; instead of 4 GiB.
6b5eb840
AE
1685(define texlive-texmf-minimal
1686 (package (inherit texlive-texmf)
1687 (name "texlive-texmf-minimal")
1688 (arguments
1689 (substitute-keyword-arguments
1690 (package-arguments texlive-texmf)
1691 ((#:modules modules)
1692 `((ice-9 ftw)
1693 (srfi srfi-1)
1694 ,@modules))
1695 ((#:phases phases)
1696 `(modify-phases ,phases
1697 (add-after 'unpack 'prune
1698 (lambda _
1699 (define (delete subdir exclude)
1700 "Delete all files and directories in SUBDIR except for those
1701given in the list EXCLUDE."
1702 (with-directory-excursion subdir
1703 (for-each delete-file-recursively
1704 (lset-difference equal?
1705 (scandir ".")
1706 (append '("." "..")
1707 exclude)))))
1708 (with-directory-excursion "texmf-dist"
1709 (for-each delete-file-recursively
1710 '("doc" "source" "tex4ht"))
1711 ;; Delete all subdirectories of "fonts", except for "tfm" and
1712 ;; any directories named "cm".
1713 (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
1714 (delete "fonts/afm" '("public"))
1715 (delete "fonts/afm/public" '("amsfonts"))
1716 (delete "fonts/afm/public/amsfonts" '("cm"))
1717 (delete "fonts/map" '("dvips"))
1718 (delete "fonts/map/dvips" '("cm"))
1719 (delete "fonts/source" '("public"))
1720 (delete "fonts/source/public" '("cm"))
1721 (delete "fonts/tfm" '("public"))
1722 (delete "fonts/type1" '("public"))
1723 (delete "fonts/type1/public" '("amsfonts"))
1724 (delete "fonts/type1/public/amsfonts" '("cm")))
1725 #t))))))
1726 (description
1727 "TeX Live provides a comprehensive TeX document production system.
1728It includes all the major TeX-related programs, macro packages, and fonts
1729that are free software, including support for many languages around the
1730world.
1731
1732This package contains a small subset of the texmf-dist data.")))
1733
1734
1735;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal
1736;; instead of the full texlive-texmf. It can be used, for instance, as a
1737;; native input to packages that need texlive to build their documentation.
1738(define-public texlive-minimal
1739 (package (inherit texlive)
1740 (name "texlive-minimal")
1741 (inputs
1742 `(("texlive-texmf" ,texlive-texmf-minimal)
1743 ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
2d634d9b
FB
1744 (native-search-paths
1745 (list (search-path-specification
1746 (variable "TEXMFLOCAL")
1747 (files '("share/texmf-local")))))
6b5eb840
AE
1748 (description
1749 "TeX Live provides a comprehensive TeX document production system.
1750It includes all the major TeX-related programs, macro packages, and fonts
1751that are free software, including support for many languages around the
1752world.
1753
1754This package contains a small working part of the TeX Live distribution.")))
1755
ebcf74da
RW
1756(define-public perl-text-bibtex
1757 (package
1758 (name "perl-text-bibtex")
1759 (version "0.77")
1760 (source
1761 (origin
1762 (method url-fetch)
1763 (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
1764 version ".tar.gz"))
1765 (sha256
1766 (base32
1767 "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4"))))
1768 (build-system perl-build-system)
1769 (arguments
1770 `(#:phases
1771 (modify-phases %standard-phases
1772 (add-after 'unpack 'add-output-directory-to-rpath
1773 (lambda* (#:key outputs #:allow-other-keys)
1774 (substitute* "inc/MyBuilder.pm"
1775 (("-Lbtparse" line)
1776 (string-append "-Wl,-rpath="
1777 (assoc-ref outputs "out") "/lib " line)))
1778 #t))
1779 (add-after 'unpack 'install-libraries-to-/lib
1780 (lambda* (#:key outputs #:allow-other-keys)
1781 (substitute* "Build.PL"
1782 (("lib64") "lib"))
1783 #t)))))
1784 (native-inputs
1785 `(("perl-capture-tiny" ,perl-capture-tiny)
1786 ("perl-config-autoconf" ,perl-config-autoconf)
1787 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1788 ("perl-module-build" ,perl-module-build)))
1789 (home-page "http://search.cpan.org/dist/Text-BibTeX")
1790 (synopsis "Interface to read and parse BibTeX files")
1791 (description "@code{Text::BibTeX} is a Perl library for reading, parsing,
1792and processing BibTeX files. @code{Text::BibTeX} gives you access to the data
1793at many different levels: you may work with BibTeX entries as simple field to
1794string mappings, or get at the original form of the data as a list of simple
1795values (strings, macros, or numbers) pasted together.")
2f3108ad 1796 (license license:perl-license)))
ebcf74da 1797
d4000680
RW
1798(define-public biber
1799 (package
1800 (name "biber-next")
1801 (version "2.6")
1802 (source (origin
1803 (method url-fetch)
1804 (uri (string-append "https://github.com/plk/biber/archive/v"
1805 version ".tar.gz"))
1806 (file-name (string-append name "-" version ".tar.gz"))
1807 (sha256
1808 (base32
1809 "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp"))))
1810 (build-system perl-build-system)
1811 (arguments
1812 `(#:phases
1813 (modify-phases %standard-phases
1814 (add-after 'install 'wrap-programs
1815 (lambda* (#:key outputs #:allow-other-keys)
1816 (let* ((out (assoc-ref outputs "out"))
1817 (perl5lib (getenv "PERL5LIB")))
1818 (wrap-program (string-append out "/bin/biber")
1819 `("PERL5LIB" ":" prefix
1820 (,(string-append perl5lib ":" out
1821 "/lib/perl5/site_perl")))))
1822 #t)))))
1823 (inputs
1824 `(("perl-autovivification" ,perl-autovivification)
1825 ("perl-class-accessor" ,perl-class-accessor)
1826 ("perl-data-dump" ,perl-data-dump)
1827 ("perl-data-compare" ,perl-data-compare)
1828 ("perl-data-uniqid" ,perl-data-uniqid)
1829 ("perl-datetime-format-builder" ,perl-datetime-format-builder)
1830 ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian)
1831 ("perl-file-slurp" ,perl-file-slurp)
1832 ("perl-ipc-cmd" ,perl-ipc-cmd)
1833 ("perl-ipc-run3" ,perl-ipc-run3)
1834 ("perl-list-allutils" ,perl-list-allutils)
1835 ("perl-list-moreutils" ,perl-list-moreutils)
1836 ("perl-mozilla-ca" ,perl-mozilla-ca)
1837 ("perl-regexp-common" ,perl-regexp-common)
1838 ("perl-log-log4perl" ,perl-log-log4perl)
1839 ;; We cannot use perl-unicode-collate here, because otherwise the
1840 ;; hardcoded hashes in the tests would differ. See
1841 ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html
1842 ;;("perl-unicode-collate" ,perl-unicode-collate)
1843 ("perl-unicode-normalize" ,perl-unicode-normalize)
1844 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
1845 ("perl-encode-eucjpascii" ,perl-encode-eucjpascii)
1846 ("perl-encode-jis2k" ,perl-encode-jis2k)
1847 ("perl-encode-hanextra" ,perl-encode-hanextra)
1848 ("perl-xml-libxml" ,perl-xml-libxml)
1849 ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)
1850 ("perl-xml-libxslt" ,perl-xml-libxslt)
1851 ("perl-xml-writer" ,perl-xml-writer)
1852 ("perl-sort-key" ,perl-sort-key)
1853 ("perl-text-csv" ,perl-text-csv)
1854 ("perl-text-csv-xs" ,perl-text-csv-xs)
1855 ("perl-text-roman" ,perl-text-roman)
1856 ("perl-uri" ,perl-uri)
1857 ("perl-text-bibtex" ,perl-text-bibtex)
1858 ("perl-libwww" ,perl-libwww)
1859 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
1860 ("perl-business-isbn" ,perl-business-isbn)
1861 ("perl-business-issn" ,perl-business-issn)
1862 ("perl-business-ismn" ,perl-business-ismn)
1863 ("perl-lingua-translit" ,perl-lingua-translit)))
1864 (native-inputs
1865 `(("perl-config-autoconf" ,perl-config-autoconf)
1866 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1867 ("perl-module-build" ,perl-module-build)
1868 ;; for tests
1869 ("perl-file-which" ,perl-file-which)
1870 ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient
1871 ("perl-test-differences" ,perl-test-differences)))
1872 (home-page "http://biblatex-biber.sourceforge.net/")
1873 (synopsis "Backend for the BibLaTeX citation management tool")
1874 (description "Biber is a BibTeX replacement for users of biblatex. Among
1875other things it comes with full Unicode support.")
1876 (license license:artistic2.0)))
1877
253cdd6c
RW
1878;; Our version of texlive comes with biblatex 3.4, which is only compatible
1879;; with biber 2.5 according to the compatibility matrix in the biber
1880;; documentation.
1881(define-public biber-2.5
1882 (package (inherit biber)
1883 (name "biber")
1884 (version "2.5")
1885 (source (origin
1886 (method url-fetch)
1887 (uri (string-append "https://github.com/plk/biber/archive/v"
1888 version ".tar.gz"))
1889 (file-name (string-append name "-" version ".tar.gz"))
1890 (sha256
1891 (base32
1892 "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv"))))
1893 (arguments
1894 (substitute-keyword-arguments (package-arguments biber)
1895 ((#:phases phases)
1896 `(modify-phases ,phases
1897 (add-before 'check 'delete-failing-test
1898 (lambda _
1899 (delete-file "t/sort-order.t")
1900 #t))))))
1901 (inputs
1902 `(("perl-date-simple" ,perl-date-simple)
1903 ,@(package-inputs biber)))))
6b5eb840 1904
231eae53
LC
1905(define-public rubber
1906 (package
1907 (name "rubber")
1908 (version "1.1")
1909 (source (origin
1910 (method url-fetch)
1911 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
1912 version "/+download/rubber-"
1913 version ".tar.gz")
1914 (string-append "http://ebeffara.free.fr/pub/rubber-"
1915 version ".tar.gz")))
1916 (sha256
1917 (base32
1918 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
1919 (build-system gnu-build-system)
1920 (arguments '(#:tests? #f)) ; no `check' target
1921 (inputs `(("texinfo" ,texinfo)
9bee5d6c 1922 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
231eae53
LC
1923 ("which" ,which)))
1924 (home-page "https://launchpad.net/rubber")
35b9e423 1925 (synopsis "Wrapper for LaTeX and friends")
231eae53
LC
1926 (description
1927 "Rubber is a program whose purpose is to handle all tasks related to the
1928compilation of LaTeX documents. This includes compiling the document itself,
1929of course, enough times so that all references are defined, and running BibTeX
1930to manage bibliographic references. Automatic execution of dvips to produce
1931PostScript documents is also included, as well as usage of pdfLaTeX to produce
1932PDF documents.")
1933 (license license:gpl2+)))
4791876c
RJ
1934
1935(define-public texmaker
1936 (package
1937 (name "texmaker")
1938 (version "4.5")
1939 (source (origin
1940 (method url-fetch)
1941 (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
1942 version ".tar.bz2"))
1943 (sha256
1944 (base32
1945 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
1946 (build-system gnu-build-system)
1947 (arguments
1948 `(#:phases
1949 (modify-phases %standard-phases
1950 ;; Qt has its own configuration utility.
1951 (replace 'configure
1952 (lambda* (#:key outputs #:allow-other-keys)
1953 (let ((out (assoc-ref outputs "out")))
1954 (zero? (system* "qmake"
1955 (string-append "PREFIX=" out)
1956 (string-append "DESKTOPDIR=" out
1957 "/share/applications")
1958 (string-append "ICONDIR=" out "/share/pixmaps")
1959 "texmaker.pro"))))))))
1960 (inputs
1961 `(("poppler-qt5" ,poppler-qt5)
bd917486
TD
1962 ("qtbase" ,qtbase)
1963 ("qtscript" ,qtscript)
1964 ("qtwebkit" ,qtwebkit)
4791876c
RJ
1965 ("zlib" ,zlib)))
1966 (native-inputs
1967 `(("pkg-config" ,pkg-config)))
1968 (home-page "http://www.xm1math.net/texmaker/")
1969 (synopsis "LaTeX editor")
1970 (description "Texmaker is a program that integrates many tools needed to
1971develop documents with LaTeX, in a single application.")
1972 (license license:gpl2+)))
83457fe0
JD
1973
1974
1975(define-public teximpatient
1976 (package
1977 (name "teximpatient")
1978 (version "2.4")
1979 (source (origin
1980 (method url-fetch)
1981 (uri (string-append "mirror://gnu/" name "/" name "-"
1982 version ".tar.gz"))
1983 (sha256
1984 (base32
1985 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
1986 (build-system gnu-build-system)
1987 (arguments
1988 `(#:phases
1989 (modify-phases %standard-phases
1990 (delete 'check)
1991 ;; Unfortunately some mistakes have been made in packaging.
1992 ;; Work around them here ...
1993 (replace 'unpack
1994 (lambda* (#:key inputs outputs #:allow-other-keys)
1995 (let ((srcdir "teximpatient-2.4"))
1996 (system* "tar" "-xzf" (assoc-ref inputs "source")
1997 (string-append "--one-top-level=" srcdir))
1998 (delete-file (string-append srcdir "/book.pdf"))
1999 (install-file (car
2000 (find-files
2001 (assoc-ref inputs "automake")
2002 "^install-sh$"))
2003 srcdir)
2004 (chdir srcdir)))))))
2005 (native-inputs
2006 `(("texlive" ,texlive)
2007 ("automake" ,automake)))
6fd52309 2008 (home-page "https://www.gnu.org/software/teximpatient/")
83457fe0
JD
2009 (synopsis "Book on TeX, plain TeX and Eplain")
2010 (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
2011plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
2012and Karl Berry.")
2013 (license license:fdl1.3+)))