gnu: Add texlive-amsfonts.
* gnu/packages/tex.scm (texlive-fonts-amsfonts, texlive-latex-amsfonts): Deprecate and merge... (texlive-amsfonts): ...to this new package.
This commit is contained in:
		
							parent
							
								
									e976d3618d
								
							
						
					
					
						commit
						82ff725df9
					
				
					 1 changed files with 130 additions and 208 deletions
				
			
		| 
						 | 
					@ -1039,56 +1039,58 @@ Taco Hoekwater.")
 | 
				
			||||||
(define-public texlive-fonts-mflogo-font
 | 
					(define-public texlive-fonts-mflogo-font
 | 
				
			||||||
  (deprecated-package "texlive-fonts-mflogo-font" texlive-mflogo-font))
 | 
					  (deprecated-package "texlive-fonts-mflogo-font" texlive-mflogo-font))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define-public texlive-fonts-amsfonts
 | 
					(define-public texlive-amsfonts
 | 
				
			||||||
  (package
 | 
					  (let ((template (simple-texlive-package
 | 
				
			||||||
    (name "texlive-fonts-amsfonts")
 | 
					                   "texlive-amsfonts"
 | 
				
			||||||
    (version (number->string %texlive-revision))
 | 
					                   (list "/source/latex/amsfonts/"
 | 
				
			||||||
    (source (origin
 | 
					                         "/fonts/source/public/amsfonts/"
 | 
				
			||||||
              (method svn-fetch)
 | 
					                         "/fonts/type1/public/amsfonts/"
 | 
				
			||||||
              (uri (svn-reference
 | 
					                         "/fonts/afm/public/amsfonts/"
 | 
				
			||||||
                    (url (string-append "svn://www.tug.org/texlive/tags/"
 | 
					                         "/fonts/map/dvips/amsfonts/"
 | 
				
			||||||
                                        %texlive-tag "/Master/texmf-dist/"
 | 
					                         "/tex/plain/amsfonts/"
 | 
				
			||||||
                                        "/fonts/source/public/amsfonts"))
 | 
					                         "/doc/fonts/amsfonts/")
 | 
				
			||||||
                    (revision %texlive-revision)))
 | 
					 | 
				
			||||||
              (file-name (string-append name "-" version "-checkout"))
 | 
					 | 
				
			||||||
              (sha256
 | 
					 | 
				
			||||||
                   (base32
 | 
					                   (base32
 | 
				
			||||||
                "07h20rvpbdb4k72hzmjkyb29426zr9wxsfp6yd4ajbbpd3vx8grb"))))
 | 
					                    "15q70nkjf8wqzbd5ivcdx3i2sdgqxjb38q0qn9a2qw9i0qcnx6zw"))))
 | 
				
			||||||
    (build-system gnu-build-system)
 | 
					    (package
 | 
				
			||||||
 | 
					      (inherit template)
 | 
				
			||||||
      (arguments
 | 
					      (arguments
 | 
				
			||||||
     `(#:modules ((guix build gnu-build-system)
 | 
					       (substitute-keyword-arguments (package-arguments template)
 | 
				
			||||||
 | 
					         ((#:tex-directory _ #t)
 | 
				
			||||||
 | 
					          "latex/amsfonts")
 | 
				
			||||||
 | 
					         ((#:modules modules '())
 | 
				
			||||||
 | 
					          `((guix build texlive-build-system)
 | 
				
			||||||
            (guix build utils)
 | 
					            (guix build utils)
 | 
				
			||||||
            (ice-9 match)
 | 
					            (ice-9 match)
 | 
				
			||||||
            (srfi srfi-1)
 | 
					            (srfi srfi-1)
 | 
				
			||||||
                  (srfi srfi-26))
 | 
					            (srfi srfi-26)))
 | 
				
			||||||
       #:tests? #f                      ; no tests
 | 
					         ((#:phases phases)
 | 
				
			||||||
       #:phases
 | 
					          `(modify-phases ,phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					             (add-before 'build 'build-fonts
 | 
				
			||||||
         (delete 'configure)
 | 
					 | 
				
			||||||
         (replace 'build
 | 
					 | 
				
			||||||
               (lambda* (#:key inputs #:allow-other-keys)
 | 
					               (lambda* (#:key inputs #:allow-other-keys)
 | 
				
			||||||
                 (let ((mf  (assoc-ref inputs "texlive-union"))
 | 
					                 (let ((mf  (assoc-ref inputs "texlive-union"))
 | 
				
			||||||
                   (cwd (getcwd)))
 | 
					                       (src (string-append (getcwd) "/fonts/source/public/amsfonts/")))
 | 
				
			||||||
                   ;; Make METAFONT reproducible
 | 
					                   ;; Make METAFONT reproducible
 | 
				
			||||||
                   (setenv "SOURCE_DATE_EPOCH" "1")
 | 
					                   (setenv "SOURCE_DATE_EPOCH" "1")
 | 
				
			||||||
                   ;; Tell mf where to find mf.base
 | 
					                   ;; Tell mf where to find mf.base
 | 
				
			||||||
                   (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
 | 
					                   (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
 | 
				
			||||||
                   ;; Tell mf where to look for source files
 | 
					                   ;; Tell mf where to look for source files
 | 
				
			||||||
                   (setenv "MFINPUTS"
 | 
					                   (setenv "MFINPUTS"
 | 
				
			||||||
                       (string-append cwd ":"
 | 
					                           (string-append src ":"
 | 
				
			||||||
                                      cwd "/cmextra:"
 | 
					                                          src "/cmextra:"
 | 
				
			||||||
                                      cwd "/cyrillic:"
 | 
					                                          src "/cyrillic:"
 | 
				
			||||||
                                      cwd "/dummy:"
 | 
					                                          src "/dummy:"
 | 
				
			||||||
                                      cwd "/symbols:"
 | 
					                                          src "/symbols:"
 | 
				
			||||||
                                          mf "/share/texmf-dist/metafont/base:"
 | 
					                                          mf "/share/texmf-dist/metafont/base:"
 | 
				
			||||||
                                          (assoc-ref inputs "texlive-fonts-cm")
 | 
					                                          (assoc-ref inputs "texlive-fonts-cm")
 | 
				
			||||||
                                          "/share/texmf-dist/fonts/source/public/cm")))
 | 
					                                          "/share/texmf-dist/fonts/source/public/cm")))
 | 
				
			||||||
             (mkdir "build")
 | 
					                 (let ((build (string-append (getcwd) "/build")))
 | 
				
			||||||
 | 
					                   (mkdir-p build)
 | 
				
			||||||
 | 
					                   (with-directory-excursion "fonts/source/public/amsfonts"
 | 
				
			||||||
                     (for-each (lambda (font)
 | 
					                     (for-each (lambda (font)
 | 
				
			||||||
                                 (format #t "building font ~a\n" (basename font ".mf"))
 | 
					                                 (format #t "building font ~a\n" (basename font ".mf"))
 | 
				
			||||||
                                 (with-directory-excursion (dirname font)
 | 
					                                 (with-directory-excursion (dirname font)
 | 
				
			||||||
                                   (invoke "mf" "-progname=mf"
 | 
					                                   (invoke "mf" "-progname=mf"
 | 
				
			||||||
                                   "-output-directory=../build"
 | 
					                                           (string-append "-output-directory=" build)
 | 
				
			||||||
                                           (string-append "\\"
 | 
					                                           (string-append "\\"
 | 
				
			||||||
                                                          "mode:=ljfour; "
 | 
					                                                          "mode:=ljfour; "
 | 
				
			||||||
                                                          "mag:=1; "
 | 
					                                                          "mag:=1; "
 | 
				
			||||||
| 
						 | 
					@ -1096,28 +1098,29 @@ Taco Hoekwater.")
 | 
				
			||||||
                                                          "input "
 | 
					                                                          "input "
 | 
				
			||||||
                                                          (getcwd) "/"
 | 
					                                                          (getcwd) "/"
 | 
				
			||||||
                                                          (basename font ".mf")))))
 | 
					                                                          (basename font ".mf")))))
 | 
				
			||||||
                       (find-files "." "[0-9]+\\.mf$"))
 | 
					                               (find-files "." "[0-9]+\\.mf$"))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                 ;; 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.
 | 
				
			||||||
             (mkdir "build/euler")
 | 
					                 (let ((build (string-append (getcwd) "/build/euler")))
 | 
				
			||||||
 | 
					                   (mkdir build)
 | 
				
			||||||
 | 
					                   (with-directory-excursion "fonts/afm/public/amsfonts/"
 | 
				
			||||||
                     (for-each (lambda (font)
 | 
					                     (for-each (lambda (font)
 | 
				
			||||||
                                 (format #t "converting afm font ~a\n" (basename font ".afm"))
 | 
					                                 (format #t "converting afm font ~a\n" (basename font ".afm"))
 | 
				
			||||||
                                 (invoke "afm2tfm" font
 | 
					                                 (invoke "afm2tfm" font
 | 
				
			||||||
                                 (string-append "build/euler/"
 | 
					                                         (string-append build "/"
 | 
				
			||||||
                                                        (basename font ".tfm"))))
 | 
					                                                        (basename font ".tfm"))))
 | 
				
			||||||
                       (find-files (assoc-ref inputs "amsfonts-afm")
 | 
					                               (find-files "." "\\.afm$")))
 | 
				
			||||||
                                   "\\.afm$"))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                   ;; Frustratingly, not all fonts can be created this way.  To
 | 
					                   ;; Frustratingly, not all fonts can be created this way.  To
 | 
				
			||||||
                   ;; generate eufm8.tfm, for example, we first scale down
 | 
					                   ;; generate eufm8.tfm, for example, we first scale down
 | 
				
			||||||
                   ;; eufm10.afm to eufm8.pl, and then generate the tfm file from
 | 
					                   ;; eufm10.afm to eufm8.pl, and then generate the tfm file from
 | 
				
			||||||
                   ;; the pl file.
 | 
					                   ;; the pl file.
 | 
				
			||||||
             (with-directory-excursion "build/euler"
 | 
					 | 
				
			||||||
                   (setenv "TEXINPUTS"
 | 
					                   (setenv "TEXINPUTS"
 | 
				
			||||||
                       (string-append (getcwd) "//:"
 | 
					                             (string-append build "//:"
 | 
				
			||||||
                                      (assoc-ref inputs "amsfonts-afm") "//:"
 | 
					                                            (getcwd) "/fonts/afm/public/amsfonts//:"
 | 
				
			||||||
                                            (assoc-ref inputs "texlive-union") "//"))
 | 
					                                            (assoc-ref inputs "texlive-union") "//"))
 | 
				
			||||||
 | 
					                   (with-directory-excursion build
 | 
				
			||||||
                     (for-each (match-lambda
 | 
					                     (for-each (match-lambda
 | 
				
			||||||
                                 (((target-base target-size)
 | 
					                                 (((target-base target-size)
 | 
				
			||||||
                                   (source-base source-size))
 | 
					                                   (source-base source-size))
 | 
				
			||||||
| 
						 | 
					@ -1151,82 +1154,19 @@ Taco Hoekwater.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                 (("eurm6" 6) ("eurm7" 7))
 | 
					                                 (("eurm6" 6) ("eurm7" 7))
 | 
				
			||||||
                                 (("eurm8" 8) ("eurm10" 10))
 | 
					                                 (("eurm8" 8) ("eurm10" 10))
 | 
				
			||||||
                           (("eurm9" 9) ("eurm10" 10)))))
 | 
					                                 (("eurm9" 9) ("eurm10" 10))))))
 | 
				
			||||||
                 #t))
 | 
					                 #t))
 | 
				
			||||||
         (replace 'install
 | 
					             (add-after 'install 'install-generated-fonts
 | 
				
			||||||
               (lambda* (#:key inputs outputs #:allow-other-keys)
 | 
					               (lambda* (#:key inputs outputs #:allow-other-keys)
 | 
				
			||||||
             (let* ((out  (assoc-ref outputs "out"))
 | 
					                 (copy-recursively "build"
 | 
				
			||||||
                    (root (string-append out "/share/texmf-dist/fonts/"))
 | 
					                                   (string-append
 | 
				
			||||||
                    (pkgs '(("amsfonts-afm"   . "afm/public/amsfonts")
 | 
					                                    (assoc-ref outputs "out")
 | 
				
			||||||
                            ("amsfonts-type1" . "type1/public/amsfonts")
 | 
					                                    "/share/texmf-dist/fonts/tfm/public/amsfonts"))
 | 
				
			||||||
                            ("amsfonts-map"   . "map/dvips/amsfonts"))))
 | 
					                 #t))))))
 | 
				
			||||||
               (for-each (match-lambda
 | 
					 | 
				
			||||||
                           ((pkg . dir)
 | 
					 | 
				
			||||||
                            (let ((target (string-append root dir)))
 | 
					 | 
				
			||||||
                              (mkdir-p target)
 | 
					 | 
				
			||||||
                              (copy-recursively (assoc-ref inputs pkg)
 | 
					 | 
				
			||||||
                                                target))))
 | 
					 | 
				
			||||||
                         pkgs)
 | 
					 | 
				
			||||||
               (copy-recursively (assoc-ref inputs "amsfonts-plain")
 | 
					 | 
				
			||||||
                                 (string-append out "/share/texmf-dist/tex/plain/amsfonts"))
 | 
					 | 
				
			||||||
               (let* ((tfm (string-append root "tfm/public/amsfonts"))
 | 
					 | 
				
			||||||
                      (mf  (string-append root "source/public/amsfonts")))
 | 
					 | 
				
			||||||
                 (copy-recursively "build" tfm)
 | 
					 | 
				
			||||||
                 (for-each (cut install-file <> mf)
 | 
					 | 
				
			||||||
                           (find-files "." "\\.mf"))
 | 
					 | 
				
			||||||
                 #t)))))))
 | 
					 | 
				
			||||||
      (native-inputs
 | 
					      (native-inputs
 | 
				
			||||||
       `(("texlive-union" ,(texlive-union (list texlive-tex-fontinst-base
 | 
					       `(("texlive-union" ,(texlive-union (list texlive-tex-fontinst-base
 | 
				
			||||||
                                                texlive-fonts-cm
 | 
					                                                texlive-fonts-cm
 | 
				
			||||||
                                              texlive-metafont-base)))
 | 
					                                                texlive-metafont-base)))))
 | 
				
			||||||
       ("amsfonts-plain"
 | 
					 | 
				
			||||||
        ,(origin
 | 
					 | 
				
			||||||
           (method svn-fetch)
 | 
					 | 
				
			||||||
           (uri (svn-reference
 | 
					 | 
				
			||||||
                 (url (string-append "svn://www.tug.org/texlive/tags/"
 | 
					 | 
				
			||||||
                                     %texlive-tag "/Master/texmf-dist/"
 | 
					 | 
				
			||||||
                                     "/tex/plain/amsfonts"))
 | 
					 | 
				
			||||||
                 (revision %texlive-revision)))
 | 
					 | 
				
			||||||
           (file-name (string-append name "-plain-" version "-checkout"))
 | 
					 | 
				
			||||||
           (sha256
 | 
					 | 
				
			||||||
            (base32
 | 
					 | 
				
			||||||
             "1hi8c9rkfb6395sxf7fhkr91xygfg8am1hqij9g3h2c7qx3714qp"))))
 | 
					 | 
				
			||||||
       ("amsfonts-map"
 | 
					 | 
				
			||||||
        ,(origin
 | 
					 | 
				
			||||||
           (method svn-fetch)
 | 
					 | 
				
			||||||
           (uri (svn-reference
 | 
					 | 
				
			||||||
                 (url (string-append "svn://www.tug.org/texlive/tags/"
 | 
					 | 
				
			||||||
                                     %texlive-tag "/Master/texmf-dist/"
 | 
					 | 
				
			||||||
                                     "/fonts/map/dvips/amsfonts"))
 | 
					 | 
				
			||||||
                 (revision %texlive-revision)))
 | 
					 | 
				
			||||||
           (file-name (string-append name "-map-" version "-checkout"))
 | 
					 | 
				
			||||||
           (sha256
 | 
					 | 
				
			||||||
            (base32
 | 
					 | 
				
			||||||
             "1lrj3bd9ybj4aawzlygc6qvakbrwc5s0mc5n9rpic331frv3axfs"))))
 | 
					 | 
				
			||||||
       ("amsfonts-type1"
 | 
					 | 
				
			||||||
        ,(origin
 | 
					 | 
				
			||||||
           (method svn-fetch)
 | 
					 | 
				
			||||||
           (uri (svn-reference
 | 
					 | 
				
			||||||
                 (url (string-append "svn://www.tug.org/texlive/tags/"
 | 
					 | 
				
			||||||
                                     %texlive-tag "/Master/texmf-dist/"
 | 
					 | 
				
			||||||
                                     "/fonts/type1/public/amsfonts"))
 | 
					 | 
				
			||||||
                 (revision %texlive-revision)))
 | 
					 | 
				
			||||||
           (file-name (string-append name "-type1-" version "-checkout"))
 | 
					 | 
				
			||||||
           (sha256
 | 
					 | 
				
			||||||
            (base32
 | 
					 | 
				
			||||||
             "1zfz33vn6gm19njy74n8wmn7sljrimfhwns5z8qqhxqfh1g4qip2"))))
 | 
					 | 
				
			||||||
       ("amsfonts-afm"
 | 
					 | 
				
			||||||
        ,(origin
 | 
					 | 
				
			||||||
           (method svn-fetch)
 | 
					 | 
				
			||||||
           (uri (svn-reference
 | 
					 | 
				
			||||||
                 (url (string-append "svn://www.tug.org/texlive/tags/"
 | 
					 | 
				
			||||||
                                     %texlive-tag "/Master/texmf-dist/"
 | 
					 | 
				
			||||||
                                     "/fonts/afm/public/amsfonts"))
 | 
					 | 
				
			||||||
                 (revision %texlive-revision)))
 | 
					 | 
				
			||||||
           (file-name (string-append name "-afm-" version "-checkout"))
 | 
					 | 
				
			||||||
           (sha256
 | 
					 | 
				
			||||||
            (base32
 | 
					 | 
				
			||||||
             "1fifzkaihmjgchnk7dmw0c23k0cz999dxnc78ivmqvgi1dhx0iv8"))))))
 | 
					 | 
				
			||||||
      (home-page "https://www.ctan.org/pkg/amsfonts")
 | 
					      (home-page "https://www.ctan.org/pkg/amsfonts")
 | 
				
			||||||
      (synopsis "TeX fonts from the American Mathematical Society")
 | 
					      (synopsis "TeX fonts from the American Mathematical Society")
 | 
				
			||||||
      (description
 | 
					      (description
 | 
				
			||||||
| 
						 | 
					@ -1240,31 +1180,13 @@ files, and all except the Euler fonts are provided as Metafont source.  The
 | 
				
			||||||
distribution also includes the canonical Type 1 versions of the Computer
 | 
					distribution also includes the canonical Type 1 versions of the Computer
 | 
				
			||||||
Modern family of fonts.  The Euler fonts are supported by separate packages;
 | 
					Modern family of fonts.  The Euler fonts are supported by separate packages;
 | 
				
			||||||
details can be found in the documentation.")
 | 
					details can be found in the documentation.")
 | 
				
			||||||
    (license license:silofl1.1)))
 | 
					      (license license:silofl1.1))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define-public texlive-fonts-amsfonts
 | 
				
			||||||
 | 
					  (deprecated-package "texlive-fonts-amsfonts" texlive-amsfonts))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define-public texlive-latex-amsfonts
 | 
					(define-public texlive-latex-amsfonts
 | 
				
			||||||
  (package
 | 
					  (deprecated-package "texlive-latex-amsfonts" texlive-amsfonts))
 | 
				
			||||||
    (name "texlive-latex-amsfonts")
 | 
					 | 
				
			||||||
    (version (number->string %texlive-revision))
 | 
					 | 
				
			||||||
    (source (origin
 | 
					 | 
				
			||||||
              (method svn-fetch)
 | 
					 | 
				
			||||||
              (uri (texlive-ref "latex" "amsfonts"))
 | 
					 | 
				
			||||||
              (file-name (string-append name "-" version "-checkout"))
 | 
					 | 
				
			||||||
              (sha256
 | 
					 | 
				
			||||||
               (base32
 | 
					 | 
				
			||||||
                "0slzfv5h2m03b2xvm2sasznz4azh6rgi069z161dja3l8rln79hm"))))
 | 
					 | 
				
			||||||
    (build-system texlive-build-system)
 | 
					 | 
				
			||||||
    (arguments '(#:tex-directory "latex/amsfonts"))
 | 
					 | 
				
			||||||
    (native-inputs
 | 
					 | 
				
			||||||
     `(("texlive-fonts-cm" ,texlive-fonts-cm)
 | 
					 | 
				
			||||||
       ("texlive-metafont-base" ,texlive-metafont-base)))
 | 
					 | 
				
			||||||
    (home-page "https://www.ctan.org/pkg/amsfonts")
 | 
					 | 
				
			||||||
    (synopsis "TeX fonts from the American Mathematical Society")
 | 
					 | 
				
			||||||
    (description
 | 
					 | 
				
			||||||
     "This package provides basic LaTeX support for the symbol fonts provides
 | 
					 | 
				
			||||||
by the amsfonts package.  It provides @code{amsfonts.sty}, with names of
 | 
					 | 
				
			||||||
individual symbols defined in @code{amssymb.sty}.")
 | 
					 | 
				
			||||||
    (license license:silofl1.1)))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define-public texlive-mkpattern
 | 
					(define-public texlive-mkpattern
 | 
				
			||||||
  (package
 | 
					  (package
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue