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