gnu: Add texlive-fonts-cm.
[jackhill/guix/guix.git] / gnu / packages / tex.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
8 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
9 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
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
26 (define-module (gnu packages tex)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system perl)
32 #:use-module (guix build-system trivial)
33 #:use-module (guix utils)
34 #:use-module (guix git-download)
35 #:use-module (guix svn-download)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages fontutils)
41 #:use-module (gnu packages gd)
42 #:use-module (gnu packages ghostscript)
43 #:use-module (gnu packages gtk)
44 #:use-module (gnu packages icu4c)
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages lua)
47 #:use-module (gnu packages multiprecision)
48 #:use-module (gnu packages pdf)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages qt)
53 #:use-module (gnu packages ruby)
54 #:use-module (gnu packages shells)
55 #:use-module (gnu packages base)
56 #:use-module (gnu packages web)
57 #:use-module (gnu packages xml)
58 #:use-module (gnu packages xorg)
59 #:use-module (gnu packages xdisorg)
60 #:use-module (gnu packages zip)
61 #:autoload (gnu packages texinfo) (texinfo)
62 #:use-module (ice-9 ftw)
63 #:use-module (srfi srfi-1))
64
65 (define texlive-extra-src
66 (origin
67 (method url-fetch)
68 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523-extra.tar.xz")
69 (sha256 (base32
70 "0q4a92zmwhn4ry6xgrp4k8wq11ax2sg9rg9yrsrdkr719y0x887a"))))
71
72 (define texlive-texmf-src
73 (origin
74 (method url-fetch)
75 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-texmf.tar.xz")
76 (patches (search-patches "texlive-texmf-CVE-2016-10243.patch"))
77 (patch-flags '("-p2"))
78 (sha256 (base32
79 "1dv8vgfzpczqw82hv9g7a8djhhyzywljmrarlcyy6g2qi5q51glr"))))
80
81 (define texlive-bin
82 (package
83 (name "texlive-bin")
84 (version "2016")
85 (source
86 (origin
87 (method url-fetch)
88 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-source.tar.xz")
89 (sha256 (base32
90 "1v91vahxlxkdra0qz3f132vvx5d9cx2jy84yl1hkch0agyj2rcx8"))))
91 (build-system gnu-build-system)
92 (inputs
93 `(("texlive-extra-src" ,texlive-extra-src)
94 ("cairo" ,cairo)
95 ("fontconfig" ,fontconfig)
96 ("fontforge" ,fontforge)
97 ("freetype" ,freetype)
98 ("gd" ,gd)
99 ("gmp" ,gmp)
100 ("ghostscript" ,ghostscript)
101 ("graphite2" ,graphite2)
102 ("harfbuzz" ,harfbuzz)
103 ("icu4c" ,icu4c)
104 ("libpaper" ,libpaper)
105 ("libpng" ,libpng)
106 ("libxaw" ,libxaw)
107 ("libxt" ,libxt)
108 ("mpfr" ,mpfr)
109 ("perl" ,perl)
110 ("pixman" ,pixman)
111 ("poppler" ,poppler)
112 ("potrace" ,potrace)
113 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
114 ("ruby" ,ruby)
115 ("tcsh" ,tcsh)
116 ("teckit" ,teckit)
117 ("zlib" ,zlib)
118 ("zziplib" ,zziplib)))
119 (native-inputs
120 `(("pkg-config" ,pkg-config)))
121 (arguments
122 `(#:out-of-source? #t
123 #:configure-flags
124 `("--disable-native-texlive-build"
125 "--with-system-cairo"
126 "--with-system-freetype2"
127 "--with-system-gd"
128 "--with-system-gmp"
129 "--with-system-graphite2"
130 "--with-system-harfbuzz"
131 "--with-system-icu"
132 "--with-system-libgs"
133 "--with-system-libpaper"
134 "--with-system-libpng"
135 "--with-system-mpfr"
136 "--with-system-pixman"
137 "--with-system-poppler"
138 "--with-system-potrace"
139 "--with-system-teckit"
140 "--with-system-xpdf"
141 "--with-system-zlib"
142 "--with-system-zziplib")
143
144 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
145 ;; XXX FIXME fix luajit properly on mips64.
146 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
147 (%current-system))))
148 #:phases
149 (modify-phases %standard-phases
150 (add-after 'install 'postint
151 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
152 (let* ((out (assoc-ref outputs "out"))
153 (share (string-append out "/share"))
154 (texlive-extra (assoc-ref inputs "texlive-extra-src"))
155 (unpack (assoc-ref %standard-phases 'unpack))
156 (patch-source-shebangs
157 (assoc-ref %standard-phases 'patch-source-shebangs)))
158 ;; Create symbolic links for the latex variants and their
159 ;; man pages.
160 (with-directory-excursion (string-append out "/bin/")
161 (for-each symlink
162 '("pdftex" "pdftex" "xetex" "luatex")
163 '("latex" "pdflatex" "xelatex" "lualatex")))
164 (with-directory-excursion (string-append share "/man/man1/")
165 (symlink "luatex.1" "lualatex.1"))
166 ;; Unpack texlive-extra and install tlpkg.
167 (mkdir "texlive-extra")
168 (with-directory-excursion "texlive-extra"
169 (apply unpack (list #:source texlive-extra))
170 (apply patch-source-shebangs (list #:source texlive-extra))
171 (system* "mv" "tlpkg" share))))))))
172 (synopsis "TeX Live, a package of the TeX typesetting system")
173 (description
174 "TeX Live provides a comprehensive TeX document production system.
175 It includes all the major TeX-related programs, macro packages, and fonts
176 that are free software, including support for many languages around the
177 world.
178
179 This package contains the binaries.")
180 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
181 (home-page "https://www.tug.org/texlive/")))
182
183 ;; These variables specify the SVN tag and the matching SVN revision.
184 (define %texlive-tag "texlive-2017.0")
185 (define %texlive-revision 44445)
186
187 (define-public texlive-dvips
188 (package
189 (name "texlive-dvips")
190 (version (number->string %texlive-revision))
191 (source (origin
192 (method svn-fetch)
193 (uri (svn-reference
194 (url (string-append "svn://www.tug.org/texlive/tags/"
195 %texlive-tag "/Master/texmf-dist/"
196 "/dvips"))
197 (revision %texlive-revision)))
198 (sha256
199 (base32
200 "1k11yvz4q95bxyxczwvd4r177h6a2gg03xmf51kmgjgz8an2gq2w"))))
201 (build-system trivial-build-system)
202 (arguments
203 `(#:modules ((guix build utils))
204 #:builder
205 (begin
206 (use-modules (guix build utils))
207 (let ((target (string-append (assoc-ref %outputs "out")
208 "/share/texmf-dist/dvips")))
209 (mkdir-p target)
210 (copy-recursively (assoc-ref %build-inputs "source") target)
211 #t))))
212 (home-page "http://www.ctan.org/pkg/dvips")
213 (synopsis "DVI to PostScript drivers")
214 (description "This package provides files needed for converting DVI files
215 to PostScript.")
216 ;; Various free software licenses apply to individual files.
217 (license (list license:lppl1.3c+
218 license:expat
219 license:lgpl3+))))
220
221 (define-public texlive-generic-unicode-data
222 (package
223 (name "texlive-generic-unicode-data")
224 (version (number->string %texlive-revision))
225 (source (origin
226 (method svn-fetch)
227 (uri (svn-reference
228 (url (string-append "svn://www.tug.org/texlive/tags/"
229 %texlive-tag "/Master/texmf-dist/"
230 "/tex/generic/unicode-data"))
231 (revision %texlive-revision)))
232 (sha256
233 (base32
234 "0ivrhp6jz31pl4z841g4ws41lmvdiwz4sslmhf02inlib79gz6r2"))))
235 (build-system trivial-build-system)
236 (arguments
237 `(#:modules ((guix build utils))
238 #:builder
239 (begin
240 (use-modules (guix build utils))
241 (let ((target (string-append (assoc-ref %outputs "out")
242 "/share/texmf-dist/tex/generic/unicode-data")))
243 (mkdir-p target)
244 (copy-recursively (assoc-ref %build-inputs "source") target)
245 #t))))
246 (home-page "http://www.ctan.org/pkg/unicode-data")
247 (synopsis "Unicode data and loaders for TeX")
248 (description "This bundle provides generic access to Unicode Consortium
249 data for TeX use. It contains a set of text files provided by the Unicode
250 Consortium which are currently all from Unicode 8.0.0, with the exception of
251 @code{MathClass.txt} which is not currently part of the Unicode Character
252 Database. Accompanying these source data are generic TeX loader files
253 allowing this data to be used as part of TeX runs, in particular in building
254 format files. Currently there are two loader files: one for general character
255 set up and one for initializing XeTeX character classes as has been carried
256 out to date by @code{unicode-letters.tex}. ")
257 (license license:lppl1.3c+)))
258
259 (define-public texlive-generic-dehyph-exptl
260 (package
261 (name "texlive-generic-dehyph-exptl")
262 (version (number->string %texlive-revision))
263 (source (origin
264 (method svn-fetch)
265 (uri (svn-reference
266 (url (string-append "svn://www.tug.org/texlive/tags/"
267 %texlive-tag "/Master/texmf-dist/"
268 "/tex/generic/dehyph-exptl"))
269 (revision %texlive-revision)))
270 (sha256
271 (base32
272 "1l9wgv99qq0ysvlxqpj4g8bl0dywbzra4g8m2kmpg2fb0i0hczap"))))
273 (build-system trivial-build-system)
274 (arguments
275 `(#:modules ((guix build utils))
276 #:builder
277 (begin
278 (use-modules (guix build utils))
279 (let ((target (string-append (assoc-ref %outputs "out")
280 "/share/texmf-dist/tex/generic/dehyph-exptl")))
281 (mkdir-p target)
282 (copy-recursively (assoc-ref %build-inputs "source") target)
283 #t))))
284 (home-page "http://projekte.dante.de/Trennmuster/WebHome")
285 (synopsis "Hyphenation patterns for German")
286 (description "The package provides experimental hyphenation patterns for
287 the German language, covering both traditional and reformed orthography. The
288 patterns can be used with packages Babel and hyphsubst from the Oberdiek
289 bundle.")
290 ;; Hyphenation patterns are under the Expat license; documentation is
291 ;; under LPPL.
292 (license (list license:expat license:lppl))))
293
294 (define-public texlive-generic-tex-ini-files
295 (package
296 (name "texlive-generic-tex-ini-files")
297 (version (number->string %texlive-revision))
298 (source (origin
299 (method svn-fetch)
300 (uri (svn-reference
301 (url (string-append "svn://www.tug.org/texlive/tags/"
302 %texlive-tag "/Master/texmf-dist/"
303 "/tex/generic/tex-ini-files"))
304 (revision %texlive-revision)))
305 (sha256
306 (base32
307 "1wh42n1lmzcvi3g6mm31nm3yd5ha5bl260xqc444jg1m9fdp3wz5"))))
308 (build-system trivial-build-system)
309 (arguments
310 `(#:modules ((guix build utils))
311 #:builder
312 (begin
313 (use-modules (guix build utils))
314 (let ((target (string-append (assoc-ref %outputs "out")
315 "/share/texmf-dist/tex/generic/tex-ini-files")))
316 (mkdir-p target)
317 (copy-recursively (assoc-ref %build-inputs "source") target)
318 #t))))
319 (home-page "http://ctan.org/pkg/tex-ini-files")
320 (synopsis "Files for creating TeX formats")
321 (description "This bundle provides a collection of model \".ini\" files
322 for creating TeX formats. These files are commonly used to introduced
323 distribution-dependent variations in formats. They are also used to
324 allow existing format source files to be used with newer engines, for example
325 to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
326 (license license:public-domain)))
327
328 (define-public texlive-generic-hyph-utf8
329 (package
330 (name "texlive-generic-hyph-utf8")
331 (version (number->string %texlive-revision))
332 (source (origin
333 (method svn-fetch)
334 (uri (svn-reference
335 (url (string-append "svn://www.tug.org/texlive/tags/"
336 %texlive-tag "/Master/texmf-dist/"
337 "/tex/generic/hyph-utf8"))
338 (revision %texlive-revision)))
339 (sha256
340 (base32
341 "0ghizcz7ps16dzfqf66wwg5i181assc6qsm0g7g5dbmp909931vi"))))
342 (build-system trivial-build-system)
343 (arguments
344 `(#:modules ((guix build utils))
345 #:builder
346 (begin
347 (use-modules (guix build utils))
348 (let ((target (string-append (assoc-ref %outputs "out")
349 "/share/texmf-dist/tex/generic/hyph-utf8")))
350 (mkdir-p target)
351 (copy-recursively (assoc-ref %build-inputs "source") target)
352 #t))))
353 (home-page "http://ctan.org/pkg/hyph-utf8")
354 (synopsis "Hyphenation patterns expressed in UTF-8")
355 (description "Modern native UTF-8 engines such as XeTeX and LuaTeX need
356 hyphenation patterns in UTF-8 format, whereas older systems require
357 hyphenation patterns in the 8-bit encoding of the font in use (such encodings
358 are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
359 etc). The present package offers a collection of conversions of existing
360 patterns to UTF-8 format, together with converters for use with 8-bit fonts in
361 older systems. Since hyphenation patterns for Knuthian-style TeX systems are
362 only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
363 converters, will completely supplant the older patterns.")
364 ;; Individual files each have their own license. Most of these files are
365 ;; independent hyphenation patterns.
366 (license (list license:lppl1.0+
367 license:lppl1.2+
368 license:lppl1.3
369 license:lppl1.3+
370 license:lppl1.3a+
371 license:lgpl2.1
372 license:lgpl2.1+
373 license:lgpl3+
374 license:gpl2+
375 license:gpl3+
376 license:mpl1.1
377 license:asl2.0
378 license:expat
379 license:bsd-3
380 license:cc0
381 license:public-domain
382 license:wtfpl2))))
383
384 (define-public texlive-metafont-base
385 (package
386 (name "texlive-metafont-base")
387 (version (number->string %texlive-revision))
388 (source (origin
389 (method svn-fetch)
390 (uri (svn-reference
391 (url (string-append "svn://www.tug.org/texlive/tags/"
392 %texlive-tag "/Master/texmf-dist/"
393 "/metafont"))
394 (revision %texlive-revision)))
395 (sha256
396 (base32
397 "1yl4n8cn5xqk2nc22zgzq6ymd7bhm6xx1mz3azip7i3ki4bhb5q5"))))
398 (build-system gnu-build-system)
399 (arguments
400 `(#:tests? #f ; no test target
401 #:phases
402 (modify-phases %standard-phases
403 (delete 'configure)
404 (replace 'build
405 (lambda* (#:key inputs #:allow-other-keys)
406 (let ((cwd (getcwd)))
407 (setenv "MFINPUTS"
408 (string-append cwd "/base:"
409 cwd "/misc:"
410 cwd "/roex:"
411 cwd "/feynmf:"
412 cwd "/mfpic:"
413 cwd "/config")))
414 (mkdir "build")
415 (with-directory-excursion "build"
416 (zero? (system* "inimf" "mf.mf")))))
417 (replace 'install
418 (lambda* (#:key outputs #:allow-other-keys)
419 (let* ((out (assoc-ref outputs "out"))
420 (base (string-append out "/share/texmf-dist/web2c"))
421 (mf (string-append out "/share/texmf-dist/metafont/base")))
422 (mkdir-p base)
423 (mkdir-p mf)
424 (install-file "build/mf.base" base)
425 (copy-recursively "base" mf)
426 #t))))))
427 (native-inputs
428 `(("texlive-bin" ,texlive-bin)))
429 (home-page "http://www.ctan.org/pkg/metafont")
430 (synopsis "Metafont base files")
431 (description "This package provides the Metafont base files needed to
432 build fonts using the Metafont system.")
433 (license license:knuth)))
434
435 (define-public texlive-fonts-cm
436 (package
437 (name "texlive-fonts-cm")
438 (version (number->string %texlive-revision))
439 (source (origin
440 (method svn-fetch)
441 (uri (svn-reference
442 (url (string-append "svn://www.tug.org/texlive/tags/"
443 %texlive-tag "/Master/texmf-dist/"
444 "/fonts/source/public/cm"))
445 (revision %texlive-revision)))
446 (sha256
447 (base32
448 "045k5b9rdmbxpy1a3006l1x96z1rd18vg3cwrvnld9bqybw5qz44"))))
449 (build-system gnu-build-system)
450 (arguments
451 `(#:modules ((guix build gnu-build-system)
452 (guix build utils)
453 (srfi srfi-1)
454 (srfi srfi-26))
455 #:tests? #f ; no tests
456 #:phases
457 (modify-phases %standard-phases
458 (delete 'configure)
459 (replace 'build
460 (lambda* (#:key inputs #:allow-other-keys)
461 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
462 ;; Tell mf where to find mf.base
463 (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
464 ;; Tell mf where to look for source files
465 (setenv "MFINPUTS"
466 (string-append (getcwd) ":"
467 mf "/share/texmf-dist/metafont/base")))
468 (mkdir "build")
469 (every (lambda (font)
470 (format #t "building font ~a\n" font)
471 (zero? (system* "mf" "-progname=mf"
472 "-output-directory=build"
473 (string-append "\\"
474 "mode:=ljfour; "
475 "mag:=1; "
476 "batchmode; "
477 "input "
478 (basename font ".mf")))))
479 (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))))
480 (replace 'install
481 (lambda* (#:key outputs #:allow-other-keys)
482 (let* ((out (assoc-ref outputs "out"))
483 (tfm (string-append
484 out "/share/texmf-dist/fonts/tfm/public/cm"))
485 (mf (string-append
486 out "/share/texmf-dist/fonts/source/public/cm")))
487 (for-each (cut install-file <> tfm)
488 (find-files "build" "\\.*"))
489 (for-each (cut install-file <> mf)
490 (find-files "." "\\.mf"))
491 #t))))))
492 (native-inputs
493 `(("texlive-bin" ,texlive-bin)
494 ("texlive-metafont-base" ,texlive-metafont-base)))
495 (home-page "http://www.ctan.org/pkg/cm")
496 (synopsis "Computer Modern fonts for TeX")
497 (description "This package provides the Computer Modern fonts by Donald
498 Knuth. The Computer Modern font family is a large collection of text,
499 display, and mathematical fonts in a range of styles, based on Monotype Modern
500 8A.")
501 (license license:knuth)))
502
503 (define texlive-texmf
504 (package
505 (name "texlive-texmf")
506 (version "2016")
507 (source texlive-texmf-src)
508 (build-system gnu-build-system)
509 (inputs
510 `(("texlive-bin" ,texlive-bin)
511 ("lua" ,lua)
512 ("perl" ,perl)
513 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
514 ("ruby" ,ruby)
515 ("tcsh" ,tcsh)))
516 (arguments
517 `(#:modules ((guix build gnu-build-system)
518 (guix build utils)
519 (srfi srfi-26))
520
521 ;; This package takes 4 GiB, which we can't afford to distribute from
522 ;; our servers.
523 #:substitutable? #f
524
525 #:phases
526 (modify-phases (map (cut assq <> %standard-phases)
527 '(set-paths unpack patch-source-shebangs))
528 (add-after 'patch-source-shebangs 'install
529 (lambda* (#:key outputs #:allow-other-keys)
530 (let ((share (string-append (assoc-ref outputs "out") "/share")))
531 (mkdir-p share)
532 (system* "mv" "texmf-dist" share))))
533 (add-after 'install 'texmf-config
534 (lambda* (#:key inputs outputs #:allow-other-keys)
535 (let* ((out (assoc-ref outputs "out"))
536 (share (string-append out "/share"))
537 (texmfroot (string-append share "/texmf-dist/web2c"))
538 (texmfcnf (string-append texmfroot "/texmf.cnf"))
539 (texlive-bin (assoc-ref inputs "texlive-bin"))
540 (texbin (string-append texlive-bin "/bin"))
541 (tlpkg (string-append texlive-bin "/share/tlpkg")))
542 ;; Register SHARE as TEXMFROOT in texmf.cnf.
543 (substitute* texmfcnf
544 (("TEXMFROOT = \\$SELFAUTOPARENT")
545 (string-append "TEXMFROOT = " share))
546 (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
547 "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
548 (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
549 ;; Register paths in texmfcnf.lua, needed for context.
550 (substitute* (string-append texmfroot "/texmfcnf.lua")
551 (("selfautodir:") out)
552 (("selfautoparent:") (string-append share "/")))
553 ;; Set path to TeXLive Perl modules
554 (setenv "PERL5LIB"
555 (string-append (getenv "PERL5LIB") ":" tlpkg))
556 ;; Configure the texmf-dist tree; inspired from
557 ;; http://slackbuilds.org/repository/13.37/office/texlive/
558 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
559 (setenv "TEXMFCNF" texmfroot)
560 (system* "updmap-sys" "--nohash" "--syncwithtrees")
561 (system* "mktexlsr")
562 (system* "fmtutil-sys" "--all")))))))
563 (properties `((max-silent-time . 9600))) ; don't time out while grafting
564 (synopsis "TeX Live, a package of the TeX typesetting system")
565 (description
566 "TeX Live provides a comprehensive TeX document production system.
567 It includes all the major TeX-related programs, macro packages, and fonts
568 that are free software, including support for many languages around the
569 world.
570
571 This package contains the complete tree of texmf-dist data.")
572 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
573 (home-page "https://www.tug.org/texlive/")))
574
575 (define-public texlive
576 (package
577 (name "texlive")
578 (version "2016")
579 (source #f)
580 (build-system trivial-build-system)
581 (inputs `(("bash" ,bash) ; for wrap-program
582 ("texlive-bin" ,texlive-bin)
583 ("texlive-texmf" ,texlive-texmf)))
584 (native-search-paths
585 (list (search-path-specification
586 (variable "TEXMFLOCAL")
587 (files '("share/texmf-local")))))
588 (arguments
589 `(#:modules ((guix build utils))
590 #:builder
591 ;; Build the union of texlive-bin and texlive-texmf, but take the
592 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
593 (begin
594 (use-modules (guix build utils))
595 (let ((out (assoc-ref %outputs "out"))
596 (bin (assoc-ref %build-inputs "texlive-bin"))
597 (texmf (assoc-ref %build-inputs "texlive-texmf"))
598 (bash (assoc-ref %build-inputs "bash")))
599 (mkdir out)
600 (with-directory-excursion out
601 (for-each
602 (lambda (name)
603 (symlink (string-append bin "/" name) name))
604 '("include" "lib"))
605 (mkdir "bin")
606 (with-directory-excursion "bin"
607 (setenv "PATH" (string-append bash "/bin"))
608 (for-each
609 (lambda (name)
610 (symlink name (basename name))
611 (wrap-program
612 (basename name)
613 `("TEXMFCNF" =
614 (,(string-append texmf "/share/texmf-dist/web2c")))))
615 (find-files (string-append bin "/bin/") "")))
616 (mkdir "share")
617 (with-directory-excursion "share"
618 (for-each
619 (lambda (name)
620 (symlink (string-append bin "/share/" name) name))
621 '("info" "man" "tlpkg"))
622 (for-each
623 (lambda (name)
624 (symlink (string-append texmf "/share/" name) name))
625 '("texmf-dist" "texmf-var"))))))))
626 (synopsis "TeX Live, a package of the TeX typesetting system")
627 (description
628 "TeX Live provides a comprehensive TeX document production system.
629 It includes all the major TeX-related programs, macro packages, and fonts
630 that are free software, including support for many languages around the
631 world.
632
633 This package contains the complete TeX Live distribution.")
634 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
635 (home-page "https://www.tug.org/texlive/")))
636
637
638 ;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
639 ;; in particular dropping documentation and fonts. It weighs in at 470 MiB
640 ;; instead of 4 GiB.
641 (define texlive-texmf-minimal
642 (package (inherit texlive-texmf)
643 (name "texlive-texmf-minimal")
644 (arguments
645 (substitute-keyword-arguments
646 (package-arguments texlive-texmf)
647 ((#:modules modules)
648 `((ice-9 ftw)
649 (srfi srfi-1)
650 ,@modules))
651 ((#:phases phases)
652 `(modify-phases ,phases
653 (add-after 'unpack 'prune
654 (lambda _
655 (define (delete subdir exclude)
656 "Delete all files and directories in SUBDIR except for those
657 given in the list EXCLUDE."
658 (with-directory-excursion subdir
659 (for-each delete-file-recursively
660 (lset-difference equal?
661 (scandir ".")
662 (append '("." "..")
663 exclude)))))
664 (with-directory-excursion "texmf-dist"
665 (for-each delete-file-recursively
666 '("doc" "source" "tex4ht"))
667 ;; Delete all subdirectories of "fonts", except for "tfm" and
668 ;; any directories named "cm".
669 (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
670 (delete "fonts/afm" '("public"))
671 (delete "fonts/afm/public" '("amsfonts"))
672 (delete "fonts/afm/public/amsfonts" '("cm"))
673 (delete "fonts/map" '("dvips"))
674 (delete "fonts/map/dvips" '("cm"))
675 (delete "fonts/source" '("public"))
676 (delete "fonts/source/public" '("cm"))
677 (delete "fonts/tfm" '("public"))
678 (delete "fonts/type1" '("public"))
679 (delete "fonts/type1/public" '("amsfonts"))
680 (delete "fonts/type1/public/amsfonts" '("cm")))
681 #t))))))
682 (description
683 "TeX Live provides a comprehensive TeX document production system.
684 It includes all the major TeX-related programs, macro packages, and fonts
685 that are free software, including support for many languages around the
686 world.
687
688 This package contains a small subset of the texmf-dist data.")))
689
690
691 ;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal
692 ;; instead of the full texlive-texmf. It can be used, for instance, as a
693 ;; native input to packages that need texlive to build their documentation.
694 (define-public texlive-minimal
695 (package (inherit texlive)
696 (name "texlive-minimal")
697 (inputs
698 `(("texlive-texmf" ,texlive-texmf-minimal)
699 ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
700 (native-search-paths
701 (list (search-path-specification
702 (variable "TEXMFLOCAL")
703 (files '("share/texmf-local")))))
704 (description
705 "TeX Live provides a comprehensive TeX document production system.
706 It includes all the major TeX-related programs, macro packages, and fonts
707 that are free software, including support for many languages around the
708 world.
709
710 This package contains a small working part of the TeX Live distribution.")))
711
712 (define-public perl-text-bibtex
713 (package
714 (name "perl-text-bibtex")
715 (version "0.77")
716 (source
717 (origin
718 (method url-fetch)
719 (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
720 version ".tar.gz"))
721 (sha256
722 (base32
723 "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4"))))
724 (build-system perl-build-system)
725 (arguments
726 `(#:phases
727 (modify-phases %standard-phases
728 (add-after 'unpack 'add-output-directory-to-rpath
729 (lambda* (#:key outputs #:allow-other-keys)
730 (substitute* "inc/MyBuilder.pm"
731 (("-Lbtparse" line)
732 (string-append "-Wl,-rpath="
733 (assoc-ref outputs "out") "/lib " line)))
734 #t))
735 (add-after 'unpack 'install-libraries-to-/lib
736 (lambda* (#:key outputs #:allow-other-keys)
737 (substitute* "Build.PL"
738 (("lib64") "lib"))
739 #t)))))
740 (native-inputs
741 `(("perl-capture-tiny" ,perl-capture-tiny)
742 ("perl-config-autoconf" ,perl-config-autoconf)
743 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
744 ("perl-module-build" ,perl-module-build)))
745 (home-page "http://search.cpan.org/dist/Text-BibTeX")
746 (synopsis "Interface to read and parse BibTeX files")
747 (description "@code{Text::BibTeX} is a Perl library for reading, parsing,
748 and processing BibTeX files. @code{Text::BibTeX} gives you access to the data
749 at many different levels: you may work with BibTeX entries as simple field to
750 string mappings, or get at the original form of the data as a list of simple
751 values (strings, macros, or numbers) pasted together.")
752 (license license:perl-license)))
753
754 (define-public biber
755 (package
756 (name "biber-next")
757 (version "2.6")
758 (source (origin
759 (method url-fetch)
760 (uri (string-append "https://github.com/plk/biber/archive/v"
761 version ".tar.gz"))
762 (file-name (string-append name "-" version ".tar.gz"))
763 (sha256
764 (base32
765 "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp"))))
766 (build-system perl-build-system)
767 (arguments
768 `(#:phases
769 (modify-phases %standard-phases
770 (add-after 'install 'wrap-programs
771 (lambda* (#:key outputs #:allow-other-keys)
772 (let* ((out (assoc-ref outputs "out"))
773 (perl5lib (getenv "PERL5LIB")))
774 (wrap-program (string-append out "/bin/biber")
775 `("PERL5LIB" ":" prefix
776 (,(string-append perl5lib ":" out
777 "/lib/perl5/site_perl")))))
778 #t)))))
779 (inputs
780 `(("perl-autovivification" ,perl-autovivification)
781 ("perl-class-accessor" ,perl-class-accessor)
782 ("perl-data-dump" ,perl-data-dump)
783 ("perl-data-compare" ,perl-data-compare)
784 ("perl-data-uniqid" ,perl-data-uniqid)
785 ("perl-datetime-format-builder" ,perl-datetime-format-builder)
786 ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian)
787 ("perl-file-slurp" ,perl-file-slurp)
788 ("perl-ipc-cmd" ,perl-ipc-cmd)
789 ("perl-ipc-run3" ,perl-ipc-run3)
790 ("perl-list-allutils" ,perl-list-allutils)
791 ("perl-list-moreutils" ,perl-list-moreutils)
792 ("perl-mozilla-ca" ,perl-mozilla-ca)
793 ("perl-regexp-common" ,perl-regexp-common)
794 ("perl-log-log4perl" ,perl-log-log4perl)
795 ;; We cannot use perl-unicode-collate here, because otherwise the
796 ;; hardcoded hashes in the tests would differ. See
797 ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html
798 ;;("perl-unicode-collate" ,perl-unicode-collate)
799 ("perl-unicode-normalize" ,perl-unicode-normalize)
800 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
801 ("perl-encode-eucjpascii" ,perl-encode-eucjpascii)
802 ("perl-encode-jis2k" ,perl-encode-jis2k)
803 ("perl-encode-hanextra" ,perl-encode-hanextra)
804 ("perl-xml-libxml" ,perl-xml-libxml)
805 ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)
806 ("perl-xml-libxslt" ,perl-xml-libxslt)
807 ("perl-xml-writer" ,perl-xml-writer)
808 ("perl-sort-key" ,perl-sort-key)
809 ("perl-text-csv" ,perl-text-csv)
810 ("perl-text-csv-xs" ,perl-text-csv-xs)
811 ("perl-text-roman" ,perl-text-roman)
812 ("perl-uri" ,perl-uri)
813 ("perl-text-bibtex" ,perl-text-bibtex)
814 ("perl-libwww" ,perl-libwww)
815 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
816 ("perl-business-isbn" ,perl-business-isbn)
817 ("perl-business-issn" ,perl-business-issn)
818 ("perl-business-ismn" ,perl-business-ismn)
819 ("perl-lingua-translit" ,perl-lingua-translit)))
820 (native-inputs
821 `(("perl-config-autoconf" ,perl-config-autoconf)
822 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
823 ("perl-module-build" ,perl-module-build)
824 ;; for tests
825 ("perl-file-which" ,perl-file-which)
826 ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient
827 ("perl-test-differences" ,perl-test-differences)))
828 (home-page "http://biblatex-biber.sourceforge.net/")
829 (synopsis "Backend for the BibLaTeX citation management tool")
830 (description "Biber is a BibTeX replacement for users of biblatex. Among
831 other things it comes with full Unicode support.")
832 (license license:artistic2.0)))
833
834 ;; Our version of texlive comes with biblatex 3.4, which is only compatible
835 ;; with biber 2.5 according to the compatibility matrix in the biber
836 ;; documentation.
837 (define-public biber-2.5
838 (package (inherit biber)
839 (name "biber")
840 (version "2.5")
841 (source (origin
842 (method url-fetch)
843 (uri (string-append "https://github.com/plk/biber/archive/v"
844 version ".tar.gz"))
845 (file-name (string-append name "-" version ".tar.gz"))
846 (sha256
847 (base32
848 "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv"))))
849 (arguments
850 (substitute-keyword-arguments (package-arguments biber)
851 ((#:phases phases)
852 `(modify-phases ,phases
853 (add-before 'check 'delete-failing-test
854 (lambda _
855 (delete-file "t/sort-order.t")
856 #t))))))
857 (inputs
858 `(("perl-date-simple" ,perl-date-simple)
859 ,@(package-inputs biber)))))
860
861 (define-public rubber
862 (package
863 (name "rubber")
864 (version "1.1")
865 (source (origin
866 (method url-fetch)
867 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
868 version "/+download/rubber-"
869 version ".tar.gz")
870 (string-append "http://ebeffara.free.fr/pub/rubber-"
871 version ".tar.gz")))
872 (sha256
873 (base32
874 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
875 (build-system gnu-build-system)
876 (arguments '(#:tests? #f)) ; no `check' target
877 (inputs `(("texinfo" ,texinfo)
878 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
879 ("which" ,which)))
880 (home-page "https://launchpad.net/rubber")
881 (synopsis "Wrapper for LaTeX and friends")
882 (description
883 "Rubber is a program whose purpose is to handle all tasks related to the
884 compilation of LaTeX documents. This includes compiling the document itself,
885 of course, enough times so that all references are defined, and running BibTeX
886 to manage bibliographic references. Automatic execution of dvips to produce
887 PostScript documents is also included, as well as usage of pdfLaTeX to produce
888 PDF documents.")
889 (license license:gpl2+)))
890
891 (define-public texmaker
892 (package
893 (name "texmaker")
894 (version "4.5")
895 (source (origin
896 (method url-fetch)
897 (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
898 version ".tar.bz2"))
899 (sha256
900 (base32
901 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
902 (build-system gnu-build-system)
903 (arguments
904 `(#:phases
905 (modify-phases %standard-phases
906 ;; Qt has its own configuration utility.
907 (replace 'configure
908 (lambda* (#:key outputs #:allow-other-keys)
909 (let ((out (assoc-ref outputs "out")))
910 (zero? (system* "qmake"
911 (string-append "PREFIX=" out)
912 (string-append "DESKTOPDIR=" out
913 "/share/applications")
914 (string-append "ICONDIR=" out "/share/pixmaps")
915 "texmaker.pro"))))))))
916 (inputs
917 `(("poppler-qt5" ,poppler-qt5)
918 ("qtbase" ,qtbase)
919 ("qtscript" ,qtscript)
920 ("qtwebkit" ,qtwebkit)
921 ("zlib" ,zlib)))
922 (native-inputs
923 `(("pkg-config" ,pkg-config)))
924 (home-page "http://www.xm1math.net/texmaker/")
925 (synopsis "LaTeX editor")
926 (description "Texmaker is a program that integrates many tools needed to
927 develop documents with LaTeX, in a single application.")
928 (license license:gpl2+)))
929
930
931 (define-public teximpatient
932 (package
933 (name "teximpatient")
934 (version "2.4")
935 (source (origin
936 (method url-fetch)
937 (uri (string-append "mirror://gnu/" name "/" name "-"
938 version ".tar.gz"))
939 (sha256
940 (base32
941 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
942 (build-system gnu-build-system)
943 (arguments
944 `(#:phases
945 (modify-phases %standard-phases
946 (delete 'check)
947 ;; Unfortunately some mistakes have been made in packaging.
948 ;; Work around them here ...
949 (replace 'unpack
950 (lambda* (#:key inputs outputs #:allow-other-keys)
951 (let ((srcdir "teximpatient-2.4"))
952 (system* "tar" "-xzf" (assoc-ref inputs "source")
953 (string-append "--one-top-level=" srcdir))
954 (delete-file (string-append srcdir "/book.pdf"))
955 (install-file (car
956 (find-files
957 (assoc-ref inputs "automake")
958 "^install-sh$"))
959 srcdir)
960 (chdir srcdir)))))))
961 (native-inputs
962 `(("texlive" ,texlive)
963 ("automake" ,automake)))
964 (home-page "https://www.gnu.org/software/teximpatient/")
965 (synopsis "Book on TeX, plain TeX and Eplain")
966 (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
967 plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
968 and Karl Berry.")
969 (license license:fdl1.3+)))