build-system: Add 'texlive-build-system'.
[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 build-system texlive)
34 #:use-module (guix utils)
35 #:use-module (guix git-download)
36 #:use-module (guix svn-download)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages fontutils)
42 #:use-module (gnu packages gd)
43 #:use-module (gnu packages ghostscript)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages icu4c)
46 #:use-module (gnu packages image)
47 #:use-module (gnu packages lua)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages pdf)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages qt)
54 #:use-module (gnu packages ruby)
55 #:use-module (gnu packages shells)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages xml)
59 #:use-module (gnu packages xorg)
60 #:use-module (gnu packages xdisorg)
61 #:use-module (gnu packages zip)
62 #:autoload (gnu packages texinfo) (texinfo)
63 #:use-module (ice-9 ftw)
64 #:use-module (srfi srfi-1))
65
66 (define texlive-extra-src
67 (origin
68 (method url-fetch)
69 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523-extra.tar.xz")
70 (sha256 (base32
71 "0q4a92zmwhn4ry6xgrp4k8wq11ax2sg9rg9yrsrdkr719y0x887a"))))
72
73 (define texlive-texmf-src
74 (origin
75 (method url-fetch)
76 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-texmf.tar.xz")
77 (patches (search-patches "texlive-texmf-CVE-2016-10243.patch"))
78 (patch-flags '("-p2"))
79 (sha256 (base32
80 "1dv8vgfzpczqw82hv9g7a8djhhyzywljmrarlcyy6g2qi5q51glr"))))
81
82 (define texlive-bin
83 (package
84 (name "texlive-bin")
85 (version "2016")
86 (source
87 (origin
88 (method url-fetch)
89 (uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-source.tar.xz")
90 (sha256 (base32
91 "1v91vahxlxkdra0qz3f132vvx5d9cx2jy84yl1hkch0agyj2rcx8"))))
92 (build-system gnu-build-system)
93 (inputs
94 `(("texlive-extra-src" ,texlive-extra-src)
95 ("cairo" ,cairo)
96 ("fontconfig" ,fontconfig)
97 ("fontforge" ,fontforge)
98 ("freetype" ,freetype)
99 ("gd" ,gd)
100 ("gmp" ,gmp)
101 ("ghostscript" ,ghostscript)
102 ("graphite2" ,graphite2)
103 ("harfbuzz" ,harfbuzz)
104 ("icu4c" ,icu4c)
105 ("libpaper" ,libpaper)
106 ("libpng" ,libpng)
107 ("libxaw" ,libxaw)
108 ("libxt" ,libxt)
109 ("mpfr" ,mpfr)
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)))
120 (native-inputs
121 `(("pkg-config" ,pkg-config)))
122 (arguments
123 `(#:out-of-source? #t
124 #:configure-flags
125 `("--disable-native-texlive-build"
126 "--with-system-cairo"
127 "--with-system-freetype2"
128 "--with-system-gd"
129 "--with-system-gmp"
130 "--with-system-graphite2"
131 "--with-system-harfbuzz"
132 "--with-system-icu"
133 "--with-system-libgs"
134 "--with-system-libpaper"
135 "--with-system-libpng"
136 "--with-system-mpfr"
137 "--with-system-pixman"
138 "--with-system-poppler"
139 "--with-system-potrace"
140 "--with-system-teckit"
141 "--with-system-xpdf"
142 "--with-system-zlib"
143 "--with-system-zziplib")
144
145 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
146 ;; XXX FIXME fix luajit properly on mips64.
147 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
148 (%current-system))))
149 #:phases
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))))))))
173 (synopsis "TeX Live, a package of the TeX typesetting system")
174 (description
175 "TeX Live provides a comprehensive TeX document production system.
176 It includes all the major TeX-related programs, macro packages, and fonts
177 that are free software, including support for many languages around the
178 world.
179
180 This package contains the binaries.")
181 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
182 (home-page "https://www.tug.org/texlive/")))
183
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
197 "1k11yvz4q95bxyxczwvd4r177h6a2gg03xmf51kmgjgz8an2gq2w"))))
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
212 to PostScript.")
213 ;; Various free software licenses apply to individual files.
214 (license (list license:lppl1.3c+
215 license:expat
216 license:lgpl3+))))
217
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
246 data for TeX use. It contains a set of text files provided by the Unicode
247 Consortium which are currently all from Unicode 8.0.0, with the exception of
248 @code{MathClass.txt} which is not currently part of the Unicode Character
249 Database. Accompanying these source data are generic TeX loader files
250 allowing this data to be used as part of TeX runs, in particular in building
251 format files. Currently there are two loader files: one for general character
252 set up and one for initializing XeTeX character classes as has been carried
253 out to date by @code{unicode-letters.tex}. ")
254 (license license:lppl1.3c+)))
255
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
284 the German language, covering both traditional and reformed orthography. The
285 patterns can be used with packages Babel and hyphsubst from the Oberdiek
286 bundle.")
287 ;; Hyphenation patterns are under the Expat license; documentation is
288 ;; under LPPL.
289 (license (list license:expat license:lppl))))
290
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
319 for creating TeX formats. These files are commonly used to introduced
320 distribution-dependent variations in formats. They are also used to
321 allow existing format source files to be used with newer engines, for example
322 to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
323 (license license:public-domain)))
324
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
353 hyphenation patterns in UTF-8 format, whereas older systems require
354 hyphenation patterns in the 8-bit encoding of the font in use (such encodings
355 are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
356 etc). The present package offers a collection of conversions of existing
357 patterns to UTF-8 format, together with converters for use with 8-bit fonts in
358 older systems. Since hyphenation patterns for Knuthian-style TeX systems are
359 only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
360 converters, will completely supplant the older patterns.")
361 ;; Individual files each have their own license. Most of these files are
362 ;; independent hyphenation patterns.
363 (license (list license:lppl1.0+
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
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
429 build fonts using the Metafont system.")
430 (license license:knuth)))
431
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
495 Knuth. The Computer Modern font family is a large collection of text,
496 display, and mathematical fonts in a range of styles, based on Monotype Modern
497 8A.")
498 (license license:knuth)))
499
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
559 from Donald Knuth, including the plain format, plain base, and the MF logo
560 fonts.")
561 (license license:knuth)))
562
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
632 packages and classes. It includes invisible fonts (for use with the slides
633 class), line and circle fonts (for use in the picture environment) and LaTeX
634 symbol fonts.")
635 (license license:lppl1.2+)))
636
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
652 "1ifmbyl3ir8k0v1g25xjb5rcyy5vhj8a3fa2088nczga09hna5vn"))))
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
668 TeXbook, together with various supporting files (some also discussed in the
669 book).")
670 (license license:knuth)))
671
672 (define-public texlive-latex-base
673 (let ((texlive-dir
674 (lambda (dir hash)
675 (origin
676 (method svn-fetch)
677 (uri (svn-reference
678 (url (string-append "svn://www.tug.org/texlive/tags/"
679 %texlive-tag "/Master/texmf-dist/"
680 dir))
681 (revision %texlive-revision)))
682 (sha256 (base32 hash))))))
683 (package
684 (name "texlive-latex-base")
685 (version (number->string %texlive-revision))
686 (source (origin
687 (method svn-fetch)
688 (uri (texlive-ref "latex" "base"))
689 (sha256
690 (base32
691 "1h9pir2hz6i9avc4lrl733p3zf4rpkg8537x1zdbhs91hvhikw9k"))))
692 (build-system gnu-build-system)
693 (arguments
694 `(#:modules ((guix build gnu-build-system)
695 (guix build utils)
696 (ice-9 match)
697 (srfi srfi-1)
698 (srfi srfi-26))
699 #:tests? #f ; no tests
700 #:phases
701 (modify-phases %standard-phases
702 (delete 'configure)
703 (replace 'build
704 (lambda* (#:key inputs #:allow-other-keys)
705 ;; Find required fonts
706 (setenv "TFMFONTS"
707 (string-append (assoc-ref inputs "texlive-fonts-cm")
708 "/share/texmf-dist/fonts/tfm/public/cm:"
709 (assoc-ref inputs "texlive-fonts-latex")
710 "/share/texmf-dist/fonts/tfm/public/latex-fonts:"
711 (assoc-ref inputs "texlive-fonts-knuth-lib")
712 "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
713 (setenv "TEXINPUTS"
714 (string-append
715 (getcwd) ":"
716 (getcwd) "/build:"
717 (string-join
718 (append-map (match-lambda
719 ((_ . dir)
720 (find-files dir
721 (lambda (_ stat)
722 (eq? 'directory (stat:type stat)))
723 #:directories? #t
724 #:stat stat)))
725 inputs)
726 ":")))
727
728 ;; Create an empty texsys.cfg, because latex.ltx wants to include
729 ;; it. This file must exist and it's fine if it's empty.
730 (with-output-to-file "texsys.cfg"
731 (lambda _ (format #t "%")))
732
733 (mkdir "build")
734 (mkdir "web2c")
735 (and (zero? (system* "luatex" "-ini" "-interaction=batchmode"
736 "-output-directory=build"
737 "unpack.ins"))
738 ;; LaTeX and XeTeX require e-TeX, which is enabled only in
739 ;; extended mode (activated with a leading asterisk). We
740 ;; should not use luatex here, because that would make the
741 ;; generated format files incompatible with any other TeX
742 ;; engine.
743
744 ;; FIXME: XeTeX fails to build because neither
745 ;; \XeTeXuseglyphmetrics nor \XeTeXdashbreakstate are
746 ;; defined.
747 (every
748 (lambda (format)
749 (zero? (system* "latex" "-ini" "-interaction=batchmode"
750 "-output-directory=web2c"
751 "-translate-file=cp227.tcx"
752 (string-append "*" format ".ini"))))
753 '("latex" ;"xetex"
754 ))
755 (every
756 (lambda (format)
757 (zero? (system* "luatex" "-ini" "-interaction=batchmode"
758 "-output-directory=web2c"
759 (string-append format ".ini"))))
760 '("dviluatex" "dvilualatex" "luatex" "lualatex" "xelatex")))))
761 (replace 'install
762 (lambda* (#:key outputs #:allow-other-keys)
763 (let* ((out (assoc-ref outputs "out"))
764 (target (string-append
765 out "/share/texmf-dist/tex/latex/base"))
766 (web2c (string-append
767 out "/share/texmf-dist/web2c")))
768 (mkdir-p target)
769 (mkdir-p web2c)
770 (for-each delete-file (find-files "." "\\.(log|aux)$"))
771 (for-each (cut install-file <> target)
772 (find-files "build" ".*"))
773 (for-each (cut install-file <> web2c)
774 (find-files "web2c" ".*"))
775 #t))))))
776 (native-inputs
777 `(("texlive-bin" ,texlive-bin)
778 ("texlive-generic-unicode-data" ,texlive-generic-unicode-data)
779 ("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl)
780 ("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files)
781 ("texlive-latex-latexconfig"
782 ,(texlive-dir "tex/latex/latexconfig/"
783 "1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf"))
784 ("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8)
785 ("texlive-generic-hyphen"
786 ,(texlive-dir "tex/generic/hyphen/"
787 "0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd"))
788 ("texlive-generic-ruhyphen"
789 ,(texlive-dir "tex/generic/ruhyphen/"
790 "14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd"))
791 ("texlive-generic-ukrhyph"
792 ,(texlive-dir "tex/generic/ukrhyph/"
793 "1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv"))
794 ("texlive-generic-config"
795 ,(texlive-dir "tex/generic/config/"
796 "19vj088p4kkp6xll0141m4kl6ssgdzhs3g10i232khb07aqiag8s"))
797 ("texlive-tex-plain" ,texlive-tex-plain)
798 ("texlive-fonts-cm" ,texlive-fonts-cm)
799 ("texlive-fonts-latex" ,texlive-fonts-latex)
800 ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)))
801 (home-page "http://www.ctan.org/pkg/latex-base")
802 (synopsis "Base sources of LaTeX")
803 (description
804 "This bundle comprises the source of LaTeX itself, together with several
805 packages which are considered \"part of the kernel\". This bundle, together
806 with the required packages, constitutes what every LaTeX distribution should
807 contain.")
808 (license license:lppl1.3c+))))
809
810 (define texlive-texmf
811 (package
812 (name "texlive-texmf")
813 (version "2016")
814 (source texlive-texmf-src)
815 (build-system gnu-build-system)
816 (inputs
817 `(("texlive-bin" ,texlive-bin)
818 ("lua" ,lua)
819 ("perl" ,perl)
820 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
821 ("ruby" ,ruby)
822 ("tcsh" ,tcsh)))
823 (arguments
824 `(#:modules ((guix build gnu-build-system)
825 (guix build utils)
826 (srfi srfi-26))
827
828 ;; This package takes 4 GiB, which we can't afford to distribute from
829 ;; our servers.
830 #:substitutable? #f
831
832 #:phases
833 (modify-phases (map (cut assq <> %standard-phases)
834 '(set-paths unpack patch-source-shebangs))
835 (add-after 'patch-source-shebangs 'install
836 (lambda* (#:key outputs #:allow-other-keys)
837 (let ((share (string-append (assoc-ref outputs "out") "/share")))
838 (mkdir-p share)
839 (system* "mv" "texmf-dist" share))))
840 (add-after 'install 'texmf-config
841 (lambda* (#:key inputs outputs #:allow-other-keys)
842 (let* ((out (assoc-ref outputs "out"))
843 (share (string-append out "/share"))
844 (texmfroot (string-append share "/texmf-dist/web2c"))
845 (texmfcnf (string-append texmfroot "/texmf.cnf"))
846 (texlive-bin (assoc-ref inputs "texlive-bin"))
847 (texbin (string-append texlive-bin "/bin"))
848 (tlpkg (string-append texlive-bin "/share/tlpkg")))
849 ;; Register SHARE as TEXMFROOT in texmf.cnf.
850 (substitute* texmfcnf
851 (("TEXMFROOT = \\$SELFAUTOPARENT")
852 (string-append "TEXMFROOT = " share))
853 (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
854 "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
855 (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
856 ;; Register paths in texmfcnf.lua, needed for context.
857 (substitute* (string-append texmfroot "/texmfcnf.lua")
858 (("selfautodir:") out)
859 (("selfautoparent:") (string-append share "/")))
860 ;; Set path to TeXLive Perl modules
861 (setenv "PERL5LIB"
862 (string-append (getenv "PERL5LIB") ":" tlpkg))
863 ;; Configure the texmf-dist tree; inspired from
864 ;; http://slackbuilds.org/repository/13.37/office/texlive/
865 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
866 (setenv "TEXMFCNF" texmfroot)
867 (system* "updmap-sys" "--nohash" "--syncwithtrees")
868 (system* "mktexlsr")
869 (system* "fmtutil-sys" "--all")))))))
870 (properties `((max-silent-time . 9600))) ; don't time out while grafting
871 (synopsis "TeX Live, a package of the TeX typesetting system")
872 (description
873 "TeX Live provides a comprehensive TeX document production system.
874 It includes all the major TeX-related programs, macro packages, and fonts
875 that are free software, including support for many languages around the
876 world.
877
878 This package contains the complete tree of texmf-dist data.")
879 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
880 (home-page "https://www.tug.org/texlive/")))
881
882 (define-public texlive
883 (package
884 (name "texlive")
885 (version "2016")
886 (source #f)
887 (build-system trivial-build-system)
888 (inputs `(("bash" ,bash) ; for wrap-program
889 ("texlive-bin" ,texlive-bin)
890 ("texlive-texmf" ,texlive-texmf)))
891 (native-search-paths
892 (list (search-path-specification
893 (variable "TEXMFLOCAL")
894 (files '("share/texmf-local")))))
895 (arguments
896 `(#:modules ((guix build utils))
897 #:builder
898 ;; Build the union of texlive-bin and texlive-texmf, but take the
899 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
900 (begin
901 (use-modules (guix build utils))
902 (let ((out (assoc-ref %outputs "out"))
903 (bin (assoc-ref %build-inputs "texlive-bin"))
904 (texmf (assoc-ref %build-inputs "texlive-texmf"))
905 (bash (assoc-ref %build-inputs "bash")))
906 (mkdir out)
907 (with-directory-excursion out
908 (for-each
909 (lambda (name)
910 (symlink (string-append bin "/" name) name))
911 '("include" "lib"))
912 (mkdir "bin")
913 (with-directory-excursion "bin"
914 (setenv "PATH" (string-append bash "/bin"))
915 (for-each
916 (lambda (name)
917 (symlink name (basename name))
918 (wrap-program
919 (basename name)
920 `("TEXMFCNF" =
921 (,(string-append texmf "/share/texmf-dist/web2c")))))
922 (find-files (string-append bin "/bin/") "")))
923 (mkdir "share")
924 (with-directory-excursion "share"
925 (for-each
926 (lambda (name)
927 (symlink (string-append bin "/share/" name) name))
928 '("info" "man" "tlpkg"))
929 (for-each
930 (lambda (name)
931 (symlink (string-append texmf "/share/" name) name))
932 '("texmf-dist" "texmf-var"))))))))
933 (synopsis "TeX Live, a package of the TeX typesetting system")
934 (description
935 "TeX Live provides a comprehensive TeX document production system.
936 It includes all the major TeX-related programs, macro packages, and fonts
937 that are free software, including support for many languages around the
938 world.
939
940 This package contains the complete TeX Live distribution.")
941 (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
942 (home-page "https://www.tug.org/texlive/")))
943
944
945 ;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
946 ;; in particular dropping documentation and fonts. It weighs in at 470 MiB
947 ;; instead of 4 GiB.
948 (define texlive-texmf-minimal
949 (package (inherit texlive-texmf)
950 (name "texlive-texmf-minimal")
951 (arguments
952 (substitute-keyword-arguments
953 (package-arguments texlive-texmf)
954 ((#:modules modules)
955 `((ice-9 ftw)
956 (srfi srfi-1)
957 ,@modules))
958 ((#:phases phases)
959 `(modify-phases ,phases
960 (add-after 'unpack 'prune
961 (lambda _
962 (define (delete subdir exclude)
963 "Delete all files and directories in SUBDIR except for those
964 given in the list EXCLUDE."
965 (with-directory-excursion subdir
966 (for-each delete-file-recursively
967 (lset-difference equal?
968 (scandir ".")
969 (append '("." "..")
970 exclude)))))
971 (with-directory-excursion "texmf-dist"
972 (for-each delete-file-recursively
973 '("doc" "source" "tex4ht"))
974 ;; Delete all subdirectories of "fonts", except for "tfm" and
975 ;; any directories named "cm".
976 (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
977 (delete "fonts/afm" '("public"))
978 (delete "fonts/afm/public" '("amsfonts"))
979 (delete "fonts/afm/public/amsfonts" '("cm"))
980 (delete "fonts/map" '("dvips"))
981 (delete "fonts/map/dvips" '("cm"))
982 (delete "fonts/source" '("public"))
983 (delete "fonts/source/public" '("cm"))
984 (delete "fonts/tfm" '("public"))
985 (delete "fonts/type1" '("public"))
986 (delete "fonts/type1/public" '("amsfonts"))
987 (delete "fonts/type1/public/amsfonts" '("cm")))
988 #t))))))
989 (description
990 "TeX Live provides a comprehensive TeX document production system.
991 It includes all the major TeX-related programs, macro packages, and fonts
992 that are free software, including support for many languages around the
993 world.
994
995 This package contains a small subset of the texmf-dist data.")))
996
997
998 ;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal
999 ;; instead of the full texlive-texmf. It can be used, for instance, as a
1000 ;; native input to packages that need texlive to build their documentation.
1001 (define-public texlive-minimal
1002 (package (inherit texlive)
1003 (name "texlive-minimal")
1004 (inputs
1005 `(("texlive-texmf" ,texlive-texmf-minimal)
1006 ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
1007 (native-search-paths
1008 (list (search-path-specification
1009 (variable "TEXMFLOCAL")
1010 (files '("share/texmf-local")))))
1011 (description
1012 "TeX Live provides a comprehensive TeX document production system.
1013 It includes all the major TeX-related programs, macro packages, and fonts
1014 that are free software, including support for many languages around the
1015 world.
1016
1017 This package contains a small working part of the TeX Live distribution.")))
1018
1019 (define-public perl-text-bibtex
1020 (package
1021 (name "perl-text-bibtex")
1022 (version "0.77")
1023 (source
1024 (origin
1025 (method url-fetch)
1026 (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
1027 version ".tar.gz"))
1028 (sha256
1029 (base32
1030 "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4"))))
1031 (build-system perl-build-system)
1032 (arguments
1033 `(#:phases
1034 (modify-phases %standard-phases
1035 (add-after 'unpack 'add-output-directory-to-rpath
1036 (lambda* (#:key outputs #:allow-other-keys)
1037 (substitute* "inc/MyBuilder.pm"
1038 (("-Lbtparse" line)
1039 (string-append "-Wl,-rpath="
1040 (assoc-ref outputs "out") "/lib " line)))
1041 #t))
1042 (add-after 'unpack 'install-libraries-to-/lib
1043 (lambda* (#:key outputs #:allow-other-keys)
1044 (substitute* "Build.PL"
1045 (("lib64") "lib"))
1046 #t)))))
1047 (native-inputs
1048 `(("perl-capture-tiny" ,perl-capture-tiny)
1049 ("perl-config-autoconf" ,perl-config-autoconf)
1050 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1051 ("perl-module-build" ,perl-module-build)))
1052 (home-page "http://search.cpan.org/dist/Text-BibTeX")
1053 (synopsis "Interface to read and parse BibTeX files")
1054 (description "@code{Text::BibTeX} is a Perl library for reading, parsing,
1055 and processing BibTeX files. @code{Text::BibTeX} gives you access to the data
1056 at many different levels: you may work with BibTeX entries as simple field to
1057 string mappings, or get at the original form of the data as a list of simple
1058 values (strings, macros, or numbers) pasted together.")
1059 (license license:perl-license)))
1060
1061 (define-public biber
1062 (package
1063 (name "biber-next")
1064 (version "2.6")
1065 (source (origin
1066 (method url-fetch)
1067 (uri (string-append "https://github.com/plk/biber/archive/v"
1068 version ".tar.gz"))
1069 (file-name (string-append name "-" version ".tar.gz"))
1070 (sha256
1071 (base32
1072 "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp"))))
1073 (build-system perl-build-system)
1074 (arguments
1075 `(#:phases
1076 (modify-phases %standard-phases
1077 (add-after 'install 'wrap-programs
1078 (lambda* (#:key outputs #:allow-other-keys)
1079 (let* ((out (assoc-ref outputs "out"))
1080 (perl5lib (getenv "PERL5LIB")))
1081 (wrap-program (string-append out "/bin/biber")
1082 `("PERL5LIB" ":" prefix
1083 (,(string-append perl5lib ":" out
1084 "/lib/perl5/site_perl")))))
1085 #t)))))
1086 (inputs
1087 `(("perl-autovivification" ,perl-autovivification)
1088 ("perl-class-accessor" ,perl-class-accessor)
1089 ("perl-data-dump" ,perl-data-dump)
1090 ("perl-data-compare" ,perl-data-compare)
1091 ("perl-data-uniqid" ,perl-data-uniqid)
1092 ("perl-datetime-format-builder" ,perl-datetime-format-builder)
1093 ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian)
1094 ("perl-file-slurp" ,perl-file-slurp)
1095 ("perl-ipc-cmd" ,perl-ipc-cmd)
1096 ("perl-ipc-run3" ,perl-ipc-run3)
1097 ("perl-list-allutils" ,perl-list-allutils)
1098 ("perl-list-moreutils" ,perl-list-moreutils)
1099 ("perl-mozilla-ca" ,perl-mozilla-ca)
1100 ("perl-regexp-common" ,perl-regexp-common)
1101 ("perl-log-log4perl" ,perl-log-log4perl)
1102 ;; We cannot use perl-unicode-collate here, because otherwise the
1103 ;; hardcoded hashes in the tests would differ. See
1104 ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html
1105 ;;("perl-unicode-collate" ,perl-unicode-collate)
1106 ("perl-unicode-normalize" ,perl-unicode-normalize)
1107 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
1108 ("perl-encode-eucjpascii" ,perl-encode-eucjpascii)
1109 ("perl-encode-jis2k" ,perl-encode-jis2k)
1110 ("perl-encode-hanextra" ,perl-encode-hanextra)
1111 ("perl-xml-libxml" ,perl-xml-libxml)
1112 ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)
1113 ("perl-xml-libxslt" ,perl-xml-libxslt)
1114 ("perl-xml-writer" ,perl-xml-writer)
1115 ("perl-sort-key" ,perl-sort-key)
1116 ("perl-text-csv" ,perl-text-csv)
1117 ("perl-text-csv-xs" ,perl-text-csv-xs)
1118 ("perl-text-roman" ,perl-text-roman)
1119 ("perl-uri" ,perl-uri)
1120 ("perl-text-bibtex" ,perl-text-bibtex)
1121 ("perl-libwww" ,perl-libwww)
1122 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
1123 ("perl-business-isbn" ,perl-business-isbn)
1124 ("perl-business-issn" ,perl-business-issn)
1125 ("perl-business-ismn" ,perl-business-ismn)
1126 ("perl-lingua-translit" ,perl-lingua-translit)))
1127 (native-inputs
1128 `(("perl-config-autoconf" ,perl-config-autoconf)
1129 ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
1130 ("perl-module-build" ,perl-module-build)
1131 ;; for tests
1132 ("perl-file-which" ,perl-file-which)
1133 ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient
1134 ("perl-test-differences" ,perl-test-differences)))
1135 (home-page "http://biblatex-biber.sourceforge.net/")
1136 (synopsis "Backend for the BibLaTeX citation management tool")
1137 (description "Biber is a BibTeX replacement for users of biblatex. Among
1138 other things it comes with full Unicode support.")
1139 (license license:artistic2.0)))
1140
1141 ;; Our version of texlive comes with biblatex 3.4, which is only compatible
1142 ;; with biber 2.5 according to the compatibility matrix in the biber
1143 ;; documentation.
1144 (define-public biber-2.5
1145 (package (inherit biber)
1146 (name "biber")
1147 (version "2.5")
1148 (source (origin
1149 (method url-fetch)
1150 (uri (string-append "https://github.com/plk/biber/archive/v"
1151 version ".tar.gz"))
1152 (file-name (string-append name "-" version ".tar.gz"))
1153 (sha256
1154 (base32
1155 "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv"))))
1156 (arguments
1157 (substitute-keyword-arguments (package-arguments biber)
1158 ((#:phases phases)
1159 `(modify-phases ,phases
1160 (add-before 'check 'delete-failing-test
1161 (lambda _
1162 (delete-file "t/sort-order.t")
1163 #t))))))
1164 (inputs
1165 `(("perl-date-simple" ,perl-date-simple)
1166 ,@(package-inputs biber)))))
1167
1168 (define-public rubber
1169 (package
1170 (name "rubber")
1171 (version "1.1")
1172 (source (origin
1173 (method url-fetch)
1174 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
1175 version "/+download/rubber-"
1176 version ".tar.gz")
1177 (string-append "http://ebeffara.free.fr/pub/rubber-"
1178 version ".tar.gz")))
1179 (sha256
1180 (base32
1181 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
1182 (build-system gnu-build-system)
1183 (arguments '(#:tests? #f)) ; no `check' target
1184 (inputs `(("texinfo" ,texinfo)
1185 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
1186 ("which" ,which)))
1187 (home-page "https://launchpad.net/rubber")
1188 (synopsis "Wrapper for LaTeX and friends")
1189 (description
1190 "Rubber is a program whose purpose is to handle all tasks related to the
1191 compilation of LaTeX documents. This includes compiling the document itself,
1192 of course, enough times so that all references are defined, and running BibTeX
1193 to manage bibliographic references. Automatic execution of dvips to produce
1194 PostScript documents is also included, as well as usage of pdfLaTeX to produce
1195 PDF documents.")
1196 (license license:gpl2+)))
1197
1198 (define-public texmaker
1199 (package
1200 (name "texmaker")
1201 (version "4.5")
1202 (source (origin
1203 (method url-fetch)
1204 (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
1205 version ".tar.bz2"))
1206 (sha256
1207 (base32
1208 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
1209 (build-system gnu-build-system)
1210 (arguments
1211 `(#:phases
1212 (modify-phases %standard-phases
1213 ;; Qt has its own configuration utility.
1214 (replace 'configure
1215 (lambda* (#:key outputs #:allow-other-keys)
1216 (let ((out (assoc-ref outputs "out")))
1217 (zero? (system* "qmake"
1218 (string-append "PREFIX=" out)
1219 (string-append "DESKTOPDIR=" out
1220 "/share/applications")
1221 (string-append "ICONDIR=" out "/share/pixmaps")
1222 "texmaker.pro"))))))))
1223 (inputs
1224 `(("poppler-qt5" ,poppler-qt5)
1225 ("qtbase" ,qtbase)
1226 ("qtscript" ,qtscript)
1227 ("qtwebkit" ,qtwebkit)
1228 ("zlib" ,zlib)))
1229 (native-inputs
1230 `(("pkg-config" ,pkg-config)))
1231 (home-page "http://www.xm1math.net/texmaker/")
1232 (synopsis "LaTeX editor")
1233 (description "Texmaker is a program that integrates many tools needed to
1234 develop documents with LaTeX, in a single application.")
1235 (license license:gpl2+)))
1236
1237
1238 (define-public teximpatient
1239 (package
1240 (name "teximpatient")
1241 (version "2.4")
1242 (source (origin
1243 (method url-fetch)
1244 (uri (string-append "mirror://gnu/" name "/" name "-"
1245 version ".tar.gz"))
1246 (sha256
1247 (base32
1248 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
1249 (build-system gnu-build-system)
1250 (arguments
1251 `(#:phases
1252 (modify-phases %standard-phases
1253 (delete 'check)
1254 ;; Unfortunately some mistakes have been made in packaging.
1255 ;; Work around them here ...
1256 (replace 'unpack
1257 (lambda* (#:key inputs outputs #:allow-other-keys)
1258 (let ((srcdir "teximpatient-2.4"))
1259 (system* "tar" "-xzf" (assoc-ref inputs "source")
1260 (string-append "--one-top-level=" srcdir))
1261 (delete-file (string-append srcdir "/book.pdf"))
1262 (install-file (car
1263 (find-files
1264 (assoc-ref inputs "automake")
1265 "^install-sh$"))
1266 srcdir)
1267 (chdir srcdir)))))))
1268 (native-inputs
1269 `(("texlive" ,texlive)
1270 ("automake" ,automake)))
1271 (home-page "https://www.gnu.org/software/teximpatient/")
1272 (synopsis "Book on TeX, plain TeX and Eplain")
1273 (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
1274 plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
1275 and Karl Berry.")
1276 (license license:fdl1.3+)))