gnu: texlive: Use modify-phases syntax.
* gnu/packages/texlive.scm (texlive-bin, texlive-texmf): Use modify-phases syntax.
This commit is contained in:
parent
a916c82649
commit
4a6635f353
1 changed files with 58 additions and 61 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
|
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
|
||||||
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
|
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
|
||||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||||
;;;
|
;;;
|
||||||
|
|
@ -129,30 +129,29 @@
|
||||||
#:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
|
#:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
|
||||||
(%current-system))))
|
(%current-system))))
|
||||||
#:phases
|
#:phases
|
||||||
(alist-cons-after
|
(modify-phases %standard-phases
|
||||||
'install 'postinst
|
(add-after 'install 'postint
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
|
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
(share (string-append out "/share"))
|
(share (string-append out "/share"))
|
||||||
(texlive-extra (assoc-ref inputs "texlive-extra-src"))
|
(texlive-extra (assoc-ref inputs "texlive-extra-src"))
|
||||||
(unpack (assoc-ref %standard-phases 'unpack))
|
(unpack (assoc-ref %standard-phases 'unpack))
|
||||||
(patch-source-shebangs
|
(patch-source-shebangs
|
||||||
(assoc-ref %standard-phases 'patch-source-shebangs)))
|
(assoc-ref %standard-phases 'patch-source-shebangs)))
|
||||||
;; Create symbolic links for the latex variants and their
|
;; Create symbolic links for the latex variants and their
|
||||||
;; man pages.
|
;; man pages.
|
||||||
(with-directory-excursion (string-append out "/bin/")
|
(with-directory-excursion (string-append out "/bin/")
|
||||||
(for-each symlink
|
(for-each symlink
|
||||||
'("pdftex" "pdftex" "xetex" "luatex")
|
'("pdftex" "pdftex" "xetex" "luatex")
|
||||||
'("latex" "pdflatex" "xelatex" "lualatex")))
|
'("latex" "pdflatex" "xelatex" "lualatex")))
|
||||||
(with-directory-excursion (string-append share "/man/man1/")
|
(with-directory-excursion (string-append share "/man/man1/")
|
||||||
(symlink "luatex.1" "lualatex.1"))
|
(symlink "luatex.1" "lualatex.1"))
|
||||||
;; Unpack texlive-extra and install tlpkg.
|
;; Unpack texlive-extra and install tlpkg.
|
||||||
(mkdir "texlive-extra")
|
(mkdir "texlive-extra")
|
||||||
(with-directory-excursion "texlive-extra"
|
(with-directory-excursion "texlive-extra"
|
||||||
(apply unpack (list #:source texlive-extra))
|
(apply unpack (list #:source texlive-extra))
|
||||||
(apply patch-source-shebangs (list #:source texlive-extra))
|
(apply patch-source-shebangs (list #:source texlive-extra))
|
||||||
(system* "mv" "tlpkg" share))))
|
(system* "mv" "tlpkg" share))))))))
|
||||||
%standard-phases)))
|
|
||||||
(synopsis "TeX Live, a package of the TeX typesetting system")
|
(synopsis "TeX Live, a package of the TeX typesetting system")
|
||||||
(description
|
(description
|
||||||
"TeX Live provides a comprehensive TeX document production system.
|
"TeX Live provides a comprehensive TeX document production system.
|
||||||
|
|
@ -182,42 +181,40 @@ This package contains the binaries.")
|
||||||
(guix build utils)
|
(guix build utils)
|
||||||
(srfi srfi-26))
|
(srfi srfi-26))
|
||||||
#:phases
|
#:phases
|
||||||
(alist-cons-before
|
(modify-phases (map (cut assq <> %standard-phases)
|
||||||
'texmf-config 'install
|
'(set-paths unpack patch-source-shebangs))
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(add-after 'patch-source-shebangs 'install
|
||||||
(let ((share (string-append (assoc-ref outputs "out") "/share")))
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(mkdir-p share)
|
(let ((share (string-append (assoc-ref outputs "out") "/share")))
|
||||||
(system* "mv" "texmf-dist" share)))
|
(mkdir-p share)
|
||||||
(alist-cons-after
|
(system* "mv" "texmf-dist" share))))
|
||||||
'patch-source-shebangs 'texmf-config
|
(add-after 'install 'texmf-config
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
(share (string-append out "/share"))
|
(share (string-append out "/share"))
|
||||||
(texmfroot (string-append share "/texmf-dist/web2c"))
|
(texmfroot (string-append share "/texmf-dist/web2c"))
|
||||||
(texmfcnf (string-append texmfroot "/texmf.cnf"))
|
(texmfcnf (string-append texmfroot "/texmf.cnf"))
|
||||||
(texlive-bin (assoc-ref inputs "texlive-bin"))
|
(texlive-bin (assoc-ref inputs "texlive-bin"))
|
||||||
(texbin (string-append texlive-bin "/bin"))
|
(texbin (string-append texlive-bin "/bin"))
|
||||||
(tlpkg (string-append texlive-bin "/share/tlpkg")))
|
(tlpkg (string-append texlive-bin "/share/tlpkg")))
|
||||||
;; Register SHARE as TEXMFROOT in texmf.cnf.
|
;; Register SHARE as TEXMFROOT in texmf.cnf.
|
||||||
(substitute* texmfcnf
|
(substitute* texmfcnf
|
||||||
(("TEXMFROOT = \\$SELFAUTOPARENT")
|
(("TEXMFROOT = \\$SELFAUTOPARENT")
|
||||||
(string-append "TEXMFROOT = " share)))
|
(string-append "TEXMFROOT = " share)))
|
||||||
;; Register paths in texmfcnf.lua, needed for context.
|
;; Register paths in texmfcnf.lua, needed for context.
|
||||||
(substitute* (string-append texmfroot "/texmfcnf.lua")
|
(substitute* (string-append texmfroot "/texmfcnf.lua")
|
||||||
(("selfautodir:") out)
|
(("selfautodir:") out)
|
||||||
(("selfautoparent:") (string-append share "/")))
|
(("selfautoparent:") (string-append share "/")))
|
||||||
;; Set path to TeXLive Perl modules
|
;; Set path to TeXLive Perl modules
|
||||||
(setenv "PERL5LIB"
|
(setenv "PERL5LIB"
|
||||||
(string-append (getenv "PERL5LIB") ":" tlpkg))
|
(string-append (getenv "PERL5LIB") ":" tlpkg))
|
||||||
;; Configure the texmf-dist tree; inspired from
|
;; Configure the texmf-dist tree; inspired from
|
||||||
;; http://slackbuilds.org/repository/13.37/office/texlive/
|
;; http://slackbuilds.org/repository/13.37/office/texlive/
|
||||||
(setenv "PATH" (string-append (getenv "PATH") ":" texbin))
|
(setenv "PATH" (string-append (getenv "PATH") ":" texbin))
|
||||||
(setenv "TEXMFCNF" texmfroot)
|
(setenv "TEXMFCNF" texmfroot)
|
||||||
(system* "updmap-sys" "--nohash" "--syncwithtrees")
|
(system* "updmap-sys" "--nohash" "--syncwithtrees")
|
||||||
(system* "mktexlsr")
|
(system* "mktexlsr")
|
||||||
(system* "fmtutil-sys" "--all")))
|
(system* "fmtutil-sys" "--all")))))))
|
||||||
(map (cut assq <> %standard-phases)
|
|
||||||
'(set-paths unpack patch-source-shebangs))))))
|
|
||||||
(synopsis "TeX Live, a package of the TeX typesetting system")
|
(synopsis "TeX Live, a package of the TeX typesetting system")
|
||||||
(description
|
(description
|
||||||
"TeX Live provides a comprehensive TeX document production system.
|
"TeX Live provides a comprehensive TeX document production system.
|
||||||
|
|
|
||||||
Reference in a new issue