1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
43 (define texlive-extra-src
46 (uri "ftp://tug.org/historic/systems/texlive/2013/texlive-20130530-extra.tar.xz")
48 "15r1qyn7x1iamiiycylx8vzsg27h1r962v6dz9q70f9pdp2rjr6s"))))
50 (define texlive-texmf-src
53 (uri "ftp://tug.org/historic/systems/texlive/2013/texlive-20130530-texmf.tar.xz")
55 "09kza0ha0x9cm4k2qm9w31h3g94y9hy17jahnnsirqyy8rpdqgwg"))))
57 (define-public texlive
63 (uri "ftp://tug.org/historic/systems/texlive/2013/texlive-20130530-source.tar.xz")
65 "1m3ripkmra53jwkaqcxxhabc3yvqrfm7pfxldnqirp849hp861d9"))))
66 (build-system gnu-build-system)
67 (inputs `(("texlive-extra-src" ,texlive-extra-src)
68 ("texlive-texmf-src" ,texlive-texmf-src)
70 ("fontconfig" ,fontconfig)
71 ("freetype" ,freetype)
74 ("ghostscript" ,ghostscript)
80 ;; FIXME: Add interpreters fontforge and ruby,
81 ;; once they are available.
85 ("zziplib" ,zziplib)))
88 ("pkg-config" ,pkg-config)
89 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
91 (outputs '("out" "data"))
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"
105 ;; "--with-system-graphite2" ; requires cmake build system
106 ;; "--with-system-harfbuzz" ; requires --with-system-graphite2
108 "--with-system-libgs"
109 "--with-system-libpng"
110 "--with-system-pixman"
111 "--with-system-poppler"
112 "--with-system-t1lib"
113 "--with-system-teckit"
116 "--with-system-zziplib")
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)))
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
137 (with-directory-excursion (string-append out "/bin/")
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)
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)
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")
178 (system* "fmtutil-sys" "--all")))
179 %standard-phases)))))
180 (synopsis "Tex Live, a package of the TeX typesetting system")
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
186 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
187 (home-page "http://www.tug.org/texlive/")))
189 (define-public rubber
195 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
196 version "/+download/rubber-"
198 (string-append "http://ebeffara.free.fr/pub/rubber-"
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)
208 (home-page "https://launchpad.net/rubber")
209 (synopsis "Rubber, a wrapper for LaTeX and friends")
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
217 (license license:gpl2+)))