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