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.
 
 
 
 
 
 

217 lines
9.5 KiB

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