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