gnu: Add texlive-cm.

* gnu/packages/tex.scm (texlive-cm): New variable.
(texlive-fonts-cm): Deprecate package.
This commit is contained in:
Ricardo Wurmus 2019-07-16 15:14:30 +02:00
parent df19dc2f86
commit b7d779db34
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 73 additions and 83 deletions

View File

@ -699,92 +699,82 @@ from (almost) arbitrarily complex font names, thus helping portability of TeX
documents.") documents.")
(license license:public-domain))) (license license:public-domain)))
(define-public texlive-fonts-cm (define-public texlive-cm
(package (let ((template (simple-texlive-package
(inherit (simple-texlive-package "texlive-cm"
"texlive-fonts-cm" (list "/fonts/source/public/cm/"
(list "/fonts/source/public/cm/" "/fonts/map/dvips/cm/cmtext-bsr-interpolated.map"
"/fonts/map/dvips/cm/cmtext-bsr-interpolated.map" "/doc/fonts/cm/")
"/doc/fonts/cm/README" (base32
"/doc/fonts/cm/README-cmps.txt") "1h0q71paqmg1xjg6k35ni2i6m93kmlq9rdwm913xg9n4qngywl18")
(base32 #:trivial? #t)))
"1h0q71paqmg1xjg6k35ni2i6m93kmlq9rdwm913xg9n4qngywl18"))) (package
(outputs '("out" "doc")) (inherit template)
(build-system gnu-build-system) (arguments
(arguments (substitute-keyword-arguments (package-arguments template)
`(#:modules ((guix build gnu-build-system) ((#:modules modules '())
(guix build utils) '((guix build gnu-build-system)
(srfi srfi-1) (guix build utils)
(srfi srfi-26)) (srfi srfi-26)))
#:tests? #f ; no tests ((#:phases phases)
#:phases `(modify-phases ,phases
(modify-phases %standard-phases (replace 'build
(delete 'configure) (lambda* (#:key inputs #:allow-other-keys)
(replace 'build (let ((mf (assoc-ref inputs "texlive-metafont-base")))
(lambda* (#:key inputs #:allow-other-keys) ;; Tell mf where to find mf.base
(let ((mf (assoc-ref inputs "texlive-metafont-base"))) (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
;; Tell mf where to find mf.base ;; Tell mf where to look for source files
(setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c")) (setenv "MFINPUTS"
;; Tell mf where to look for source files (string-append (getcwd) "/fonts/source/public/cm/:"
(setenv "MFINPUTS" mf "/share/texmf-dist/metafont/base")))
(string-append (getcwd) "/fonts/source/public/cm/:" (for-each make-file-writable
mf "/share/texmf-dist/metafont/base"))) (cons "fonts/source/public/cm/"
(for-each make-file-writable (find-files "fonts/source/public/cm/" ".*")))
(cons "fonts/source/public/cm/" (let ((build (string-append (getcwd) "/build"))
(find-files "fonts/source/public/cm/" ".*"))) (pkdir (string-append (getcwd) "/pk/ljfour/public/cm/dpi600")))
(let ((build (string-append (getcwd) "/build")) (mkdir-p pkdir)
(pkdir (string-append (getcwd) "/pk/ljfour/public/cm/dpi600"))) (mkdir-p build)
(mkdir-p pkdir) (with-directory-excursion "fonts/source/public/cm/"
(mkdir-p build) (for-each (lambda (font)
(with-directory-excursion "fonts/source/public/cm/" (format #t "building font ~a\n" font)
(for-each (lambda (font) (invoke "mf" "-progname=mf"
(format #t "building font ~a\n" font) (string-append "-output-directory=" build)
(invoke "mf" "-progname=mf" (string-append "\\"
(string-append "-output-directory=" build) "mode:=ljfour; "
(string-append "\\" "mag:=1+0/600; "
"mode:=ljfour; " "scrollmode; "
"mag:=1+0/600; " "input "
"scrollmode; " (basename font ".mf")))
"input " (invoke "gftopk"
(basename font ".mf"))) (string-append build "/"
(invoke "gftopk" (basename font ".mf") ".600gf")
(string-append build "/" (string-append pkdir "/"
(basename font ".mf") ".600gf") (basename font ".mf") ".pk")))
(string-append pkdir "/" (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))))
(basename font ".mf") ".pk"))) #t))
(find-files "." "cm(.*[0-9]+.*|inch)\\.mf$")))) (add-after 'install 'install-generated-fonts
#t)) (lambda* (#:key inputs outputs #:allow-other-keys)
(replace 'install (let* ((out (assoc-ref outputs "out"))
(lambda* (#:key inputs outputs #:allow-other-keys) (fonts (string-append out "/share/texmf-dist/fonts/"))
(let* ((out (assoc-ref outputs "out")) (pk (string-append fonts "pk"))
(doc (assoc-ref outputs "doc")) (tfm (string-append fonts "tfm/public/cm")))
(source (assoc-ref inputs "source")) (for-each (cut install-file <> tfm)
(fonts (string-append out "/share/texmf-dist/fonts/")) (find-files "build" "\\.*"))
(pk (string-append fonts "pk")) (copy-recursively "pk" pk)
(tfm (string-append fonts "tfm/public/cm")) #t)))))))
(mf (string-append fonts "source/public/cm"))) (native-inputs
(for-each (cut install-file <> tfm) `(("texlive-bin" ,texlive-bin)
(find-files "build" "\\.*")) ("texlive-metafont-base" ,texlive-metafont-base)))
(for-each (cut install-file <> mf) (home-page "https://www.ctan.org/pkg/cm")
(find-files "." "\\.mf")) (synopsis "Computer Modern fonts for TeX")
(copy-recursively "pk" pk) (description "This package provides the Computer Modern fonts by Donald
(copy-recursively
(string-append source "/doc")
(string-append doc "/doc"))
(install-file
(string-append source "/fonts/map/dvips/cm/cmtext-bsr-interpolated.map")
(string-append fonts "/map/dvips/cm/cmtext-bsr-interpolated.map"))
#t))))))
(native-inputs
`(("texlive-bin" ,texlive-bin)
("texlive-metafont-base" ,texlive-metafont-base)))
(home-page "https://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, 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 display, and mathematical fonts in a range of styles, based on Monotype Modern
8A.") 8A.")
(license license:knuth))) (license license:knuth))))
(define-public texlive-fonts-cm
(deprecated-package "texlive-fonts-cm" texlive-cm))
(define-public texlive-cm-super (define-public texlive-cm-super
(let ((template (simple-texlive-package (let ((template (simple-texlive-package