gnu: gettext: Upgrade to 0.18.3.
[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>
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)
a86177d6 27 #:use-module (gnu packages fontutils)
eb0119ef
AE
28 #:use-module (gnu packages ghostscript)
29 #:use-module (gnu packages icu4c)
30 #:use-module (gnu packages libpng)
31 #:use-module (gnu packages pdf)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
231eae53 34 #:use-module (gnu packages which)
eb0119ef 35 #:use-module (gnu packages python)
95b6c70f 36 #:use-module (gnu packages tcsh)
c0589f75 37 #:use-module (gnu packages xorg)
231eae53
LC
38 #:use-module (gnu packages zip)
39 #:autoload (gnu packages texinfo) (texinfo))
eb0119ef
AE
40
41(define texlive-extra-src
42 (origin
43 (method url-fetch)
44 (uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-extra.tar.xz")
45 (sha256 (base32
46 "0cb8fnv4x281gy5ka779f00ssdmdpjj4x3pkh9j9vq45hrwg3522"))))
47
48(define texlive-texmf-src
49 (origin
50 (method url-fetch)
51 (uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-texmf.tar.xz")
52 (sha256 (base32
53 "1fn1dg9k7pnh8a80j23zfkbrfnqyc4c2w4ss30dpkqj490nxsywq"))))
54
55(define-public texlive
56 (package
57 (name "texlive")
58 (version "2012")
59 (source (origin
60 (method url-fetch)
61 (uri "ftp://tug.org/historic/systems/texlive/2012/texlive-20120701-source.tar.xz")
62 (sha256 (base32
63 "10bcrdfsqnc6y3gqcb8ndnjy07i5kz63as39irbq4gmcbmyn2rln"))))
64 (build-system gnu-build-system)
65 (inputs `(("texlive-extra-src" ,texlive-extra-src)
66 ("texlive-texmf-src" ,texlive-texmf-src)
67 ("fontconfig" ,fontconfig)
68 ("freetype" ,freetype)
69 ("icu4c" ,icu4c)
70 ("ghostscript" ,ghostscript)
71 ("libpng" ,libpng)
c0589f75
AE
72 ("libxaw" ,libxaw)
73 ("libxt" ,libxt)
eb0119ef
AE
74 ("perl" ,perl)
75 ("poppler" ,poppler)
76 ("pkg-config" ,pkg-config)
95b6c70f 77 ;; FIXME: Add interpreters fontforge and ruby,
eb0119ef
AE
78 ;; once they are available.
79 ("python" ,python)
95b6c70f 80 ("tcsh" ,tcsh)
eb0119ef
AE
81 ("teckit" ,teckit)
82 ("t1lib" ,t1lib)
83 ("zlib" ,zlib)
84 ("zziplib" ,zziplib)))
85 (outputs '("out" "data"))
86 (arguments
87 `(#:out-of-source? #t
88 #:configure-flags
89 `("--disable-native-texlive-build"
90 ;; Although the texmf and texmf-dist data is taken from
91 ;; texlive-texmf, setting datarootdir is still useful:
92 ;; "make install" creates symbolic links to scripts in this place.
93 ,(string-append "--datarootdir=" (assoc-ref %outputs "data"))
94 ,(string-append "--infodir=" (assoc-ref %outputs "out") "/share/info")
95 ,(string-append "--mandir=" (assoc-ref %outputs "out") "/share/man")
eb0119ef
AE
96 "--with-system-freetype2"
97 ;; "--with-system-gd"
98 ;; "--with-system-graphite"
99 "--with-system-icu"
100 "--with-system-libgs"
101 "--with-system-libpng"
102 "--with-system-poppler"
103 "--with-system-t1lib"
104 "--with-system-teckit"
105 "--with-system-xpdf"
106 "--with-system-zlib"
107 "--with-system-zziplib")
108 #:phases
109 (alist-replace
110 'configure
111 (lambda* (#:key outputs #:allow-other-keys #:rest args)
112 (let ((configure (assoc-ref %standard-phases 'configure)))
113 (substitute* "utils/psutils/Makefile.in"
114 (("/usr/bin/env perl") (which "perl")))
115 (apply configure args)))
116 (alist-cons-after
117 'install 'postinst
118 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
119 (let ((texlive-extra (assoc-ref inputs "texlive-extra-src"))
120 (texlive-texmf (assoc-ref inputs "texlive-texmf-src"))
121 (out (assoc-ref outputs "out"))
122 (data (assoc-ref outputs "data"))
123 (unpack (assoc-ref %standard-phases 'unpack))
124 (patch-source-shebangs
125 (assoc-ref %standard-phases 'patch-source-shebangs)))
126 ;; Create symbolic links for the latex variants and their
127 ;; man pages.
128 (with-directory-excursion (string-append out "/bin/")
129 (for-each symlink
130 '("pdftex" "pdftex" "xetex" "luatex")
131 '("latex" "pdflatex" "xelatex" "lualatex")))
132 (with-directory-excursion (string-append out "/share/man/man1/")
133 (symlink "luatex.1" "lualatex.1"))
134 ;; Delete texmf and texmf-dist from "data", since they
135 ;; will be reinstalled from texlive-texmf.
136 (system* "rm" "-r" (string-append data "/texmf"))
137 (system* "rm" "-r" (string-append data "/texmf-dist"))
138 ;; Unpack texlive-extra and install tlpkg.
139 (mkdir "texlive-extra")
140 (with-directory-excursion "texlive-extra"
141 (apply unpack (list #:source texlive-extra))
142 (apply patch-source-shebangs (list #:source texlive-extra))
143 (system* "mv" "tlpkg" data)
144 (chdir ".."))
145 ;; Unpack and install texlive-texmf.
146 (mkdir "texlive-texmf")
147 (with-directory-excursion "texlive-texmf"
148 (apply unpack (list #:source texlive-texmf))
149 (apply patch-source-shebangs (list #:source texlive-texmf))
150 ;; Register "data" for kpathsea in texmf.cnf.
151 (substitute* "texmf/web2c/texmf.cnf"
152 (("TEXMFROOT = \\$SELFAUTOPARENT")
153 (string-append "TEXMFROOT = " data)))
154 (system* "mv" "texmf" data)
155 (system* "mv" "texmf-dist" data)
156 (chdir ".."))
157 ;; texmf.cnf must also be placed in "out", since kpsewhich does
158 ;; not know about "data" until it has found this file.
159 (mkdir (string-append out "/share/texmf"))
160 (mkdir (string-append out "/share/texmf/web2c"))
161 (copy-file (string-append data "/texmf/web2c/texmf.cnf")
162 (string-append out "/share/texmf/web2c/texmf.cnf"))))
163 (alist-cons-after 'patch-shebangs 'texconfig
164 (lambda* (#:key outputs #:allow-other-keys)
165 (let ((out (assoc-ref outputs "out")))
166 ;; Configure the texlive system; inspired from
167 ;; http://slackbuilds.org/repository/13.37/office/texlive/
168 (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin"))
169 (system* "updmap-sys" "--nohash" "--syncwithtrees")
170 (system* "mktexlsr")
171 (system* "fmtutil-sys" "--all")))
172 %standard-phases)))))
173 (synopsis "Tex Live, a package of the TeX typesetting system")
174 (description
175 "TeX Live provides a comprehensive TeX document production system.
176It includes all the major TeX-related programs, macro packages, and fonts
177that are free software, including support for many languages around the
178world.")
179 (license (license:fsf-free "http://tug.org/texlive/copying.html"))
180 (home-page "http://www.tug.org/texlive/")))
231eae53
LC
181
182(define-public rubber
183 (package
184 (name "rubber")
185 (version "1.1")
186 (source (origin
187 (method url-fetch)
188 (uri (list (string-append "https://launchpad.net/rubber/trunk/"
189 version "/+download/rubber-"
190 version ".tar.gz")
191 (string-append "http://ebeffara.free.fr/pub/rubber-"
192 version ".tar.gz")))
193 (sha256
194 (base32
195 "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
196 (build-system gnu-build-system)
197 (arguments '(#:tests? #f)) ; no `check' target
198 (inputs `(("texinfo" ,texinfo)
199 ("python" ,python)
200 ("which" ,which)))
201 (home-page "https://launchpad.net/rubber")
202 (synopsis "Rubber, a wrapper for LaTeX and friends")
203 (description
204 "Rubber is a program whose purpose is to handle all tasks related to the
205compilation of LaTeX documents. This includes compiling the document itself,
206of course, enough times so that all references are defined, and running BibTeX
207to manage bibliographic references. Automatic execution of dvips to produce
208PostScript documents is also included, as well as usage of pdfLaTeX to produce
209PDF documents.")
210 (license license:gpl2+)))