Mirror of GNU Guix
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.

4114 lines
178 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; 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
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; 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 <http://www.gnu.org/licenses/>.
(define-module (gnu packages tex)
Use #:prefix instead of #:renamer with 'symbol-prefix-proc'. * gnu/packages/abiword.scm, gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/backup.scm, gnu/packages/bittorrent.scm, gnu/packages/boost.scm, gnu/packages/compression.scm, gnu/packages/cryptsetup.scm, gnu/packages/curl.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/dc.scm, gnu/packages/emacs.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/geeqie.scm, gnu/packages/ghostscript.scm, gnu/packages/gimp.scm, gnu/packages/gkrellm.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnutls.scm, gnu/packages/gnuzilla.scm, gnu/packages/gsasl.scm, gnu/packages/gtk.scm, gnu/packages/gv.scm, gnu/packages/image.scm, gnu/packages/indent.scm, gnu/packages/inkscape.scm, gnu/packages/lesstif.scm, gnu/packages/links.scm, gnu/packages/lisp.scm, gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/maths.scm, gnu/packages/mp3.scm, gnu/packages/openssl.scm, gnu/packages/ots.scm, gnu/packages/pciutils.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python.scm, gnu/packages/slim.scm, gnu/packages/ssh.scm, gnu/packages/texlive.scm, gnu/packages/vim.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wv.scm, gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/packages/yasm.scm, gnu/packages/zip.scm, guix/build/cmake-build-system.scm, guix/build/perl-build-system.scm, guix/build/python-build-system.scm, guix/download.scm: Replaces uses of #:renamer and 'symbol-prefix-proc' with #:prefix.
8 years ago
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system perl)
#:use-module (guix build-system trivial)
#:use-module (guix build-system texlive)
#:use-module (guix utils)
#:use-module (guix git-download)
#:use-module (guix svn-download)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
#: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 image)
#:use-module (gnu packages lua)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages pdf)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages qt)
#:use-module (gnu packages ruby)
#:use-module (gnu packages shells)
#:use-module (gnu packages base)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (gnu packages xdisorg)
#:autoload (gnu packages texinfo) (texinfo)
#:use-module (ice-9 ftw)
#:use-module (ice-9 match)
#:use-module ((srfi srfi-1) #:hide (zip)))
(define texlive-extra-src
(origin
(method url-fetch)
(uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523-extra.tar.xz")
(sha256 (base32
"0q4a92zmwhn4ry6xgrp4k8wq11ax2sg9rg9yrsrdkr719y0x887a"))))
(define texlive-texmf-src
(origin
(method url-fetch)
(uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-texmf.tar.xz")
(patches (search-patches "texlive-texmf-CVE-2016-10243.patch"))
(patch-flags '("-p2"))
(sha256 (base32
"1dv8vgfzpczqw82hv9g7a8djhhyzywljmrarlcyy6g2qi5q51glr"))))
(define-public texlive-bin
(package
(name "texlive-bin")
(version "2016")
(source
(origin
(method url-fetch)
(uri "ftp://tug.org/historic/systems/texlive/2016/texlive-20160523b-source.tar.xz")
(sha256 (base32
"1v91vahxlxkdra0qz3f132vvx5d9cx2jy84yl1hkch0agyj2rcx8"))))
(build-system gnu-build-system)
(inputs
`(("texlive-extra-src" ,texlive-extra-src)
("cairo" ,cairo)
("fontconfig" ,fontconfig)
("fontforge" ,fontforge)
("freetype" ,freetype)
("gd" ,gd)
("gmp" ,gmp)
("ghostscript" ,ghostscript)
("graphite2" ,graphite2)
("harfbuzz" ,harfbuzz)
("icu4c" ,icu4c)
("libpaper" ,libpaper)
("libpng" ,libpng)
("libxaw" ,libxaw)
("libxt" ,libxt)
("mpfr" ,mpfr)
("perl" ,perl)
("pixman" ,pixman)
("poppler" ,poppler)
("potrace" ,potrace)
("python" ,python-2) ; incompatible with Python 3 (print syntax)
("ruby" ,ruby)
("tcsh" ,tcsh)
("teckit" ,teckit)
("zlib" ,zlib)
("zziplib" ,zziplib)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(arguments
`(#:out-of-source? #t
#:configure-flags
`("--disable-native-texlive-build"
"--with-system-cairo"
"--with-system-freetype2"
"--with-system-gd"
"--with-system-gmp"
"--with-system-graphite2"
"--with-system-harfbuzz"
"--with-system-icu"
"--with-system-libgs"
"--with-system-libpaper"
"--with-system-libpng"
"--with-system-mpfr"
"--with-system-pixman"
"--with-system-poppler"
"--with-system-potrace"
"--with-system-teckit"
"--with-system-xpdf"
"--with-system-zlib"
"--with-system-zziplib")
;; Disable tests on mips64 to cope with a failure of luajiterr.test.
;; XXX FIXME fix luajit properly on mips64.
#:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
(%current-system))))
#:phases
(modify-phases %standard-phases
(add-after 'install 'postint
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
(let* ((out (assoc-ref outputs "out"))
(share (string-append out "/share"))
(texlive-extra (assoc-ref inputs "texlive-extra-src"))
(unpack (assoc-ref %standard-phases 'unpack))
(patch-source-shebangs
(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 share "/man/man1/")
(symlink "luatex.1" "lualatex.1"))
;; 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" share))))))))
(synopsis "TeX Live, a package of the TeX typesetting system")
(description
"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
world.
This package contains the binaries.")
(license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
(home-page "https://www.tug.org/texlive/")))
(define-public texlive-dvips
(package
(name "texlive-dvips")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/dvips"))
(revision %texlive-revision)))
(sha256
(base32
"0fcy2hpapbj01ncpjj3v39yhr0jjxb6rm13qaxjjw66s3vydxls1"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let* ((root (string-append (assoc-ref %outputs "out")
"/share/texmf-dist"))
(dvips (string-append root "/dvips"))
(maps (string-append root "/fonts/map/dvips/tetex"))
(encs (string-append root "/fonts/enc/dvips/base")))
(mkdir-p dvips)
(copy-recursively (assoc-ref %build-inputs "source") dvips)
(mkdir-p maps)
(copy-recursively (assoc-ref %build-inputs "dvips-font-maps") maps)
(mkdir-p encs)
(copy-recursively (assoc-ref %build-inputs "dvips-base-enc") encs)
#t))))
(native-inputs
`(("dvips-font-maps"
,(origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/fonts/map/dvips/tetex"))
(revision %texlive-revision)))
(sha256
(base32
"100208pg7q6lj7swiq9p9287nn6b64bl62bnlaxpjni9y2kdrqy5"))))
("dvips-base-enc"
,(origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/fonts/enc/dvips/base"))
(revision %texlive-revision)))
(sha256
(base32
"1xnf6ms0h87r55kxik4vicwr1907scj789lhqflqns8svvsli5iy"))))))
(home-page "http://www.ctan.org/pkg/dvips")
(synopsis "DVI to PostScript drivers")
(description "This package provides files needed for converting DVI files
to PostScript.")
;; Various free software licenses apply to individual files.
(license (list license:lppl1.3c+
license:expat
license:lgpl3+))))
(define-public texlive-generic-unicode-data
(package
(name "texlive-generic-unicode-data")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/tex/generic/unicode-data"))
(revision %texlive-revision)))
(sha256
(base32
"0ivrhp6jz31pl4z841g4ws41lmvdiwz4sslmhf02inlib79gz6r2"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let ((target (string-append (assoc-ref %outputs "out")
"/share/texmf-dist/tex/generic/unicode-data")))
(mkdir-p target)
(copy-recursively (assoc-ref %build-inputs "source") target)
#t))))
(home-page "http://www.ctan.org/pkg/unicode-data")
(synopsis "Unicode data and loaders for TeX")
(description "This bundle provides generic access to Unicode Consortium
data for TeX use. It contains a set of text files provided by the Unicode
Consortium which are currently all from Unicode 8.0.0, with the exception of
@code{MathClass.txt} which is not currently part of the Unicode Character
Database. Accompanying these source data are generic TeX loader files
allowing this data to be used as part of TeX runs, in particular in building
format files. Currently there are two loader files: one for general character
set up and one for initializing XeTeX character classes as has been carried
out to date by @code{unicode-letters.tex}. ")
(license license:lppl1.3c+)))
(define-public texlive-generic-dehyph-exptl
(package
(name "texlive-generic-dehyph-exptl")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/tex/generic/dehyph-exptl"))
(revision %texlive-revision)))
(sha256
(base32
"1l9wgv99qq0ysvlxqpj4g8bl0dywbzra4g8m2kmpg2fb0i0hczap"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let ((target (string-append (assoc-ref %outputs "out")
"/share/texmf-dist/tex/generic/dehyph-exptl")))
(mkdir-p target)
(copy-recursively (assoc-ref %build-inputs "source") target)
#t))))
(home-page "http://projekte.dante.de/Trennmuster/WebHome")
(synopsis "Hyphenation patterns for German")
(description "The package provides experimental hyphenation patterns for
the German language, covering both traditional and reformed orthography. The
patterns can be used with packages Babel and hyphsubst from the Oberdiek
bundle.")
;; Hyphenation patterns are under the Expat license; documentation is
;; under LPPL.
(license (list license:expat license:lppl))))
(define-public texlive-generic-tex-ini-files
(package
(name "texlive-generic-tex-ini-files")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/tex/generic/tex-ini-files"))
(revision %texlive-revision)))
(sha256
(base32
"1wh42n1lmzcvi3g6mm31nm3yd5ha5bl260xqc444jg1m9fdp3wz5"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let ((target (string-append (assoc-ref %outputs "out")
"/share/texmf-dist/tex/generic/tex-ini-files")))
(mkdir-p target)
(copy-recursively (assoc-ref %build-inputs "source") target)
#t))))
(home-page "http://ctan.org/pkg/tex-ini-files")
(synopsis "Files for creating TeX formats")
(description "This bundle provides a collection of model \".ini\" files
for creating TeX formats. These files are commonly used to introduced
distribution-dependent variations in formats. They are also used to
allow existing format source files to be used with newer engines, for example
to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
(license license:public-domain)))
(define-public texlive-generic-hyph-utf8
(package
(name "texlive-generic-hyph-utf8")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/tex/generic/hyph-utf8"))
(revision %texlive-revision)))
(sha256
(base32
"0ghizcz7ps16dzfqf66wwg5i181assc6qsm0g7g5dbmp909931vi"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let ((target (string-append (assoc-ref %outputs "out")
"/share/texmf-dist/tex/generic/hyph-utf8")))
(mkdir-p target)
(copy-recursively (assoc-ref %build-inputs "source") target)
#t))))
(home-page "http://ctan.org/pkg/hyph-utf8")
(synopsis "Hyphenation patterns expressed in UTF-8")
(description "Modern native UTF-8 engines such as XeTeX and LuaTeX need
hyphenation patterns in UTF-8 format, whereas older systems require
hyphenation patterns in the 8-bit encoding of the font in use (such encodings
are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
etc). The present package offers a collection of conversions of existing
patterns to UTF-8 format, together with converters for use with 8-bit fonts in
older systems. Since hyphenation patterns for Knuthian-style TeX systems are
only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
converters, will completely supplant the older patterns.")
;; Individual files each have their own license. Most of these files are
;; independent hyphenation patterns.
(license (list license:lppl1.0+
license:lppl1.2+
license:lppl1.3
license:lppl1.3+
license:lppl1.3a+
license:lgpl2.1
license:lgpl2.1+
license:lgpl3+
license:gpl2+
license:gpl3+
license:mpl1.1
license:asl2.0
license:expat
license:bsd-3
license:cc0
license:public-domain
license:wtfpl2))))
(define-public texlive-metafont-base
(package
(name "texlive-metafont-base")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/metafont"))
(revision %texlive-revision)))
(sha256
(base32
"1yl4n8cn5xqk2nc22zgzq6ymd7bhm6xx1mz3azip7i3ki4bhb5q5"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no test target
#:phases
(modify-phases %standard-phases
(delete 'configure)
(replace 'build
(lambda* (#:key inputs #:allow-other-keys)
(let ((cwd (getcwd)))
(setenv "MFINPUTS"
(string-append cwd "/base:"
cwd "/misc:"
cwd "/roex:"
cwd "/feynmf:"
cwd "/mfpic:"
cwd "/config")))
(mkdir "build")
(with-directory-excursion "build"
(zero? (system* "inimf" "mf.mf")))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(base (string-append out "/share/texmf-dist/web2c"))
(mf (string-append out "/share/texmf-dist/metafont/base")))
(mkdir-p base)
(mkdir-p mf)
(install-file "build/mf.base" base)
(copy-recursively "base" mf)
#t))))))
(native-inputs
`(("texlive-bin" ,texlive-bin)))
(home-page "http://www.ctan.org/pkg/metafont")
(synopsis "Metafont base files")
(description "This package provides the Metafont base files needed to
build fonts using the Metafont system.")
(license license:knuth)))
(define-public texlive-fontname
(package
(name "texlive-fontname")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/fonts/map/fontname"))
(revision %texlive-revision)))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"0cssbzcx15221dynp5sii72qh4l18mwkr14n8w1xb19j8pbaqasz"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let ((target (string-append (assoc-ref %outputs "out")
"/share/texmf-dist/fonts/map/fontname")))
(mkdir-p target)
(copy-recursively (assoc-ref %build-inputs "source") target)
#t))))
(home-page "https://www.ctan.org/pkg/fontname")
(synopsis "Scheme for naming fonts in TeX")
(description "This is Fontname, a naming scheme for (the base part of)
external TeX font filenames. This makes at most eight-character names
from (almost) arbitrarily complex font names, thus helping portability of TeX
documents.")
(license license:public-domain)))
(define-public texlive-fonts-cm
(package
(name "texlive-fonts-cm")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/fonts/source/public/cm"))
(revision %texlive-revision)))
(sha256
(base32
"045k5b9rdmbxpy1a3006l1x96z1rd18vg3cwrvnld9bqybw5qz44"))))
(build-system gnu-build-system)
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(srfi srfi-26))
#:tests? #f ; no tests
#:phases
(modify-phases %standard-phases
(delete 'configure)
(replace 'build
(lambda* (#:key inputs #:allow-other-keys)
(let ((mf (assoc-ref inputs "texlive-metafont-base")))
;; Tell mf where to find mf.base
(setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
;; Tell mf where to look for source files
(setenv "MFINPUTS"
(string-append (getcwd) ":"
mf "/share/texmf-dist/metafont/base")))
(mkdir "build")
(every (lambda (font)
(format #t "building font ~a\n" font)
(zero? (system* "mf" "-progname=mf"
"-output-directory=build"
(string-append "\\"
"mode:=ljfour; "
"mag:=1; "
"batchmode; "
"input "
(basename font ".mf")))))
(find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(tfm (string-append
out "/share/texmf-dist/fonts/tfm/public/cm"))
(mf (string-append
out "/share/texmf-dist/fonts/source/public/cm")))
(for-each (cut install-file <> tfm)
(find-files "build" "\\.*"))
(for-each (cut install-file <> mf)
(find-files "." "\\.mf"))
#t))))))
(native-inputs
`(("texlive-bin" ,texlive-bin)
("texlive-metafont-base" ,texlive-metafont-base)))
(home-page "http://www.ctan.org/pkg/cm")
(synopsis "Computer Modern fonts for TeX")
(description "This package provides the Computer Modern fonts by Donald
Knuth. The Computer Modern font family is a large collection of text,
display, and mathematical fonts in a range of styles, based on Monotype Modern
8A.")
(license license:knuth)))
(define-public texlive-fonts-knuth-lib
(package
(name "texlive-fonts-knuth-lib")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/fonts/source/public/knuth-lib"))
(revision %texlive-revision)))
(sha256
(base32
"0in9aqyi8jkyf9d16z0li50z5fpwj1iwgwm83gmvwqcf7chfs04y"))))
(build-system gnu-build-system)
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-26))
#:tests? #f ; no tests
#:phases
(modify-phases %standard-phases
(delete 'configure)
(replace 'build
(lambda* (#:key inputs #:allow-other-keys)
(let ((mf (assoc-ref inputs "texlive-metafont-base")))
;; Tell mf where to find mf.base
(setenv "MFBASES"
(string-append mf "/share/texmf-dist/web2c"))
;; Tell mf where to look for source files
(setenv "MFINPUTS"
(string-append (getcwd) ":"
mf "/share/texmf-dist/metafont/base")))
(mkdir "build")
(zero? (system* "mf" "-progname=mf"
"-output-directory=build"
(string-append "\\"
"mode:=ljfour; "
"mag:=1; "
"batchmode; "
"input manfnt")))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(tfm (string-append
out "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
(mf (string-append
out "/share/texmf-dist/fonts/source/public/knuth-lib")))
(for-each (cut install-file <> tfm)
(find-files "build" "\\.*"))
(for-each (cut install-file <> mf)
(find-files "." "\\.mf"))
#t))))))
(native-inputs
`(("texlive-bin" ,texlive-bin)
("texlive-metafont-base" ,texlive-metafont-base)))
(home-page "https://www.ctan.org/pkg/knuth-lib")
(synopsis "Small library of METAFONT sources")
(description "This is a collection of core TeX and METAFONT macro files
from Donald Knuth, including the plain format, plain base, and the MF logo
fonts.")
(license license:knuth)))
(define-public texlive-fonts-latex
(package
(name "texlive-fonts-latex")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/fonts/source/public/latex-fonts"))
(revision %texlive-revision)))
(sha256
(base32
"0ypsm4xv9cw0jckk2qc7gi9hcmhf31mrg56pz3llyx3yd9vq2lps"))))
(build-system gnu-build-system)
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(srfi srfi-26))
#:tests? #f ; no tests
#:phases
(modify-phases %standard-phases
(delete 'configure)
(replace 'build
(lambda* (#:key inputs #:allow-other-keys)
(let ((mf (assoc-ref inputs "texlive-metafont-base")))
;; Tell mf where to find mf.base
(setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
;; Tell mf where to look for source files
(setenv "MFINPUTS"
(string-append (getcwd) ":"
mf "/share/texmf-dist/metafont/base:"
(assoc-ref inputs "texlive-fonts-cm")
"/share/texmf-dist/fonts/source/public/cm")))
(mkdir "build")
(every (lambda (font)
(format #t "building font ~a\n" font)
(zero? (system* "mf" "-progname=mf"
"-output-directory=build"
(string-append "\\"
"mode:=ljfour; "
"mag:=1; "
"batchmode; "
"input " font))))
'("icmcsc10" "icmex10" "icmmi8" "icmsy8" "icmtt8"
"ilasy8" "ilcmss8" "ilcmssb8" "ilcmssi8"
"lasy5" "lasy6" "lasy7" "lasy8" "lasy9" "lasy10" "lasyb10"
"lcircle10" "lcirclew10" "lcmss8" "lcmssb8" "lcmssi8"
"line10" "linew10"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(tfm (string-append
out "/share/texmf-dist/fonts/tfm/public/latex-fonts"))
(mf (string-append
out "/share/texmf-dist/fonts/source/public/latex-fonts")))
(for-each (cut install-file <> tfm)
(find-files "build" "\\.*"))
(for-each (cut install-file <> mf)
(find-files "." "\\.mf"))
#t))))))
(native-inputs
`(("texlive-bin" ,texlive-bin)
("texlive-metafont-base" ,texlive-metafont-base)
("texlive-fonts-cm" ,texlive-fonts-cm)))
(home-page "http://www.ctan.org/pkg/latex-fonts")
(synopsis "Collection of fonts used in LaTeX distributions")
(description "This is a collection of fonts for use with standard LaTeX
packages and classes. It includes invisible fonts (for use with the slides
class), line and circle fonts (for use in the picture environment) and LaTeX
symbol fonts.")
(license license:lppl1.2+)))
(define-public texlive-fonts-amsfonts
(package
(name "texlive-fonts-amsfonts")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/fonts/source/public/amsfonts"))
(revision %texlive-revision)))
(sha256
(base32
"07h20rvpbdb4k72hzmjkyb29426zr9wxsfp6yd4ajbbpd3vx8grb"))))
(build-system gnu-build-system)
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(srfi srfi-26))
#:tests? #f ; no tests
#:phases
(modify-phases %standard-phases
(delete 'configure)
(replace 'build
(lambda* (#:key inputs #:allow-other-keys)
(let ((mf (assoc-ref inputs "texlive-metafont-base"))
(cwd (getcwd)))
;; Tell mf where to find mf.base
(setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
;; Tell mf where to look for source files
(setenv "MFINPUTS"
(string-append cwd ":"
cwd "/cmextra:"
cwd "/cyrillic:"
cwd "/dummy:"
cwd "/symbols:"
mf "/share/texmf-dist/metafont/base:"
(assoc-ref inputs "texlive-fonts-cm")
"/share/texmf-dist/fonts/source/public/cm")))
(mkdir "build")
(every (lambda (font)
(format #t "building font ~a\n" (basename font ".mf"))
(with-directory-excursion (dirname font)
(zero? (system* "mf" "-progname=mf"
"-output-directory=../build"
(string-append "\\"
"mode:=ljfour; "
"mag:=1; "
"nonstopmode; "
"input "
(getcwd) "/"
(basename font ".mf"))))))
(find-files "." "[0-9]+\\.mf$"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(tfm (string-append
out "/share/texmf-dist/fonts/tfm/public/amsfonts"))
(mf (string-append
out "/share/texmf-dist/fonts/source/public/amsfonts")))
(for-each (cut install-file <> tfm)
(find-files "build" "\\.*"))
(for-each (cut install-file <> mf)
(find-files "." "\\.mf"))
#t))))))
(native-inputs
`(("texlive-fonts-cm" ,texlive-fonts-cm)
("texlive-metafont-base" ,texlive-metafont-base)
("texlive-bin" ,texlive-bin)))
(home-page "http://www.ctan.org/pkg/amsfonts")
(synopsis "TeX fonts from the American Mathematical Society")
(description
"This package provides an extended set of fonts for use in mathematics,
including: extra mathematical symbols; blackboard bold letters (uppercase
only); fraktur letters; subscript sizes of bold math italic and bold Greek
letters; subscript sizes of large symbols such as sum and product; added sizes
of the Computer Modern small caps font; cyrillic fonts (from the University of
Washington); Euler mathematical fonts. All fonts are provided as Adobe Type 1
files, and all except the Euler fonts are provided as Metafont source. The
distribution also includes the canonical Type 1 versions of the Computer
Modern family of fonts. The Euler fonts are supported by separate packages;
details can be found in the documentation.")
(license license:silofl1.1)))
(define-public texlive-latex-amsfonts
(package
(name "texlive-latex-amsfonts")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (texlive-ref "latex" "amsfonts"))
(sha256
(base32
"0slzfv5h2m03b2xvm2sasznz4azh6rgi069z161dja3l8rln79hm"))))
(build-system texlive-build-system)
(arguments '(#:tex-directory "latex/amsfonts"))
(native-inputs
`(("texlive-fonts-cm" ,texlive-fonts-cm)
("texlive-metafont-base" ,texlive-metafont-base)))
(home-page "http://www.ctan.org/pkg/amsfonts")
(synopsis "TeX fonts from the American Mathematical Society")
(description
"This package provides basic LaTeX support for the symbol fonts provides
by the amsfonts package. It provides @code{amsfonts.sty}, with names of
individual symbols defined in @code{amssymb.sty}.")
(license license:silofl1.1)))
;; This provides etex.src which is needed to build various formats, including
;; luatex.fmt and pdflatex.fmt
(define-public texlive-tex-plain
(package
(name "texlive-tex-plain")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
"/tex/plain"))
(revision %texlive-revision)))
(sha256
(base32
"0mjgl3gscn3ps29yjambz1j9fg81ynnncb96vpprwx4xsijhsns0"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let ((target (string-append (assoc-ref %outputs "out")
"/share/texmf-dist/tex/plain")))
(mkdir-p target)
(copy-recursively (assoc-ref %build-inputs "source") target)
#t))))
(home-page "https://www.ctan.org/pkg/plain")
(synopsis "Plain TeX format and supporting files")
(description
"Contains files used to build the Plain TeX format, as described in the
TeXbook, together with various supporting files (some also discussed in the
book).")
(license license:knuth)))
(define-public texlive-latex-base
(let ((texlive-dir
(lambda (dir hash)
(origin
(method svn-fetch)
(uri (svn-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist/"
dir))
(revision %texlive-revision)))
(sha256 (base32 hash))))))
(package
(name "texlive-latex-base")
(version (number->string %texlive-revision))
(source (origin
(method svn-fetch)
(uri (texlive-ref "latex" "base"))
(sha256
(base32
"1h9pir2hz6i9avc4lrl733p3zf4rpkg8537x1zdbhs91hvhikw9k"))))
(build-system gnu-build-system)
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(ice-9 match)
(srfi srfi-1)
(srfi srfi-26))
#:tests? #f ; no tests
#:phases
(modify-phases %standard-phases
(delete 'configure)
(replace 'build
(lambda* (#:key inputs #:allow-other-keys)
;; Find required fonts
(setenv "TFMFONTS"
(string-append (assoc-ref inputs "texlive-fonts-cm")
"/share/texmf-dist/fonts/tfm/public/cm:"
(assoc-ref inputs "texlive-fonts-latex")
"/share/texmf-dist/fonts/tfm/public/latex-fonts:"
(assoc-ref inputs "texlive-fonts-knuth-lib")
"/share/texmf-dist/fonts/tfm/public/knuth-lib"))
(setenv "TEXINPUTS"
(string-append
(getcwd) ":"
(getcwd) "/build:"
(string-join
(append-map (match-lambda
((_ . dir)
(find-files dir
(lambda (_ stat)
(eq? 'directory (stat:type stat)))
#:directories? #t
#:stat stat)))
inputs)
":")))
;; Create an empty texsys.cfg, because latex.ltx wants to include
;; it. This file must exist and it's fine if it's empty.
(with-output-to-file "texsys.cfg"
(lambda _ (format #t "%")))
(mkdir "build")
(mkdir "web2c")
(and (zero? (system* "luatex" "-ini" "-interaction=batchmode"
"-output-directory=build"
"unpack.ins"))
(zero? (system* "tex" "-ini" "-interaction=batchmode"
"-output-directory=web2c"
"tex.ini"))
;; LaTeX, pdfetex/pdftex, and XeTeX require e-TeX, which
;; is enabled only in extended mode (activated with a
;; leading asterisk). We should not use luatex here,
;; because that would make the generated format files
;; incompatible with any other TeX engine.
(every
(lambda (format)
(zero? (system* "latex" "-ini" "-interaction=batchmode"
"-output-directory=web2c"
"-translate-file=cp227.tcx"
(string-append "*" format ".ini"))))
'("latex"
"pdflatex"
"pdfetex"))
(every
(lambda (format)
(zero? (system* format "-ini" "-interaction=batchmode"
"-output-directory=web2c"
(string-append "*" format ".ini"))))
'("xetex"
"xelatex"))
(every
(lambda (format)
(zero? (system* "luatex" "-ini" "-interaction=batchmode"
"-output-directory=web2c"
(string-append format ".ini"))))
'("dviluatex" "dvilualatex" "luatex" "lualatex")))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(target (string-append
out "/share/texmf-dist/tex/latex/base"))
(web2c (string-append
out "/share/texmf-dist/web2c")))
(mkdir-p target)
(mkdir-p web2c)
(for-each delete-file (find-files "." "\\.(log|aux)$"))
(for-each (cut install-file <> target)
(find-files "build" ".*"))
(for-each (cut install-file <> web2c)
(find-files "web2c" ".*"))
;; pdftex is really just the same as pdfetex, but since it
;; doesn't have its own format file, we need to copy it.
(copy-file "web2c/pdfetex.fmt"
(string-append web2c "/pdftex.fmt"))
#t))))))
(native-inputs
`(("texlive-bin" ,texlive-bin)
("texlive-generic-unicode-data" ,texlive-generic-unicode-data)
("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl)
("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files)
("texlive-latex-latexconfig"
,(texlive-dir "tex/latex/latexconfig/"
"1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf"))
("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8)
("texlive-generic-hyphen"
,(texlive-dir "tex/generic/hyphen/"
"0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd"))
("texlive-generic-ruhyphen"
,(texlive-dir "tex/generic/ruhyphen/"
"14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd"))
("texlive-generic-ukrhyph"
,(texlive-dir "tex/generic/ukrhyph/"
"1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv"))
("texlive-generic-config"
,(texlive-dir "tex/generic/config/"
"19vj088p4kkp6xll0141m4kl6ssgdzhs3g10i232khb07aqiag8s"))
("texlive-tex-plain" ,texlive-tex-plain)
("texlive-fonts-cm" ,texlive-fonts-cm)
("texlive-fonts-latex" ,texlive-fonts-latex)
("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)))
(home-page "http://www.ctan.org/pkg/latex-base")
(synopsis "Base sources of LaTeX")
(description
"This bundle comprises the source of LaTeX itself, together with several
packages which are considered \"part of the kernel\". This bundle, together
with the required packages, constitutes what every LaTeX distribution should
contain.")
(license license:lppl1.3c+))))