You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

216 lines
9.5 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Andreas Enge <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages texlive)
#:use-module ((guix licenses)
#:renamer (symbol-prefix-proc 'license:))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages compression)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gd)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages gtk)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages libpng)
#:use-module (gnu packages pdf)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages which)
#:use-module (gnu packages python)
#:use-module (gnu packages tcsh)
#:use-module (gnu packages xorg)
#:use-module (gnu packages zip)
#:autoload (gnu packages texinfo) (texinfo))
(define texlive-extra-src
(method url-fetch)
(uri "")
(sha256 (base32
(define texlive-texmf-src
(method url-fetch)
(uri "")
(sha256 (base32
(define-public texlive
(name "texlive")
(version "2013")
(source (origin
(method url-fetch)
(uri "")
(sha256 (base32
(build-system gnu-build-system)
(inputs `(("texlive-extra-src" ,texlive-extra-src)
("texlive-texmf-src" ,texlive-texmf-src)
("cairo" ,cairo)
("fontconfig" ,fontconfig)
("freetype" ,freetype)
("gd" ,gd)
("icu4c" ,icu4c)
("ghostscript" ,ghostscript)
("libpng" ,libpng)
("libxaw" ,libxaw)
("libxt" ,libxt)
("perl" ,perl)
("pixman" ,pixman)
("poppler" ,poppler)
("pkg-config" ,pkg-config)
;; FIXME: Add interpreters fontforge and ruby,
;; once they are available.
("python" ,python-2) ; incompatible with Python 3 (print syntax)
("tcsh" ,tcsh)
("teckit" ,teckit)
("t1lib" ,t1lib)
("zlib" ,zlib)
("zziplib" ,zziplib)))
(outputs '("out" "data"))
`(#:out-of-source? #t
;; Although the texmf-dist data is taken from texlive-texmf,
;; setting datarootdir is still useful:
;; "make install" creates symbolic links to scripts in this place.
,(string-append "--datarootdir=" (assoc-ref %outputs "data"))
,(string-append "--infodir=" (assoc-ref %outputs "out") "/share/info")
,(string-append "--mandir=" (assoc-ref %outputs "out") "/share/man")
;; "--with-system-graphite2" ; requires cmake build system
;; "--with-system-harfbuzz" ; requires --with-system-graphite2
(lambda* (#:key outputs #:allow-other-keys #:rest args)
(let ((configure (assoc-ref %standard-phases 'configure)))
(substitute* "utils/psutils/"
(("/usr/bin/env perl") (which "perl")))
(apply configure args)))
'install 'postinst
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
(let ((texlive-extra (assoc-ref inputs "texlive-extra-src"))
(texlive-texmf (assoc-ref inputs "texlive-texmf-src"))
(out (assoc-ref outputs "out"))
(data (assoc-ref outputs "data"))
(unpack (assoc-ref %standard-phases 'unpack))
(assoc-ref %standard-phases 'patch-source-shebangs)))
;; Create symbolic links for the latex variants and their
;; man pages.
(with-directory-excursion (string-append out "/bin/")
(for-each symlink
'("pdftex" "pdftex" "xetex" "luatex")
'("latex" "pdflatex" "xelatex" "lualatex")))
(with-directory-excursion (string-append out "/share/man/man1/")
(symlink "luatex.1" "lualatex.1"))
;; Delete texmf-dist from "data", since it will be reinstalled
;; from texlive-texmf.
(system* "rm" "-r" (string-append data "/texmf-dist"))
;; Unpack texlive-extra and install tlpkg.
(mkdir "texlive-extra")
(with-directory-excursion "texlive-extra"
(apply unpack (list #:source texlive-extra))
(apply patch-source-shebangs (list #:source texlive-extra))
(system* "mv" "tlpkg" data)
(chdir ".."))
;; Unpack and install texlive-texmf.
(mkdir "texlive-texmf")
(with-directory-excursion "texlive-texmf"
(apply unpack (list #:source texlive-texmf))
(apply patch-source-shebangs (list #:source texlive-texmf))
;; Register "data" for kpathsea in texmf.cnf.
(substitute* "texmf-dist/web2c/texmf.cnf"
(string-append "TEXMFROOT = " data)))
(system* "mv" "texmf-dist" data)
(chdir ".."))
;; texmf.cnf must also be placed in "out", since kpsewhich does
;; not know about "data" until it has found this file.
(mkdir (string-append out "/share/texmf-dist"))
(mkdir (string-append out "/share/texmf-dist/web2c"))
(copy-file (string-append data "/texmf-dist/web2c/texmf.cnf")
(string-append out "/share/texmf-dist/web2c/texmf.cnf"))))
(alist-cons-after 'patch-shebangs 'texconfig
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
;; Configure the texlive system; inspired from
(setenv "PATH" (string-append (getenv "PATH") ":" out "/bin"))
(system* "updmap-sys" "--nohash" "--syncwithtrees")
(system* "mktexlsr")
(system* "fmtutil-sys" "--all")))
(synopsis "Tex Live, a package of the TeX typesetting system")
"TeX Live provides a comprehensive TeX document production system.
It includes all the major TeX-related programs, macro packages, and fonts
that are free software, including support for many languages around the
(license (license:fsf-free ""))
(home-page "")))
(define-public rubber
(name "rubber")
(version "1.1")
(source (origin
(method url-fetch)
(uri (list (string-append ""
version "/+download/rubber-"
version ".tar.gz")
(string-append ""
version ".tar.gz")))
(build-system gnu-build-system)
(arguments '(#:tests? #f)) ; no `check' target
(inputs `(("texinfo" ,texinfo)
("python" ,python-2) ; incompatible with Python 3 (print syntax)
("which" ,which)))
(home-page "")
(synopsis "Rubber, a wrapper for LaTeX and friends")
"Rubber is a program whose purpose is to handle all tasks related to the
compilation of LaTeX documents. This includes compiling the document itself,
of course, enough times so that all references are defined, and running BibTeX
to manage bibliographic references. Automatic execution of dvips to produce
PostScript documents is also included, as well as usage of pdfLaTeX to produce
PDF documents.")
(license license:gpl2+)))