doc: Add footnote on Guile-JSON.
[jackhill/guix/guix.git] / gnu / packages / texlive.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>
eb0119ef
AE
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages texlive)
b5b73a82 22 #:use-module ((guix licenses) #:prefix license:)
eb0119ef
AE
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
0aa34e82 26 #:use-module (guix build-system trivial)
eb0119ef 27 #:use-module (gnu packages)
0aa34e82 28 #:use-module (gnu packages bash)
eb0119ef 29 #:use-module (gnu packages compression)
a86177d6 30 #:use-module (gnu packages fontutils)
fd89b36b 31 #:use-module (gnu packages gd)
eb0119ef 32 #:use-module (gnu packages ghostscript)
fd89b36b 33 #:use-module (gnu packages gtk)
eb0119ef 34 #:use-module (gnu packages icu4c)
e55354b8 35 #:use-module (gnu packages image)
0aa34e82 36 #:use-module (gnu packages lua)
0256c746 37 #:use-module (gnu packages multiprecision)
eb0119ef
AE
38 #:use-module (gnu packages pdf)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
b32c8549 42 #:use-module (gnu packages ruby)
95b6c70f 43 #:use-module (gnu packages tcsh)
ce0614dd 44 #:use-module (gnu packages base)
c0589f75 45 #:use-module (gnu packages xorg)
ece9b417 46 #:use-module (gnu packages xdisorg)
231eae53
LC
47 #:use-module (gnu packages zip)
48 #:autoload (gnu packages texinfo) (texinfo))
eb0119ef
AE
49
50(define texlive-extra-src
51 (origin
52 (method url-fetch)
0256c746 53 (uri "ftp://tug.org/historic/systems/texlive/2015/texlive-20150523-extra.tar.xz")
eb0119ef 54 (sha256 (base32
0256c746 55 "1dkhhacga8h1v2m9xv1w02glbdda2m8lfp1la1y1zb9yjj8jsa6i"))))
eb0119ef
AE
56
57(define texlive-texmf-src
58 (origin
59 (method url-fetch)
0256c746 60 (uri "ftp://tug.org/historic/systems/texlive/2015/texlive-20150523-texmf.tar.xz")
eb0119ef 61 (sha256 (base32
0256c746 62 "1a3hpcg6x69ysqx432v6sk4alg0x34813cwk41frmvzprdajpyqy"))))
eb0119ef 63
0aa34e82 64(define-public texlive-bin
eb0119ef 65 (package
0aa34e82 66 (name "texlive-bin")
0256c746 67 (version "2015")
0aa34e82
AE
68 (source
69 (origin
70 (method url-fetch)
0256c746 71 (uri "ftp://tug.org/historic/systems/texlive/2015/texlive-20150521-source.tar.xz")
0aa34e82 72 (sha256 (base32
0256c746 73 "0sa6kmz4jwhv6lw702gxszhhjkvw071wba0ngk1c76g8vixwv6zd"))))
eb0119ef 74 (build-system gnu-build-system)
0aa34e82
AE
75 (inputs
76 `(("texlive-extra-src" ,texlive-extra-src)
77 ("cairo" ,cairo)
78 ("fontconfig" ,fontconfig)
79 ("fontforge" ,fontforge)
80 ("freetype" ,freetype)
81 ("gd" ,gd)
0256c746 82 ("gmp" ,gmp)
0aa34e82
AE
83 ("ghostscript" ,ghostscript)
84 ("graphite2" ,graphite2)
85 ("harfbuzz" ,harfbuzz)
86 ("icu4c" ,icu4c)
87 ("libpaper" ,libpaper)
88 ("libpng" ,libpng)
89 ("libxaw" ,libxaw)
90 ("libxt" ,libxt)
0256c746 91 ("mpfr" ,mpfr)
0aa34e82
AE
92 ("perl" ,perl)
93 ("pixman" ,pixman)
94 ("poppler" ,poppler)
95 ("potrace" ,potrace)
96 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
97 ("ruby" ,ruby)
98 ("tcsh" ,tcsh)
99 ("teckit" ,teckit)
100 ("zlib" ,zlib)
101 ("zziplib" ,zziplib)))
c4c4cc05 102 (native-inputs
e9a6d225 103 `(("pkg-config" ,pkg-config)))
eb0119ef
AE
104 (arguments
105 `(#:out-of-source? #t
106 #:configure-flags
107 `("--disable-native-texlive-build"
fd89b36b 108 "--with-system-cairo"
eb0119ef 109 "--with-system-freetype2"
fd89b36b 110 "--with-system-gd"
0256c746 111 "--with-system-gmp"
be2c88ca 112 "--with-system-graphite2"
c70cf7eb 113 "--with-system-harfbuzz"
eb0119ef
AE
114 "--with-system-icu"
115 "--with-system-libgs"
609578a7 116 "--with-system-libpaper"
eb0119ef 117 "--with-system-libpng"
0256c746 118 "--with-system-mpfr"
fd89b36b 119 "--with-system-pixman"
eb0119ef 120 "--with-system-poppler"
75916982 121 "--with-system-potrace"
eb0119ef
AE
122 "--with-system-teckit"
123 "--with-system-xpdf"
124 "--with-system-zlib"
125 "--with-system-zziplib")
2f4640e3
MW
126
127 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
128 ;; XXX FIXME fix luajit properly on mips64.
d2e84281 129 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
2f4640e3 130 (%current-system))))
eb0119ef 131 #:phases
4a6635f3
AE
132 (modify-phases %standard-phases
133 (add-after 'install 'postint
134 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
135 (let* ((out (assoc-ref outputs "out"))
136 (share (string-append out "/share"))
137 (texlive-extra (assoc-ref inputs "texlive-extra-src"))
138 (unpack (assoc-ref %standard-phases 'unpack))
139 (patch-source-shebangs
140 (assoc-ref %standard-phases 'patch-source-shebangs)))
141 ;; Create symbolic links for the latex variants and their
142 ;; man pages.
143 (with-directory-excursion (string-append out "/bin/")
144 (for-each symlink
145 '("pdftex" "pdftex" "xetex" "luatex")
146 '("latex" "pdflatex" "xelatex" "lualatex")))
147 (with-directory-excursion (string-append share "/man/man1/")
148 (symlink "luatex.1" "lualatex.1"))
149 ;; Unpack texlive-extra and install tlpkg.
150 (mkdir "texlive-extra")
151 (with-directory-excursion "texlive-extra"
152 (apply unpack (list #:source texlive-extra))
153 (apply patch-source-shebangs (list #:source texlive-extra))
154 (system* "mv" "tlpkg" share))))))))
0aa34e82
AE
155 (synopsis "TeX Live, a package of the TeX typesetting system")
156 (description
157 "TeX Live provides a comprehensive TeX document production system.
158It includes all the major TeX-related programs, macro packages, and fonts
159that are free software, including support for many languages around the
160world.
161
162This package contains the binaries.")
163 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
164 (home-page "http://www.tug.org/texlive/")))
165
166(define-public texlive-texmf
167 (package
168 (name "texlive-texmf")
0256c746 169 (version "2015")
0aa34e82
AE
170 (source texlive-texmf-src)
171 (build-system gnu-build-system)
172 (inputs
173 `(("texlive-bin" ,texlive-bin)
174 ("lua" ,lua)
175 ("perl" ,perl)
176 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
177 ("ruby" ,ruby)
178 ("tcsh" ,tcsh)))
179 (arguments
180 `(#:modules ((guix build gnu-build-system)
181 (guix build utils)
182 (srfi srfi-26))
0aa34e82 183 #:phases
4a6635f3
AE
184 (modify-phases (map (cut assq <> %standard-phases)
185 '(set-paths unpack patch-source-shebangs))
186 (add-after 'patch-source-shebangs 'install
187 (lambda* (#:key outputs #:allow-other-keys)
188 (let ((share (string-append (assoc-ref outputs "out") "/share")))
189 (mkdir-p share)
190 (system* "mv" "texmf-dist" share))))
191 (add-after 'install 'texmf-config
192 (lambda* (#:key inputs outputs #:allow-other-keys)
193 (let* ((out (assoc-ref outputs "out"))
194 (share (string-append out "/share"))
195 (texmfroot (string-append share "/texmf-dist/web2c"))
196 (texmfcnf (string-append texmfroot "/texmf.cnf"))
197 (texlive-bin (assoc-ref inputs "texlive-bin"))
198 (texbin (string-append texlive-bin "/bin"))
199 (tlpkg (string-append texlive-bin "/share/tlpkg")))
200 ;; Register SHARE as TEXMFROOT in texmf.cnf.
201 (substitute* texmfcnf
202 (("TEXMFROOT = \\$SELFAUTOPARENT")
203 (string-append "TEXMFROOT = " share)))
204 ;; Register paths in texmfcnf.lua, needed for context.
205 (substitute* (string-append texmfroot "/texmfcnf.lua")
206 (("selfautodir:") out)
207 (("selfautoparent:") (string-append share "/")))
208 ;; Set path to TeXLive Perl modules
209 (setenv "PERL5LIB"
210 (string-append (getenv "PERL5LIB") ":" tlpkg))
211 ;; Configure the texmf-dist tree; inspired from
212 ;; http://slackbuilds.org/repository/13.37/office/texlive/
213 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
214 (setenv "TEXMFCNF" texmfroot)
215 (system* "updmap-sys" "--nohash" "--syncwithtrees")
216 (system* "mktexlsr")
217 (system* "fmtutil-sys" "--all")))))))
0aa34e82 218 (synopsis "TeX Live, a package of the TeX typesetting system")
eb0119ef
AE
219 (description
220 "TeX Live provides a comprehensive TeX document production system.
221It includes all the major TeX-related programs, macro packages, and fonts
222that are free software, including support for many languages around the
0aa34e82
AE
223world.
224
225This package contains the complete tree of texmf-dist data.")
226 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
227 (home-page "http://www.tug.org/texlive/")))
228
229(define-public texlive
230 (package
231 (name "texlive")
0256c746 232 (version "2015")
0aa34e82
AE
233 (source #f)
234 (build-system trivial-build-system)
235 (inputs `(("bash" ,bash) ; for wrap-program
236 ("texlive-bin" ,texlive-bin)
237 ("texlive-texmf" ,texlive-texmf)))
238 (arguments
239 `(#:modules ((guix build utils))
240 #:builder
241 ;; Build the union of texlive-bin and texlive-texmf, but take the
242 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
243 (begin
244 (use-modules (guix build utils))
245 (let ((out (assoc-ref %outputs "out"))
246 (bin (assoc-ref %build-inputs "texlive-bin"))
247 (texmf (assoc-ref %build-inputs "texlive-texmf"))
248 (bash (assoc-ref %build-inputs "bash")))
249 (mkdir out)
250 (with-directory-excursion out
251 (for-each
252 (lambda (name)
253 (symlink (string-append bin "/" name) name))
254 '("include" "lib"))
255 (mkdir "bin")
256 (with-directory-excursion "bin"
257 (setenv "PATH" (string-append bash "/bin"))
258 (for-each
259 (lambda (name)
260 (symlink name (basename name))
261 (wrap-program
262 (basename name)
263 `("TEXMFCNF" =
264 (,(string-append texmf "/share/texmf-dist/web2c")))))
265 (find-files (string-append bin "/bin/") "")))
266 (mkdir "share")
267 (with-directory-excursion "share"
268 (for-each
269 (lambda (name)
270 (symlink (string-append bin "/share/" name) name))
271 '("info" "man" "tlpkg"))
272 (for-each
273 (lambda (name)
274 (symlink (string-append texmf "/share/" name) name))
275 '("texmf-dist" "texmf-var"))))))))
276 (synopsis "TeX Live, a package of the TeX typesetting system")
277 (description
278 "TeX Live provides a comprehensive TeX document production system.
279It includes all the major TeX-related programs, macro packages, and fonts
280that are free software, including support for many languages around the
281world.
282
283This package contains the complete TeX Live distribution.")
eb0119ef
AE
284 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
285 (home-page "http://www.tug.org/texlive/")))
231eae53
LC
286
287(define-public rubber
288 (package
289 (name "rubber")
290 (version "1.1")
291 (source (origin
292 (method url-fetch)
293 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
294 version "/+download/rubber-"
295 version ".tar.gz")
296 (string-append "http://ebeffara.free.fr/pub/rubber-"
297 version ".tar.gz")))
298 (sha256
299 (base32
300 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
301 (build-system gnu-build-system)
302 (arguments '(#:tests? #f)) ; no `check' target
303 (inputs `(("texinfo" ,texinfo)
9bee5d6c 304 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
231eae53
LC
305 ("which" ,which)))
306 (home-page "https://launchpad.net/rubber")
35b9e423 307 (synopsis "Wrapper for LaTeX and friends")
231eae53
LC
308 (description
309 "Rubber is a program whose purpose is to handle all tasks related to the
310compilation of LaTeX documents. This includes compiling the document itself,
311of course, enough times so that all references are defined, and running BibTeX
312to manage bibliographic references. Automatic execution of dvips to produce
313PostScript documents is also included, as well as usage of pdfLaTeX to produce
314PDF documents.")
315 (license license:gpl2+)))