gnu: texlive-amsfonts: Build .ins file instead of installing fonts twice.

* gnu/packages/tex.scm (texlive-amsfonts)[arguments]: Override build targets;
rename font build directory to avoid installing it a second time.
This commit is contained in:
Ricardo Wurmus 2019-07-24 18:25:12 +02:00
parent a6405e0333
commit d350d5e714
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 9 additions and 6 deletions

View File

@ -1045,6 +1045,8 @@ Taco Hoekwater.")
(inherit template) (inherit template)
(arguments (arguments
(substitute-keyword-arguments (package-arguments template) (substitute-keyword-arguments (package-arguments template)
((#:build-targets _ #t)
'(list "amsfonts.ins"))
((#:tex-directory _ #t) ((#:tex-directory _ #t)
"latex/amsfonts") "latex/amsfonts")
((#:modules modules '()) ((#:modules modules '())
@ -1073,7 +1075,7 @@ Taco Hoekwater.")
mf "/share/texmf-dist/metafont/base:" mf "/share/texmf-dist/metafont/base:"
(assoc-ref inputs "texlive-cm") (assoc-ref inputs "texlive-cm")
"/share/texmf-dist/fonts/source/public/cm"))) "/share/texmf-dist/fonts/source/public/cm")))
(let ((build (string-append (getcwd) "/build"))) (let ((build (string-append (getcwd) "/build-fonts")))
(mkdir-p build) (mkdir-p build)
(with-directory-excursion "fonts/source/public/amsfonts" (with-directory-excursion "fonts/source/public/amsfonts"
(for-each (lambda (font) (for-each (lambda (font)
@ -1092,7 +1094,7 @@ Taco Hoekwater.")
;; There are no metafont sources for the Euler fonts, so we ;; There are no metafont sources for the Euler fonts, so we
;; convert the afm files instead. ;; convert the afm files instead.
(let ((build (string-append (getcwd) "/build/euler"))) (let ((build (string-append (getcwd) "/build-fonts/euler")))
(mkdir build) (mkdir build)
(with-directory-excursion "fonts/afm/public/amsfonts/" (with-directory-excursion "fonts/afm/public/amsfonts/"
(for-each (lambda (font) (for-each (lambda (font)
@ -1109,6 +1111,7 @@ Taco Hoekwater.")
(setenv "TEXINPUTS" (setenv "TEXINPUTS"
(string-append build "//:" (string-append build "//:"
(getcwd) "/fonts/afm/public/amsfonts//:" (getcwd) "/fonts/afm/public/amsfonts//:"
(getcwd) "/source/latex/amsfonts//:"
(assoc-ref inputs "texlive-union") "//")) (assoc-ref inputs "texlive-union") "//"))
(with-directory-excursion build (with-directory-excursion build
(for-each (match-lambda (for-each (match-lambda
@ -1148,7 +1151,7 @@ Taco Hoekwater.")
#t)) #t))
(add-after 'install 'install-generated-fonts (add-after 'install 'install-generated-fonts
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(copy-recursively "build" (copy-recursively "build-fonts"
(string-append (string-append
(assoc-ref outputs "out") (assoc-ref outputs "out")
"/share/texmf-dist/fonts/tfm/public/amsfonts")) "/share/texmf-dist/fonts/tfm/public/amsfonts"))