1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
20 (define-module (gnu packages texlive)
21 #:use-module ((guix licenses) #:prefix 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 image)
33 #:use-module (gnu packages pdf)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages ruby)
38 #:use-module (gnu packages tcsh)
39 #:use-module (gnu packages which)
40 #:use-module (gnu packages xorg)
41 #:use-module (gnu packages zip)
42 #:autoload (gnu packages texinfo) (texinfo))
44 (define texlive-extra-src
47 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-extra.tar.xz")
49 "1zlnjysvxskcy05iva6jfklirwv12wqyn3ia119a7xnqlvhpqz33"))))
51 (define texlive-texmf-src
54 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-texmf.tar.xz")
56 "0qsr55ms1278dhmgixs5qqwd4fxhh369ihkki6wgh8xaqm8p48p0"))))
58 (define-public texlive
64 (uri "ftp://tug.org/historic/systems/texlive/2014/texlive-20140525-source.tar.xz")
66 "1glmaw2jv42grbsn05kay825j66scimjqqc32776bb1356q4xfq8"))))
67 (build-system gnu-build-system)
68 (inputs `(("texlive-extra-src" ,texlive-extra-src)
69 ("texlive-texmf-src" ,texlive-texmf-src)
71 ("fontconfig" ,fontconfig)
72 ("fontforge" ,fontforge)
73 ("freetype" ,freetype)
75 ("ghostscript" ,ghostscript)
76 ("graphite2" ,graphite2)
77 ("harfbuzz" ,harfbuzz)
79 ("libpaper" ,libpaper)
87 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
92 ("zziplib" ,zziplib)))
94 `(("pkg-config" ,pkg-config)))
95 (outputs '("out" "data"))
99 `("--disable-native-texlive-build"
100 ;; Although the texmf-dist data is taken from texlive-texmf,
101 ;; setting datarootdir is still useful:
102 ;; "make install" creates symbolic links to scripts in this place.
103 ,(string-append "--datarootdir=" (assoc-ref %outputs "data"))
104 ,(string-append "--infodir=" (assoc-ref %outputs "out") "/share/info")
105 ,(string-append "--mandir=" (assoc-ref %outputs "out") "/share/man")
106 "--with-system-cairo"
107 "--with-system-freetype2"
109 "--with-system-graphite2"
110 "--with-system-harfbuzz"
112 "--with-system-libgs"
113 "--with-system-libpaper"
114 "--with-system-libpng"
115 "--with-system-pixman"
116 "--with-system-poppler"
117 "--with-system-potrace"
118 "--with-system-teckit"
121 "--with-system-zziplib")
123 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
124 ;; XXX FIXME fix luajit properly on mips64.
125 #:tests? ,(not (equal? "mips64el-linux" (or (%current-target-system)
130 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
131 (let ((texlive-extra (assoc-ref inputs "texlive-extra-src"))
132 (texlive-texmf (assoc-ref inputs "texlive-texmf-src"))
133 (out (assoc-ref outputs "out"))
134 (data (assoc-ref outputs "data"))
135 (unpack (assoc-ref %standard-phases 'unpack))
136 (patch-source-shebangs
137 (assoc-ref %standard-phases 'patch-source-shebangs)))
138 ;; Create symbolic links for the latex variants and their
140 (with-directory-excursion (string-append out "/bin/")
142 '("pdftex" "pdftex" "xetex" "luatex")
143 '("latex" "pdflatex" "xelatex" "lualatex")))
144 (with-directory-excursion (string-append out "/share/man/man1/")
145 (symlink "luatex.1" "lualatex.1"))
146 ;; Delete texmf-dist from "data", since it will be reinstalled
147 ;; from texlive-texmf.
148 (system* "rm" "-r" (string-append data "/texmf-dist"))
149 ;; Unpack texlive-extra and install tlpkg.
150 (mkdir "texlive-extra")
151 (with-directory-excursion "texlive-extra"
152 (apply unpack (list #:source texlive-extra))
153 (apply patch-source-shebangs (list #:source texlive-extra))
154 (system* "mv" "tlpkg" data)
156 ;; Unpack and install texlive-texmf.
157 (mkdir "texlive-texmf")
158 (with-directory-excursion "texlive-texmf"
159 (apply unpack (list #:source texlive-texmf))
160 (apply patch-source-shebangs (list #:source texlive-texmf))
161 ;; Register "data" for kpathsea in texmf.cnf.
162 (substitute* "texmf-dist/web2c/texmf.cnf"
163 (("TEXMFROOT = \\$SELFAUTOPARENT")
164 (string-append "TEXMFROOT = " data)))
165 (system* "mv" "texmf-dist" data)
167 ;; texmf.cnf must also be placed in "out", since kpsewhich does
168 ;; not know about "data" until it has found this file.
169 (mkdir (string-append out "/share/texmf-dist"))
170 (mkdir (string-append out "/share/texmf-dist/web2c"))
171 (copy-file (string-append data "/texmf-dist/web2c/texmf.cnf")
172 (string-append out "/share/texmf-dist/web2c/texmf.cnf"))))
173 (alist-cons-after 'patch-shebangs 'texconfig
174 (lambda* (#:key outputs #:allow-other-keys)
175 (let ((out (assoc-ref outputs "out")))
176 ;; Configure the texlive system; inspired from
177 ;; http://slackbuilds.org/repository/13.37/office/texlive/
178 (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin"))
179 (system* "updmap-sys" "--nohash" "--syncwithtrees")
181 (system* "fmtutil-sys" "--all")))
183 (synopsis "Tex Live, a package of the TeX typesetting system")
185 "TeX Live provides a comprehensive TeX document production system.
186 It includes all the major TeX-related programs, macro packages, and fonts
187 that are free software, including support for many languages around the
189 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
190 (home-page "http://www.tug.org/texlive/")))
192 (define-public rubber
198 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
199 version "/+download/rubber-"
201 (string-append "http://ebeffara.free.fr/pub/rubber-"
205 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
206 (build-system gnu-build-system)
207 (arguments '(#:tests? #f)) ; no `check' target
208 (inputs `(("texinfo" ,texinfo)
209 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
211 (home-page "https://launchpad.net/rubber")
212 (synopsis "Wrapper for LaTeX and friends")
214 "Rubber is a program whose purpose is to handle all tasks related to the
215 compilation of LaTeX documents. This includes compiling the document itself,
216 of course, enough times so that all references are defined, and running BibTeX
217 to manage bibliographic references. Automatic execution of dvips to produce
218 PostScript documents is also included, as well as usage of pdfLaTeX to produce
220 (license license:gpl2+)))