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