gnu: texlive-cm: Fix build.

* gnu/packages/tex.scm (texlive-cm)[arguments]<#:modules>: Remove keyword.
<#:phases>: Remove unnecessary phases.  Add a phase to build ".pk" files.
This commit is contained in:
Nicolas Goaziou 2023-05-19 16:32:19 +02:00
parent 31cd9a5040
commit c3e3f03daf
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -1164,52 +1164,30 @@ (define-public texlive-cm
(arguments (arguments
(list (list
#:texlive-latex-base #f #:texlive-latex-base #f
#:modules
'((guix build texlive-build-system)
(guix build utils)
(srfi srfi-26))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'build (add-after 'generate-font-metrics 'generate-pk
(lambda* (#:key inputs #:allow-other-keys) (lambda _
(let ((mf (assoc-ref inputs "texlive-metafont"))) (let* ((cwd (getcwd))
;; Tell mf where to find mf.base (pkdir
(setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c")) (string-append cwd "/fonts/pk/ljfour/public/cm/dpi600"))
;; Tell mf where to look for source files (build-dir (string-append cwd "/build")))
(setenv "MFINPUTS"
(string-append (getcwd) "/fonts/source/public/cm/:"
mf "/share/texmf-dist/metafont/base")))
(for-each make-file-writable
(cons "fonts/source/public/cm/"
(find-files "fonts/source/public/cm/" ".*")))
(let ((build (string-append (getcwd) "/build"))
(pkdir (string-append (getcwd) "/pk/ljfour/public/cm/dpi600")))
(mkdir-p pkdir)
(mkdir-p build)
(with-directory-excursion "fonts/source/public/cm/" (with-directory-excursion "fonts/source/public/cm/"
(for-each (lambda (font) (mkdir-p pkdir)
(format #t "building font ~a\n" font) (for-each
(invoke "mf" "-progname=mf" (lambda (font)
(string-append "-output-directory=" build) (let ((font-name (basename font ".mf")))
(string-append "\\" (invoke "gftopk"
"mode:=ljfour; " (string-append build-dir "/" font-name ".600gf")
"mag:=1+0/600; " (string-append pkdir "/" font-name ".pk"))))
"scrollmode; " (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$")))))))))
"input "
(basename font ".mf")))
(invoke "gftopk"
(string-append build "/"
(basename font ".mf") ".600gf")
(string-append pkdir "/"
(basename font ".mf") ".pk")))
(find-files "." "cm(.*[0-9]+.*|inch)\\.mf$")))))))))
(native-inputs (list texlive-metafont)) (native-inputs (list texlive-metafont))
(home-page "https://ctan.org/pkg/cm") (home-page "https://ctan.org/pkg/cm")
(synopsis "Computer Modern fonts for TeX") (synopsis "Computer Modern fonts for TeX")
(description "This package provides the Computer Modern fonts by Donald (description
Knuth. The Computer Modern font family is a large collection of text, "This package provides the Computer Modern fonts by Donald Knuth. The
display, and mathematical fonts in a range of styles, based on Monotype Modern Computer Modern font family is a large collection of text, display, and
8A.") mathematical fonts in a range of styles, based on Monotype Modern 8A.")
(license license:knuth))) (license license:knuth)))
(define-deprecated-package texlive-fonts-cm texlive-cm) (define-deprecated-package texlive-fonts-cm texlive-cm)