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