gnu: Add missing (gnu packages xdisorg) import.
[jackhill/guix/guix.git] / gnu / packages / texlive.scm
CommitLineData
eb0119ef 1;;; GNU Guix --- Functional package management for GNU
be2c88ca 2;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
42e1394b 3;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
eb0119ef
AE
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages texlive)
b5b73a82 21 #:use-module ((guix licenses) #:prefix license:)
eb0119ef
AE
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages compression)
a86177d6 27 #:use-module (gnu packages fontutils)
fd89b36b 28 #:use-module (gnu packages gd)
eb0119ef 29 #:use-module (gnu packages ghostscript)
fd89b36b 30 #:use-module (gnu packages gtk)
eb0119ef 31 #:use-module (gnu packages icu4c)
e55354b8 32 #:use-module (gnu packages image)
eb0119ef
AE
33 #:use-module (gnu packages pdf)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
b32c8549 37 #:use-module (gnu packages ruby)
95b6c70f 38 #:use-module (gnu packages tcsh)
b32c8549 39 #:use-module (gnu packages which)
c0589f75 40 #:use-module (gnu packages xorg)
231eae53
LC
41 #:use-module (gnu packages zip)
42 #:autoload (gnu packages texinfo) (texinfo))
eb0119ef
AE
43
44(define texlive-extra-src
45 (origin
46 (method url-fetch)
42e1394b 47 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-extra.tar.xz")
eb0119ef 48 (sha256 (base32
42e1394b 49 "1zlnjysvxskcy05iva6jfklirwv12wqyn3ia119a7xnqlvhpqz33"))))
eb0119ef
AE
50
51(define texlive-texmf-src
52 (origin
53 (method url-fetch)
42e1394b 54 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-texmf.tar.xz")
eb0119ef 55 (sha256 (base32
42e1394b 56 "0qsr55ms1278dhmgixs5qqwd4fxhh369ihkki6wgh8xaqm8p48p0"))))
eb0119ef
AE
57
58(define-public texlive
59 (package
60 (name "texlive")
42e1394b 61 (version "2014")
eb0119ef
AE
62 (source (origin
63 (method url-fetch)
42e1394b 64 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-source.tar.xz")
eb0119ef 65 (sha256 (base32
42e1394b 66 "1glmaw2jv42grbsn05kay825j66scimjqqc32776bb1356q4xfq8"))))
eb0119ef
AE
67 (build-system gnu-build-system)
68 (inputs `(("texlive-extra-src" ,texlive-extra-src)
69 ("texlive-texmf-src" ,texlive-texmf-src)
fd89b36b 70 ("cairo" ,cairo)
eb0119ef 71 ("fontconfig" ,fontconfig)
b32c8549 72 ("fontforge" ,fontforge)
eb0119ef 73 ("freetype" ,freetype)
fd89b36b 74 ("gd" ,gd)
eb0119ef 75 ("ghostscript" ,ghostscript)
be2c88ca 76 ("graphite2" ,graphite2)
c70cf7eb 77 ("harfbuzz" ,harfbuzz)
be2c88ca 78 ("icu4c" ,icu4c)
609578a7 79 ("libpaper" ,libpaper)
eb0119ef 80 ("libpng" ,libpng)
c0589f75
AE
81 ("libxaw" ,libxaw)
82 ("libxt" ,libxt)
e9a6d225 83 ("perl" ,perl)
fd89b36b 84 ("pixman" ,pixman)
eb0119ef 85 ("poppler" ,poppler)
75916982 86 ("potrace" ,potrace)
e9a6d225 87 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
b32c8549 88 ("ruby" ,ruby)
e9a6d225 89 ("tcsh" ,tcsh)
eb0119ef 90 ("teckit" ,teckit)
eb0119ef
AE
91 ("zlib" ,zlib)
92 ("zziplib" ,zziplib)))
c4c4cc05 93 (native-inputs
e9a6d225 94 `(("pkg-config" ,pkg-config)))
eb0119ef
AE
95 (outputs '("out" "data"))
96 (arguments
97 `(#:out-of-source? #t
98 #:configure-flags
99 `("--disable-native-texlive-build"
fd89b36b
AE
100 ;; Although the texmf-dist data is taken from texlive-texmf,
101 ;; setting datarootdir is still useful:
eb0119ef
AE
102 ;; "make install" creates symbolic links to scripts in this place.
103 ,(string-append "--datarootdir=" (assoc-ref %outputs "data"))
104 ,(string-append "--infodir=" (assoc-ref %outputs "out") "/share/info")
105 ,(string-append "--mandir=" (assoc-ref %outputs "out") "/share/man")
fd89b36b 106 "--with-system-cairo"
eb0119ef 107 "--with-system-freetype2"
fd89b36b 108 "--with-system-gd"
be2c88ca 109 "--with-system-graphite2"
c70cf7eb 110 "--with-system-harfbuzz"
eb0119ef
AE
111 "--with-system-icu"
112 "--with-system-libgs"
609578a7 113 "--with-system-libpaper"
eb0119ef 114 "--with-system-libpng"
fd89b36b 115 "--with-system-pixman"
eb0119ef 116 "--with-system-poppler"
75916982 117 "--with-system-potrace"
eb0119ef
AE
118 "--with-system-teckit"
119 "--with-system-xpdf"
120 "--with-system-zlib"
121 "--with-system-zziplib")
2f4640e3
MW
122
123 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
124 ;; XXX FIXME fix luajit properly on mips64.
125 #:tests? ,(not (equal? "mips64el-linux" (or (%current-target-system)
126 (%current-system))))
eb0119ef 127 #:phases
eb0119ef
AE
128 (alist-cons-after
129 'install 'postinst
130 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
131 (let ((texlive-extra (assoc-ref inputs "texlive-extra-src"))
132 (texlive-texmf (assoc-ref inputs "texlive-texmf-src"))
133 (out (assoc-ref outputs "out"))
134 (data (assoc-ref outputs "data"))
135 (unpack (assoc-ref %standard-phases 'unpack))
136 (patch-source-shebangs
137 (assoc-ref %standard-phases 'patch-source-shebangs)))
138 ;; Create symbolic links for the latex variants and their
139 ;; man pages.
140 (with-directory-excursion (string-append out "/bin/")
141 (for-each symlink
142 '("pdftex" "pdftex" "xetex" "luatex")
143 '("latex" "pdflatex" "xelatex" "lualatex")))
144 (with-directory-excursion (string-append out "/share/man/man1/")
145 (symlink "luatex.1" "lualatex.1"))
fd89b36b
AE
146 ;; Delete texmf-dist from "data", since it will be reinstalled
147 ;; from texlive-texmf.
eb0119ef
AE
148 (system* "rm" "-r" (string-append data "/texmf-dist"))
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" data)
155 (chdir ".."))
156 ;; Unpack and install texlive-texmf.
157 (mkdir "texlive-texmf")
158 (with-directory-excursion "texlive-texmf"
159 (apply unpack (list #:source texlive-texmf))
160 (apply patch-source-shebangs (list #:source texlive-texmf))
161 ;; Register "data" for kpathsea in texmf.cnf.
fd89b36b 162 (substitute* "texmf-dist/web2c/texmf.cnf"
eb0119ef
AE
163 (("TEXMFROOT = \\$SELFAUTOPARENT")
164 (string-append "TEXMFROOT = " data)))
eb0119ef
AE
165 (system* "mv" "texmf-dist" data)
166 (chdir ".."))
167 ;; texmf.cnf must also be placed in "out", since kpsewhich does
168 ;; not know about "data" until it has found this file.
fd89b36b
AE
169 (mkdir (string-append out "/share/texmf-dist"))
170 (mkdir (string-append out "/share/texmf-dist/web2c"))
171 (copy-file (string-append data "/texmf-dist/web2c/texmf.cnf")
172 (string-append out "/share/texmf-dist/web2c/texmf.cnf"))))
eb0119ef
AE
173 (alist-cons-after 'patch-shebangs 'texconfig
174 (lambda* (#:key outputs #:allow-other-keys)
175 (let ((out (assoc-ref outputs "out")))
176 ;; Configure the texlive system; inspired from
177 ;; http://slackbuilds.org/repository/13.37/office/texlive/
178 (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin"))
179 (system* "updmap-sys" "--nohash" "--syncwithtrees")
180 (system* "mktexlsr")
181 (system* "fmtutil-sys" "--all")))
42e1394b 182 %standard-phases))))
eb0119ef
AE
183 (synopsis "Tex Live, a package of the TeX typesetting system")
184 (description
185 "TeX Live provides a comprehensive TeX document production system.
186It includes all the major TeX-related programs, macro packages, and fonts
187that are free software, including support for many languages around the
188world.")
189 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
190 (home-page "http://www.tug.org/texlive/")))
231eae53
LC
191
192(define-public rubber
193 (package
194 (name "rubber")
195 (version "1.1")
196 (source (origin
197 (method url-fetch)
198 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
199 version "/+download/rubber-"
200 version ".tar.gz")
201 (string-append "http://ebeffara.free.fr/pub/rubber-"
202 version ".tar.gz")))
203 (sha256
204 (base32
205 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
206 (build-system gnu-build-system)
207 (arguments '(#:tests? #f)) ; no `check' target
208 (inputs `(("texinfo" ,texinfo)
9bee5d6c 209 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
231eae53
LC
210 ("which" ,which)))
211 (home-page "https://launchpad.net/rubber")
35b9e423 212 (synopsis "Wrapper for LaTeX and friends")
231eae53
LC
213 (description
214 "Rubber is a program whose purpose is to handle all tasks related to the
215compilation of LaTeX documents. This includes compiling the document itself,
216of course, enough times so that all references are defined, and running BibTeX
217to manage bibliographic references. Automatic execution of dvips to produce
218PostScript documents is also included, as well as usage of pdfLaTeX to produce
219PDF documents.")
220 (license license:gpl2+)))