1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
21 (define-module (gnu packages texlive)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system trivial)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages bash)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages fontutils)
31 #:use-module (gnu packages gd)
32 #:use-module (gnu packages ghostscript)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages icu4c)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages lua)
37 #:use-module (gnu packages pdf)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages ruby)
42 #:use-module (gnu packages tcsh)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages xorg)
45 #:use-module (gnu packages xdisorg)
46 #:use-module (gnu packages zip)
47 #:autoload (gnu packages texinfo) (texinfo))
49 (define texlive-extra-src
52 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-extra.tar.xz")
54 "1zlnjysvxskcy05iva6jfklirwv12wqyn3ia119a7xnqlvhpqz33"))))
56 (define texlive-texmf-src
59 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-texmf.tar.xz")
61 "0qsr55ms1278dhmgixs5qqwd4fxhh369ihkki6wgh8xaqm8p48p0"))))
63 (define-public texlive-bin
70 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-source.tar.xz")
72 "1glmaw2jv42grbsn05kay825j66scimjqqc32776bb1356q4xfq8"))))
73 (build-system gnu-build-system)
75 `(("texlive-extra-src" ,texlive-extra-src)
77 ("fontconfig" ,fontconfig)
78 ("fontforge" ,fontforge)
79 ("freetype" ,freetype)
81 ("ghostscript" ,ghostscript)
82 ("graphite2" ,graphite2)
83 ("harfbuzz" ,harfbuzz)
85 ("libpaper" ,libpaper)
93 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
98 ("zziplib" ,zziplib)))
100 `(("pkg-config" ,pkg-config)))
102 `(#:out-of-source? #t
104 `("--disable-native-texlive-build"
105 "--with-system-cairo"
106 "--with-system-freetype2"
108 "--with-system-graphite2"
109 "--with-system-harfbuzz"
111 "--with-system-libgs"
112 "--with-system-libpaper"
113 "--with-system-libpng"
114 "--with-system-pixman"
115 "--with-system-poppler"
116 "--with-system-potrace"
117 "--with-system-teckit"
120 "--with-system-zziplib")
122 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
123 ;; XXX FIXME fix luajit properly on mips64.
124 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
129 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
130 (let* ((out (assoc-ref outputs "out"))
131 (share (string-append out "/share"))
132 (texlive-extra (assoc-ref inputs "texlive-extra-src"))
133 (unpack (assoc-ref %standard-phases 'unpack))
134 (patch-source-shebangs
135 (assoc-ref %standard-phases 'patch-source-shebangs)))
136 ;; Create symbolic links for the latex variants and their
138 (with-directory-excursion (string-append out "/bin/")
140 '("pdftex" "pdftex" "xetex" "luatex")
141 '("latex" "pdflatex" "xelatex" "lualatex")))
142 (with-directory-excursion (string-append share "/man/man1/")
143 (symlink "luatex.1" "lualatex.1"))
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" share))))
151 (synopsis "TeX Live, a package of the TeX typesetting system")
153 "TeX Live provides a comprehensive TeX document production system.
154 It includes all the major TeX-related programs, macro packages, and fonts
155 that are free software, including support for many languages around the
158 This package contains the binaries.")
159 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
160 (home-page "http://www.tug.org/texlive/")))
162 (define-public texlive-texmf
164 (name "texlive-texmf")
166 (source texlive-texmf-src)
167 (build-system gnu-build-system)
169 `(("texlive-bin" ,texlive-bin)
172 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
176 `(#:modules ((guix build gnu-build-system)
181 'texmf-config 'install
182 (lambda* (#:key outputs #:allow-other-keys)
183 (let ((share (string-append (assoc-ref outputs "out") "/share")))
185 (system* "mv" "texmf-dist" share)))
187 'patch-source-shebangs 'texmf-config
188 (lambda* (#:key inputs outputs #:allow-other-keys)
189 (let* ((share (string-append (assoc-ref outputs "out") "/share"))
190 (texmfroot (string-append share "/texmf-dist/web2c"))
191 (texmfcnf (string-append texmfroot "/texmf.cnf"))
192 (texbin (string-append (assoc-ref inputs "texlive-bin")
194 ;; Register SHARE as TEXMFROOT in texmf.cnf.
195 (substitute* texmfcnf
196 (("TEXMFROOT = \\$SELFAUTOPARENT")
197 (string-append "TEXMFROOT = " share)))
198 ;; Configure the texmf-dist tree; inspired from
199 ;; http://slackbuilds.org/repository/13.37/office/texlive/
200 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
201 (setenv "TEXMFCNF" texmfroot)
202 (system* "updmap-sys" "--nohash" "--syncwithtrees")
204 (system* "fmtutil-sys" "--all")))
205 (map (cut assq <> %standard-phases)
206 '(set-paths unpack patch-source-shebangs))))))
207 (synopsis "TeX Live, a package of the TeX typesetting system")
209 "TeX Live provides a comprehensive TeX document production system.
210 It includes all the major TeX-related programs, macro packages, and fonts
211 that are free software, including support for many languages around the
214 This package contains the complete tree of texmf-dist data.")
215 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
216 (home-page "http://www.tug.org/texlive/")))
218 (define-public texlive
223 (build-system trivial-build-system)
224 (inputs `(("bash" ,bash) ; for wrap-program
225 ("texlive-bin" ,texlive-bin)
226 ("texlive-texmf" ,texlive-texmf)))
228 `(#:modules ((guix build utils))
230 ;; Build the union of texlive-bin and texlive-texmf, but take the
231 ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
233 (use-modules (guix build utils))
234 (let ((out (assoc-ref %outputs "out"))
235 (bin (assoc-ref %build-inputs "texlive-bin"))
236 (texmf (assoc-ref %build-inputs "texlive-texmf"))
237 (bash (assoc-ref %build-inputs "bash")))
239 (with-directory-excursion out
242 (symlink (string-append bin "/" name) name))
245 (with-directory-excursion "bin"
246 (setenv "PATH" (string-append bash "/bin"))
249 (symlink name (basename name))
253 (,(string-append texmf "/share/texmf-dist/web2c")))))
254 (find-files (string-append bin "/bin/") "")))
256 (with-directory-excursion "share"
259 (symlink (string-append bin "/share/" name) name))
260 '("info" "man" "tlpkg"))
263 (symlink (string-append texmf "/share/" name) name))
264 '("texmf-dist" "texmf-var"))))))))
265 (synopsis "TeX Live, a package of the TeX typesetting system")
267 "TeX Live provides a comprehensive TeX document production system.
268 It includes all the major TeX-related programs, macro packages, and fonts
269 that are free software, including support for many languages around the
272 This package contains the complete TeX Live distribution.")
273 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
274 (home-page "http://www.tug.org/texlive/")))
276 (define-public rubber
282 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
283 version "/+download/rubber-"
285 (string-append "http://ebeffara.free.fr/pub/rubber-"
289 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
290 (build-system gnu-build-system)
291 (arguments '(#:tests? #f)) ; no `check' target
292 (inputs `(("texinfo" ,texinfo)
293 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
295 (home-page "https://launchpad.net/rubber")
296 (synopsis "Wrapper for LaTeX and friends")
298 "Rubber is a program whose purpose is to handle all tasks related to the
299 compilation of LaTeX documents. This includes compiling the document itself,
300 of course, enough times so that all references are defined, and running BibTeX
301 to manage bibliographic references. Automatic execution of dvips to produce
302 PostScript documents is also included, as well as usage of pdfLaTeX to produce
304 (license license:gpl2+)))