gnu: texlive-latex-base: Simplify.
[jackhill/guix/guix.git] / gnu / packages / tex.scm
index 3579039..de38cc9 100644 (file)
@@ -66,6 +66,7 @@
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages shells)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -270,6 +271,20 @@ copied to their outputs; otherwise the TEXLIVE-BUILD-SYSTEM is used."
    (build-system gnu-build-system)
    (inputs
     `(("texlive-extra-src" ,texlive-extra-src)
+      ("texlive-scripts"
+       ,(origin
+          (method svn-fetch)
+          (uri (svn-reference
+                (url (string-append "svn://www.tug.org/texlive/tags/"
+                                    %texlive-tag "/Master/texmf-dist/"
+                                    "/scripts/texlive"))
+                (revision %texlive-revision)))
+          (file-name (string-append "texlive-scripts-"
+                                    (number->string %texlive-revision)
+                                    "-checkout"))
+          (sha256
+           (base32
+            "0wrjls1y9b4k1z10l9l8w2l3yjcw7v7by2y16kchdpkiyldlkry6"))))
       ("cairo" ,cairo)
       ("fontconfig" ,fontconfig)
       ("fontforge" ,fontforge)
@@ -385,6 +400,13 @@ copied to their outputs; otherwise the TEXLIVE-BUILD-SYSTEM is used."
                 (apply unpack (list #:source texlive-extra))
                 (apply patch-source-shebangs (list #:source texlive-extra))
                 (invoke "mv" "tlpkg" share))
+              (let ((scripts (string-append share "/texmf-dist/scripts/texlive/")))
+                (mkdir-p scripts)
+                (copy-recursively (assoc-ref inputs "texlive-scripts") scripts)
+                ;; Make sure that fmtutil can find its Perl modules.
+                (substitute* (string-append scripts "fmtutil.pl")
+                  (("\\$TEXMFROOT/") (string-append share "/"))))
+
               ;; texlua shebangs are not patched by the patch-source-shebangs
               ;; phase because the texlua executable does not exist at that
               ;; time.
@@ -412,6 +434,20 @@ This package contains the binaries.")
    (home-page "https://www.tug.org/texlive/")))
 
 \f
+(define texlive-docstrip
+  (package
+    (inherit (simple-texlive-package
+              "texlive-docstrip"
+              (list "/tex/latex/base/docstrip.tex")
+              (base32
+               "17vdy43d9vknldz7wb69hp33r8awmdvn4xszamvgs5ikcl4cp289")
+              #:trivial? #t))
+    (home-page "https://www.ctan.org/texlive")
+    (synopsis "Utility to strip documentation from TeX files.")
+    (description "This package provides the docstrip utility to strip
+documentation from TeX files.  It is part of the LaTeX base.")
+    (license license:lppl1.3+)))
+
 (define-public texlive-unicode-data
   (package
     (inherit (simple-texlive-package
@@ -462,26 +498,24 @@ the autogenerated files @file{language.dat} and @file{language.def} (and
 default versions of those), etc.")
     (license license:knuth)))
 
-;; TODO: This package should not exist.  There should not be a single package
-;; containing all of /dvips.  These really belong to different packages.
 (define-public texlive-dvips
   (package
     (inherit (simple-texlive-package
               "texlive-dvips"
-              (list "/fonts/map/dvips/"
+              (list "/doc/man/man1/afm2tfm.1"
+                    "/doc/man/man1/dvips.1"
+                    "/dvips/base/"
+                    "/dvips/config/"
                     "/fonts/enc/dvips/base/"
-                    "/dvips/")
+                    "/tex/generic/dvips/")
               (base32
-               "1di07wx8wjczddmagq5z082l2has3inzk5jwkqh4i6wv1qdfqpp6")
+               "1qr7h0ahycmz5wmpv54glfss9jqdmmyymj6kim626d1c8v9bmg86")
               #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/dvips")
     (synopsis "DVI to PostScript drivers")
     (description "This package provides files needed for converting DVI files
 to PostScript.")
-    ;; Various free software licenses apply to individual files.
-    (license (list license:lppl1.3c+
-                   license:expat
-                   license:lgpl3+))))
+    (license license:lppl)))
 
 (define-public texlive-tex-ini-files
   (package
@@ -555,68 +589,108 @@ to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
 build fonts using the Metafont system.")
     (license license:knuth)))
 
-(define-public texlive-tex-fontinst-base
-  (package
-    (name "texlive-tex-fontinst-base")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/fontinst/base"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "12gnb8hc45p47pqn31msvi4mpr3wxbbbf2k4xhmshjqykwzlx508"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/fontinst/base")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
-    (home-page "https://www.ctan.org/pkg/fontinst")
-    (synopsis "Tools for converting and installing fonts for TeX and LaTeX")
-    (description "This package provides TeX macros for converting Adobe Font
+(define-public texlive-fontinst
+  (let ((template (simple-texlive-package
+                   "texlive-fontinst"
+                   (list "/doc/fonts/fontinst/"
+                         "/doc/man/man1/fontinst.1"
+                         "/doc/man/man1/fontinst.man1.pdf"
+
+                         ;; This is used to build parts of
+                         ;; /tex/fontinst/{base,misc}/ and
+                         ;; /tex/latex/fontinst/fontdoc.sty.
+                         "/source/fontinst/base/"
+
+                         ;; These are not generated.
+                         "/tex/fontinst/base/bbox.sty"
+                         "/tex/fontinst/base/multislot.sty"
+                         "/tex/fontinst/misc/glyphbox.mtx"
+                         "/tex/fontinst/misc/glyphoff.mtx"
+                         "/tex/fontinst/misc/glyphon.mtx"
+                         "/tex/fontinst/misc/kernoff.mtx"
+                         "/tex/fontinst/misc/kernon.mtx"
+
+                         "/tex/fontinst/latinetx/"
+                         "/tex/fontinst/latinmtx/"
+                         "/tex/fontinst/mathmtx/"
+                         "/tex/fontinst/smblmtx/"
+
+                         "/scripts/texlive/fontinst.sh")
+                   (base32
+                    "09drlb0krhnizw92xlm5wxzzpgn3shcxd684xlg0zc5p16l47w6h")
+                   #:trivial? #t)))
+    (package
+      (inherit template)
+      (arguments
+       (substitute-keyword-arguments (package-arguments template)
+         ((#:modules _ '())
+          '((guix build gnu-build-system)
+            (guix build utils)
+            (ice-9 match)))
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (replace 'build
+               (lambda* (#:key inputs #:allow-other-keys)
+                 (setenv "TEXINPUTS"
+                         (string-append (getcwd) "//:"
+                                        (getcwd) "/source/fontinst/base//:"
+                                        (assoc-ref inputs "texlive-docstrip") "//"))
+                 (mkdir "build")
+                 (invoke "tex" "-ini" "-interaction=scrollmode"
+                         "-output-directory=build"
+                         "fontinst.ins")))
+             ;; Since we're using docstrip without LaTeX we can't set \UseTDS
+             ;; or \BaseDirectory, so the generated files are just dumped in
+             ;; the "build" directory.
+             (add-after 'install 'install-generated-files
+               (lambda* (#:key outputs #:allow-other-keys)
+                 (let* ((out (assoc-ref outputs "out"))
+                        (root (string-append out "/share/texmf-dist")))
+                   (for-each (match-lambda
+                               ((dir files ...)
+                                (for-each (lambda (file)
+                                            (install-file
+                                             (string-append "build/" file)
+                                             (string-append root dir)))
+                                          files)))
+                             '(("/tex/fontinst/base"
+                                "fontinst.sty"
+                                "cfntinst.sty"
+                                "xfntinst.sty"
+                                "finstmsc.sty"
+                                "fontinst.ini")
+                               ("/tex/fontinst/misc"
+                                "csc2x.tex"
+                                "csckrn2x.tex"
+                                "osf2x.tex")
+                               ("/tex/latex/fontinst"
+                                "fontdoc.sty")))
+                   #t)))))))
+      (native-inputs
+       `(("texlive-bin" ,texlive-bin)
+         ("texlive-docstrip" ,texlive-docstrip)))
+      (home-page "https://www.ctan.org/pkg/fontinst")
+      (synopsis "Tools for converting and installing fonts for TeX and LaTeX")
+      (description "This package provides TeX macros for converting Adobe Font
 Metric files to TeX metric and virtual font format.  Fontinst helps mainly
 with the number crunching and shovelling parts of font installation.  This
 means in practice that it creates a number of files which give the TeX
 metrics (and related information) for a font family that TeX needs to do any
 typesetting in these fonts.")
-    (license license:lppl1.1+)))
+      (license license:lppl1.1+))))
+
+(define-public texlive-tex-fontinst-base
+  (deprecated-package "texlive-tex-fontinst-base" texlive-fontinst))
 
 (define-public texlive-fontname
   (package
-    (name "texlive-fontname")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/fonts/map/fontname"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "05rbn7z30xawd3n6w7c3ijp2yc67ga220jgqmkla9pd9wx185rzq"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/fonts/map/fontname")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-fontname"
+              (list "/doc/fonts/fontname/fontname.texi"
+                    "/fonts/map/fontname/")
+              (base32
+               "0h5im5rnhycrrkd6z10f17m2caa8lv594wf482b68qjmnxfrqnxj")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/fontname")
     (synopsis "Scheme for naming fonts in TeX")
     (description "This is Fontname, a naming scheme for (the base part of)
@@ -712,144 +786,57 @@ display, and mathematical fonts in a range of styles, based on Monotype Modern
 8A.")
     (license license:knuth)))
 
-(define-public texlive-fonts-cm-super
-  (package
-    (name "texlive-fonts-cm-super")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/latex/cm-super"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "0ybb4gi2rblzpb6wfzm2wk7dj3y2jnmkzsla7mz7g3zc12y4r2b9"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils)
-                  (ice-9 match))
-       #:builder
-       (begin
-         (use-modules (guix build utils)
-                      (ice-9 match))
-         (let ((root (string-append (assoc-ref %outputs "out")
-                                    "/share/texmf-dist/"))
-               (pkgs '(("source"         . "tex/latex/cm-super")
-                       ("cm-super-afm"   . "fonts/afm/public/cm-super")
-                       ("cm-super-type1" . "fonts/type1/public/cm-super")
-                       ("cm-super-enc"   . "fonts/enc/dvips/cm-super")
-                       ("cm-super-map"   . "fonts/map/dvips/cm-super")
-                       ("cm-super-vtex"  . "fonts/map/vtex/cm-super"))))
-           (for-each (match-lambda
-                       ((pkg . dir)
-                        (let ((target (string-append root dir)))
-                          (mkdir-p target)
-                          (copy-recursively (assoc-ref %build-inputs pkg)
-                                            target))))
-                     pkgs)
-           #t))))
-    (native-inputs
-     `(("cm-super-vtex"
-        ,(origin
-           (method svn-fetch)
-           (uri (svn-reference
-                 (url (string-append "svn://www.tug.org/texlive/tags/"
-                                     %texlive-tag "/Master/texmf-dist/"
-                                     "/fonts/map/vtex/cm-super"))
-                 (revision %texlive-revision)))
-           (file-name (string-append name "-map-vtex-" version "-checkout"))
-           (sha256
-            (base32
-             "14c9allsgfv6za9wznz4cxqxwz5nsmj8rnwvxams8fhs5rvglxqi"))))
-       ("cm-super-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/cm-super"))
-                 (revision %texlive-revision)))
-           (file-name (string-append name "-afm-" version "-checkout"))
-           (sha256
-            (base32
-             "048ih65f2nghdabdar2p957c4s2spgllmy2gxdscddwqpnmd26yn"))))
-       ("cm-super-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/cm-super"))
-                 (revision %texlive-revision)))
-           (file-name (string-append name "-type1-" version "-checkout"))
-           (sha256
-            (base32
-             "1140swk3w2ka0y4zdsq6pdifrdanb281q71p5gngbbjxdxjxf4qx"))))
-       ("cm-super-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/cm-super"))
-                 (revision %texlive-revision)))
-           (file-name (string-append name "-map-" version "-checkout"))
-           (sha256
-            (base32
-             "10r6xqbwf9wk3ylg7givwyrw1952zydc6p7fw29zjf8ijl0lndim"))))
-       ("cm-super-enc"
-        ,(origin
-           (method svn-fetch)
-           (uri (svn-reference
-                 (url (string-append "svn://www.tug.org/texlive/tags/"
-                                     %texlive-tag "/Master/texmf-dist/"
-                                     "/fonts/enc/dvips/cm-super"))
-                 (revision %texlive-revision)))
-           (file-name (string-append name "-enc-" version "-checkout"))
-           (sha256
-            (base32
-             "1pgksy96gfgyjxfhs2k04bgg7nr7i128y01kjcahr7n38080h4ij"))))))
-    (home-page "https://www.ctan.org/pkg/cm-super")
-    (synopsis "Computer Modern Super family of fonts")
-    (description "The CM-Super family provides Adobe Type 1 fonts that replace
+(define-public texlive-cm-super
+  (let ((template (simple-texlive-package
+                   "texlive-cm-super"
+                   (list "/doc/fonts/cm-super/"
+                         "/dvips/cm-super/"
+                         "/fonts/afm/public/cm-super/"
+                         "/fonts/enc/dvips/cm-super/"
+                         "/fonts/map/dvips/cm-super/"
+                         "/fonts/map/vtex/cm-super/"
+                         "/fonts/type1/public/cm-super/"
+                         "/tex/latex/cm-super/")
+                   (base32
+                    "1k3afl0x0bqbr5mnawbnp7rr2126dwn0vwnxzibm9ggvzqilnkm6")
+                   #:trivial? #t)))
+    (package
+      (inherit template)
+      (arguments
+       (substitute-keyword-arguments (package-arguments template)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (delete 'reset-gzip-timestamps)))))
+      (home-page "https://www.ctan.org/pkg/cm-super")
+      (synopsis "Computer Modern Super family of fonts")
+      (description "The CM-Super family provides Adobe Type 1 fonts that replace
 the T1/TS1-encoded Computer Modern (EC/TC), T1/TS1-encoded Concrete,
 T1/TS1-encoded CM bright and LH Cyrillic fonts (thus supporting all European
 languages except Greek), and bringing many ameliorations in typesetting
 quality.  The fonts exhibit the same metrics as the METAFONT-encoded
 originals.")
-    ;; With font exception
-    (license license:gpl2+)))
+      ;; With font exception
+      (license license:gpl2+))))
 
-(define-public texlive-fonts-lm
+(define-public texlive-fonts-cm-super
+  (deprecated-package "texlive-fonts-cm-super" texlive-cm-super))
+
+(define-public texlive-lm
   (package
-    (name "texlive-fonts-lm")
-    (version "2.004")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "http://www.gust.org.pl/projects/e-foundry/"
-                                  "latin-modern/download/lm" version "bas.zip"))
-              (sha256
-               (base32
-                "0z2s253y751m2ci5aw8nq0sf2kyg9hpimv2gyixkch9d07m2b9wp"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((root (string-append (assoc-ref %outputs "out")
-                                    "/share/texmf-dist/")))
-           (mkdir-p root)
-           (with-directory-excursion root
-             (invoke (string-append (assoc-ref %build-inputs "unzip")
-                                    "/bin/unzip")
-                     (assoc-ref %build-inputs "source")))
-           #t))))
-    (native-inputs
-     `(("unzip" ,unzip)))
+    (inherit (simple-texlive-package
+              "texlive-lm"
+              (list "/doc/fonts/lm/"
+                    "/fonts/afm/public/lm/"
+                    "/fonts/enc/dvips/lm/"
+                    "/fonts/map/dvipdfm/lm/"
+                    "/fonts/map/dvips/lm/"
+                    "/fonts/opentype/public/lm/"
+                    "/fonts/tfm/public/lm/"
+                    "/fonts/type1/public/lm/"
+                    "/tex/latex/lm/")
+              (base32
+               "0i1hwr8rp0jqyvs4qyplrirscd4w7lsgwsncyv3yzy80bsa56jq5")
+              #:trivial? #t))
     (home-page "http://www.gust.org.pl/projects/e-foundry/latin-modern/")
     (synopsis "Latin Modern family of fonts")
     (description "The Latin Modern fonts are derived from the famous Computer
@@ -860,6 +847,9 @@ Computers & Typesetting series.")
     ;; additional but not legally binding clause.
     (license license:lppl1.3c+)))
 
+(define-public texlive-fonts-lm
+  (deprecated-package "texlive-fonts-lm" texlive-lm))
+
 (define-public texlive-fonts-knuth-lib
   (package
     (name "texlive-fonts-knuth-lib")
@@ -1025,67 +1015,17 @@ Knuthian mflogo fonts described in The Metafontbook and to typeset Metafont
 logos in LaTeX documents.")
     (license license:lppl)))
 
-(define-public texlive-fonts-mflogo-font
+(define-public texlive-mflogo-font
   (package
-    (name "texlive-fonts-mflogo-font")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/fonts/type1/hoekwater/mflogo-font"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "09fsxfpiyxjljkrb52b197728bjnkcnv3bdwm4hl6hf23mbmqadf"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils)
-                  (ice-9 match))
-       #:builder
-       (begin
-         (use-modules (guix build utils)
-                      (ice-9 match))
-         (let ((root (string-append (assoc-ref %outputs "out")
-                                    "/share/texmf-dist/"))
-               (pkgs '(("source"    . "fonts/type1/hoekwater/mflogo-font")
-                       ("afm"       . "fonts/afm/hoekwater/mflogo-font")
-                       ("fonts-map" . "fonts/map/dvips/mflogo-font"))))
-           (for-each (match-lambda
-                       ((pkg . dir)
-                        (let ((target (string-append root dir)))
-                          (mkdir-p target)
-                          (copy-recursively (assoc-ref %build-inputs pkg)
-                                            target))))
-                     pkgs)
-           #t))))
-    (native-inputs
-     `(("afm"
-        ,(origin
-           (method svn-fetch)
-           (uri (svn-reference
-                 (url (string-append "svn://www.tug.org/texlive/tags/"
-                                     %texlive-tag "/Master/texmf-dist/"
-                                     "/fonts/afm/hoekwater/mflogo-font"))
-                 (revision %texlive-revision)))
-           (file-name (string-append name "-afm-" version "-checkout"))
-           (sha256
-            (base32
-             "0bx1mfhhzsk9gj1pha36q2rk0jd0y285qm62zgvdvzzzlfnk8sdb"))))
-       ("fonts-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/mflogo-font/"))
-                 (revision %texlive-revision)))
-           (file-name (string-append name "-fonts-map-" version "-checkout"))
-           (sha256
-            (base32
-             "044xrrpl8hnvj55cx2ql1ib1bcyr33nzanx5nkwxpai7fb7pg4y6"))))))
+    (inherit (simple-texlive-package
+              "texlive-mflogo-font"
+              (list "/doc/fonts/mflogo-font/README"
+                    "/fonts/afm/hoekwater/mflogo-font/"
+                    "/fonts/map/dvips/mflogo-font/"
+                    "/fonts/type1/hoekwater/mflogo-font/")
+              (base32
+               "094mknjv8ki2pvj1zin0f1z4f1w12g0cfqjiqcsawjsry4yfrmbg")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/mflogo-font")
     (synopsis "Metafont logo font")
     (description
@@ -1096,6 +1036,9 @@ source; they have since been autotraced and reissued in Adobe Type 1 format by
 Taco Hoekwater.")
     (license license:knuth)))
 
+(define-public texlive-fonts-mflogo-font
+  (deprecated-package "texlive-fonts-mflogo-font" texlive-mflogo-font))
+
 (define-public texlive-fonts-amsfonts
   (package
     (name "texlive-fonts-amsfonts")
@@ -1345,6 +1288,64 @@ output encodings, and features generation of clean UTF-8 patterns.")
 
 ;; This provides etex.src which is needed to build various formats, including
 ;; luatex.fmt and pdflatex.fmt
+(define-public texlive-etex
+  (let ((template (simple-texlive-package
+                   "texlive-etex"
+                   (list "/doc/etex/base/"
+                         "/doc/man/man1/etex.1"
+                         "/doc/man/man1/etex.man1.pdf"
+                         "/tex/plain/etex/"
+                         "/fonts/source/public/etex/")
+                   (base32
+                    "1qv6vxm5a8pw38gas3i69ivmsn79zj2yq5n5vdmh0rzic5hw2hmc")
+                   #:trivial? #t)))
+    (package
+      (inherit template)
+      (arguments
+       (substitute-keyword-arguments (package-arguments template)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             ;; Build tfm font.
+             (replace 'build
+               (lambda* (#:key inputs #:allow-other-keys)
+                 (let ((mf (assoc-ref inputs "texlive-metafont-base")))
+                   ;; Tell mf where to find mf.base
+                   (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
+                   ;; Tell mf where to look for source files
+                   (setenv "MFINPUTS"
+                           (string-append (getcwd)
+                                          "/fonts/source/public/etex/:"
+                                          mf "/share/texmf-dist/metafont/base:"
+                                          (assoc-ref inputs "texlive-fonts-cm")
+                                          "/share/texmf-dist/fonts/source/public/cm")))
+                 (invoke "mf" "-progname=mf"
+                         (string-append "\\"
+                                        "mode:=ljfour; "
+                                        "mag:=1; "
+                                        "scrollmode; "
+                                        "input xbmc10"))
+                 #t))
+             (add-after 'install 'install-font
+               (lambda* (#:key outputs #:allow-other-keys)
+                 (install-file
+                  "xbmc10.tfm"
+                  (string-append (assoc-ref outputs "out")
+                                 "/share/texmf-dist/fonts/tfm/public/etex/"))
+                 #t))))))
+      (native-inputs
+       `(("texlive-bin" ,texlive-bin)
+         ("texlive-metafont-base" ,texlive-metafont-base)
+         ("texlive-fonts-cm" ,texlive-fonts-cm)))
+      (home-page "https://www.ctan.org/pkg/etex")
+      (synopsis "Extended version of TeX")
+      (description
+       "This package provides an extended version of TeX (which is capable of
+running as if it were TeX unmodified).  E-TeX has been specified by the LaTeX
+team as the engine for the development of LaTeX2e; as a result, LaTeX
+programmers may assume e-TeX functionality.  The pdftex engine directly
+incorporates the e-TeX extensions.")
+      (license license:knuth))))
+
 (define-public texlive-tex-plain
   (package
     (name "texlive-tex-plain")
@@ -1995,17 +1996,345 @@ L7X and UTF-8 encodings.")
     ;; the hyph-utf8 package we choose the LPPL license.
     (license license:lppl)))
 
-(define-public texlive-hyph-utf8
+(define-public texlive-hyphen-mongolian
   (package
-    (inherit (simple-texlive-package
-              "texlive-hyph-utf8"
-              (list "/source/generic/hyph-utf8/"
-                    "/source/luatex/hyph-utf8/"
-                    "/doc/luatex/hyph-utf8/"
-                    "/tex/luatex/hyph-utf8/etex.src"
-                    ;; Used to extract luatex-hyphen.lua
-                    "/tex/latex/base/docstrip.tex"
-
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-mongolian" '("mn-cyrl-x-lmc" "mn-cyrl")
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-mn-cyrl-x-lmc.tex"
+                    "/tex/generic/hyph-utf8/patterns/tex/hyph-mn-cyrl.tex")
+              (base32
+               "0lqq3jgwgnclb1cn3x99xmk90xra9q51b00ypwy5crssmy023hqc")))
+    (synopsis "Mongolian hyphenation patterns in Cyrillic script")
+    (description "This package provides hyphenation patterns for Mongolian in
+T2A, LMC and UTF-8 encodings.")
+    ;; Either of these licenses
+    (license (list license:lppl1.3+ license:expat))))
+
+(define-public texlive-hyphen-norwegian
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-norwegian" '("nb" "nn" "no")
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-nb.tex"
+                    "/tex/generic/hyph-utf8/patterns/tex/hyph-nn.tex"
+                    "/tex/generic/hyph-utf8/patterns/tex/hyph-no.tex")
+              (base32
+               "1fxnf671yz0p3lmdkspna7fjh96br1jy6yf7v17yh4fxwry3s4yz")))
+    (synopsis "Norwegian Bokmal and Nynorsk hyphenation patterns")
+    (description "This package provides hyphenation patterns for Norwegian
+Bokmal and Nynorsk in T1/EC and UTF-8 encodings.")
+    (license (license:non-copyleft
+              "/tex/generic/hyph-utf8/patterns/tex/hyph-no.tex"
+              "FSF All permissive license"))))
+
+(define-public texlive-hyphen-occitan
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-occitan" "oc"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-oc.tex")
+              (base32
+               "1y6j6ac9ncn79p7hnp6mdwdsw9ij14zyjby5iwdhpvzzn7yyc7p8")))
+    (synopsis "Occitan hyphenation patterns")
+    (description "This package provides hyphenation patterns for Occitan in
+T1/EC and UTF-8 encodings.  They are supposed to be valid for all the Occitan
+variants spoken and written in the wide area called 'Occitanie' by the French.
+It ranges from the Val d'Aran within Catalunya, to the South Western Italian
+Alps encompassing the southern half of the French pentagon.")
+    (license license:lppl1.0+)))
+
+(define-public texlive-hyphen-piedmontese
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-piedmontese" "pms"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-pms.tex")
+              (base32
+               "00fqzymkg374r3dzf1y82k6b18bqrf688vnjv0vkvw5a45srlb5r")))
+    (synopsis "Piedmontese hyphenation patterns")
+    (description "This package provides hyphenation patterns for Piedmontese
+in ASCII encoding.  Compliant with 'Gramatica dla lengua piemonteisa' by
+Camillo Brero.")
+    (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-polish
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-polish" "pl"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-pl.tex")
+              (base32
+               "0dzq8ca96q7m5bslh51x8d30pdb86glh2gn3mmvq5ip813ckwh3s")))
+    (synopsis "Polish hyphenation patterns")
+    (description "This package provides hyphenation patterns for Polish in QX
+and UTF-8 encodings.")
+    ;; No differing license declared, so we choose the project license.
+    (license license:lppl)))
+
+(define-public texlive-hyphen-portuguese
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-portuguese" "pt"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-pt.tex")
+              (base32
+               "1waxrmm33fd2qfc4kiaiblg8kwzasrvgq4j3l14z733d0hlg4rfz")))
+    (synopsis "Portuguese hyphenation patterns")
+    (description "This package provides hyphenation patterns for Portuguese in
+T1/EC and UTF-8 encodings.")
+    (license license:bsd-3)))
+
+(define-public texlive-hyphen-romanian
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-romanian" "ro"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-ro.tex")
+              (base32
+               "12i1vryl51yhdpj163ahfyiy21rjmf4gkqgslpriirdjmyrwrs65")))
+    (synopsis "Romanian hyphenation patterns")
+    (description "This package provides hyphenation patterns for Romanian in
+T1/EC and UTF-8 encodings.")
+    ;; No differing license declared, so we choose the project license.
+    (license license:lppl)))
+
+(define-public texlive-hyphen-romansh
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-romansh" "rm"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-rm.tex")
+              (base32
+               "06wan8i4appc1zfvc0q4cgnfv1nj0qgk02w3sg56zc11hf8sywl9")))
+    (synopsis "Romansh hyphenation patterns")
+    (description "This package provides hyphenation patterns for Romansh in
+ASCII encodings.  They are supposed to comply with the rules indicated by the
+Lia Rumantscha (Romansh language society).")
+    (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-russian
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-russian" "ru"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-ru.tex")
+              (base32
+               "09s4vq23x4vff08ykmf08dvcdradjzzwvyys8p2wk6jxaqp980s3")))
+    (synopsis "Russian hyphenation patterns")
+    (description "This package provides hyphenation patterns for Russian in
+T2A and UTF-8 encodings.")
+    (license license:lppl1.2+)))
+
+(define-public texlive-hyphen-sanskrit
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-sanskrit" "sa"
+              (list "/doc/generic/hyph-utf8/sa/hyphenmin.txt"
+                    "/tex/generic/hyph-utf8/patterns/tex/hyph-sa.tex")
+              (base32
+               "0grnn09l4i5yridx10yhm6dg9sbhgc2pmsp1p6hrcy7lzkqwdvs3")))
+    (synopsis "Sanskrit hyphenation patterns")
+    (description "This package provides hyphenation patterns for Sanskrit and
+Prakrit in longdesc transliteration, and in Devanagari, Bengali, Kannada,
+Malayalam longdesc and Telugu scripts for Unicode engines.")
+    ;; "You may freely use, copy, modify and/or distribute this file."
+    (license (license:non-copyleft
+              "file:///tex/generic/hyph-utf8/patterns/tex/hyph-sa.tex"))))
+
+(define-public texlive-hyphen-serbian
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-serbian" '("sh-cyrl" "sh-latn" "sr-cyrl")
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-sh-cyrl.tex"
+                    "/tex/generic/hyph-utf8/patterns/tex/hyph-sh-latn.tex"
+                    "/tex/generic/hyph-utf8/patterns/tex/hyph-sr-cyrl.tex")
+              (base32
+               "0fhdfydyaspb8dwirlf24vn7y9dzwmhsld0mmw0fz1lmcfaj252n")))
+    (synopsis "Serbian hyphenation patterns")
+    (description "This package provides hyphenation patterns for Serbian in
+T1/EC, T2A and UTF-8 encodings.")
+    ;; Any version of the GPL.
+    (license license:gpl3+)))
+
+(define-public texlive-hyphen-slovak
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-slovak" "sk"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-sk.tex")
+              (base32
+               "1cgw6fmyci3za3vsa49b6m74wqv582w0rpca7s9xva3hqm1m5qdg")))
+    (synopsis "Slovak hyphenation patterns")
+    (description "This package provides hyphenation patterns for Slovak in
+T1/EC and UTF-8 encodings.")
+    (license license:gpl2+)))
+
+(define-public texlive-hyphen-slovenian
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-slovenian" "sl"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-sl.tex")
+              (base32
+               "1ixf2pxir9xf1gggq9k28xxglsq9bwqlghd9cl4amk5vrn5bjbds")))
+    (synopsis "Slovenian hyphenation patterns")
+    (description "This package provides hyphenation patterns for Slovenian in
+T1/EC and UTF-8 encodings.")
+    ;; Either license
+    (license (list license:lppl1.0+ license:expat))))
+
+(define-public texlive-hyphen-spanish
+  (package
+    ;; The source files "eshyph-make.lua" and "eshyph.src" are provided to
+    ;; generate obsolete hyphenation patterns, which aren't included in a
+    ;; default TeX Live distribution, so we don't include them either.
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-spanish" "es"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-es.tex")
+              (base32
+               "0jgs0zzyk2wwrjbx2hqdh5qggrnik9xmsxygbfhlb7gdrcrs0mbj")))
+    (synopsis "Hyphenation patterns for Spanish")
+    (description "The package provides hyphenation patterns for Spanish in
+T1/EC and UTF-8 encodings.")
+    (license license:expat)))
+
+(define-public texlive-hyphen-swedish
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-swedish" "sv"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-sv.tex")
+              (base32
+               "12sf9f43zwyzb4cn57yry8r4zmwdc7cfdljn3qwxwrny4m3sw4w8")))
+    (synopsis "Swedish hyphenation patterns")
+    (description "This package provides hyphenation patterns for Swedish in
+T1/EC and UTF-8 encodings.")
+    (license license:lppl1.2+)))
+
+(define-public texlive-hyphen-thai
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-thai" "th"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-th.tex")
+              (base32
+               "15k1n4xdw8zzd5nrh76s53z4j95gxa4i2h1av5gx5vrjgblzzl97")))
+    (synopsis "Thai hyphenation patterns")
+    (description "This package provides hyphenation patterns for Thai in LTH
+and UTF-8 encodings.")
+    (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-turkish
+  (let ((template (texlive-hyphen-package
+                   "texlive-hyphen-turkish" "tr"
+                   (list "/source/generic/hyph-utf8/languages/tr/generate_patterns_tr.rb")
+                   (base32
+                    "0rvlhs2z2sn312lqsf44bzknid5dry7d2sl2q1whfvr0y4qj1g8f"))))
+    (package
+      (inherit template)
+      (arguments
+       (substitute-keyword-arguments (package-arguments template)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-before 'build 'build-patterns
+               (lambda _
+                 (let ((target (string-append (getcwd)
+                                              "/tex/generic/hyph-utf8/patterns/tex")))
+                   (mkdir-p target)
+                   (with-directory-excursion "source/generic/hyph-utf8/languages/tr/"
+                     (substitute* "generate_patterns_tr.rb"
+                       (("\\$file = File.new.*")
+                        (string-append "$file = File.new(\"" target
+                                       "/hyph-tr.tex\",\"w\")\n")))
+                     (invoke "ruby" "generate_patterns_tr.rb"))
+                   #t)))
+             (add-after 'install 'install-hyph-tr.tex
+               (lambda* (#:key inputs outputs #:allow-other-keys)
+                 (let* ((out (assoc-ref outputs "out"))
+                        (target (string-append out "/share/texmf-dist/tex")))
+                   (copy-recursively "tex" target)
+                   #t)))))))
+      (synopsis "Hyphenation patterns for Turkish")
+      (description "The package provides hyphenation patterns for Turkish in
+T1/EC and UTF-8 encodings.  The patterns for Turkish were first produced for
+the Ottoman Texts Project in 1987 and were suitable for both Modern Turkish
+and Ottoman Turkish in Latin script, however the required character set didn't
+fit into EC encoding, so support for Ottoman Turkish had to be dropped to keep
+compatibility with 8-bit engines.")
+      (license license:lppl1.0+))))
+
+(define-public texlive-hyphen-turkmen
+  (let ((template (texlive-hyphen-package
+                   "texlive-hyphen-turkmen" "tk"
+                   (list "/source/generic/hyph-utf8/languages/tk/generate_patterns_tk.rb")
+                   (base32
+                    "1wlqx8wb0wsqhdv823brc3i8w1vf4m4bkb2vg917j5dq8p8p71aw"))))
+    (package
+      (inherit template)
+      (arguments
+       (substitute-keyword-arguments (package-arguments template)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-before 'build 'build-patterns
+               (lambda _
+                 (let ((target (string-append (getcwd)
+                                              "/tex/generic/hyph-utf8/patterns/tex")))
+                   (mkdir-p target)
+                   (with-directory-excursion "source/generic/hyph-utf8/languages/tk/"
+                     (substitute* "generate_patterns_tk.rb"
+                       (("\\$file = File.new.*")
+                        (string-append "$file = File.new(\"" target
+                                       "/hyph-tr.tex\",\"w\")\n")))
+                     (invoke "ruby" "generate_patterns_tk.rb"))
+                   #t)))
+             (add-after 'install 'install-hyph-tk.tex
+               (lambda* (#:key inputs outputs #:allow-other-keys)
+                 (let* ((out (assoc-ref outputs "out"))
+                        (target (string-append out "/share/texmf-dist/tex")))
+                   (copy-recursively "tex" target)
+                   #t)))))))
+      (synopsis "Hyphenation patterns for Turkmen")
+      (description "The package provides hyphenation patterns for Turkmen in
+T1/EC and UTF-8 encodings.")
+      (license license:public-domain))))
+
+(define-public texlive-hyphen-ukrainian
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-ukrainian" "uk"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-uk.tex")
+              (base32
+               "17z0gmw5svsf5zlhjkckwk4y21g7prfwj473jlqnwcsr8a941gsf")))
+    (synopsis "Ukrainian hyphenation patterns")
+    (description "This package provides hyphenation patterns for Ukrainian in
+T2A and UTF-8 encodings.")
+    ;; No version specified
+    (license license:lppl)))
+
+(define-public texlive-hyphen-uppersorbian
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-uppersorbian" "hsb"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-hsb.tex")
+              (base32
+               "1q42s32cfbynlnzn9hpcldi77fszi5xkn1c85l8xqjmfydqbqdyi")))
+    (synopsis "Upper Sorbian hyphenation patterns")
+    (description "This package provides hyphenation patterns for Upper Sorbian
+in T1/EC and UTF-8 encodings.")
+    (license license:lppl1.3a+)))
+
+(define-public texlive-hyphen-welsh
+  (package
+    (inherit (texlive-hyphen-package
+              "texlive-hyphen-welsh" "cy"
+              (list "/tex/generic/hyph-utf8/patterns/tex/hyph-cy.tex")
+              (base32
+               "0h8yjj5zdg0hvpb2vx9gi376536nl59hp8w286z1a13diaayg1m2")))
+    (synopsis "Welsh hyphenation patterns")
+    (description "This package provides hyphenation patterns for Welsh in
+T1/EC and UTF-8 encodings.")
+    ;; Either license
+    (license (list license:lppl1.0+ license:expat))))
+
+(define-public texlive-hyph-utf8
+  (package
+    (inherit (simple-texlive-package
+              "texlive-hyph-utf8"
+              (list "/source/generic/hyph-utf8/"
+                    "/source/luatex/hyph-utf8/"
+                    "/doc/luatex/hyph-utf8/"
+                    "/tex/luatex/hyph-utf8/etex.src"
+                    ;; Used to extract luatex-hyphen.lua
+                    "/tex/latex/base/docstrip.tex"
+
                     ;; Documentation; we can't use the whole directory because
                     ;; it includes files from other packages.
                     "/doc/generic/hyph-utf8/CHANGES"
@@ -2168,187 +2497,328 @@ bundle.")
 (define-public texlive-generic-dehyph-exptl
   (deprecated-package "texlive-generic-dehyph-exptl" texlive-dehyph-exptl))
 
-(define-public texlive-latex-base
-  (let ((texlive-dir
-         (lambda (dir hash)
-           (origin
-             (method svn-fetch)
-             (uri (svn-reference
-                   (url (string-append "svn://www.tug.org/texlive/tags/"
-                                       %texlive-tag "/Master/texmf-dist/"
-                                       dir))
-                   (revision %texlive-revision)))
-             (file-name (string-append "texlive-generic-"
-                                       (last (string-split
-                                               (string-drop-right dir 1) #\/))
-                                       "-" (number->string %texlive-revision)
-                                       "-checkout"))
-             (sha256 (base32 hash))))))
+(define-public texlive-ukrhyph
+  (package
+    (inherit (simple-texlive-package
+              "texlive-ukrhyph"
+              (list "/doc/generic/ukrhyph/"
+                    "/tex/generic/ukrhyph/")
+              (base32
+               "01ma274sixcrbpb7fpqkxwfvrnzfj2srv9b4a42rfnph1pdql74z")
+              #:trivial? #t))
+    (home-page "https://www.ctan.org/pkg/ukrhyph")
+    (synopsis "Hyphenation patterns for Ukrainian")
+    (description "The package provides a range of hyphenation patterns for
+Ukrainian, depending on the encoding of the output font including the standard
+T2A.")
+    (license license:lppl)))
+
+(define-public texlive-ruhyphen
+  (let ((template (simple-texlive-package
+                   "texlive-ruhyphen"
+                   (list "/source/generic/ruhyphen/"
+                         "/tex/generic/ruhyphen/")
+                   (base32
+                    "18n1bqhh8jv765vz3a3fjwffy7m71vhwx9yq8zl0p5j7p72q9qcn")
+                   #:trivial? #t)))
     (package
-      (name "texlive-latex-base")
-      (version (number->string %texlive-revision))
-      (source (origin
-                (method svn-fetch)
-                (uri (texlive-ref "latex" "base"))
-                (file-name (string-append name "-" version "-checkout"))
-                (sha256
-                 (base32
-                  "17bqrzzjz16k52sc7ydl4vw7ddy2z3g0p1xsk2c35h1ynq9h3wwm"))))
-      (build-system gnu-build-system)
+      (inherit template)
       (arguments
-       `(#:modules ((guix build gnu-build-system)
-                    (guix build utils)
-                    (ice-9 match)
-                    (srfi srfi-1)
-                    (srfi srfi-26))
-         #:tests? #f                    ; no tests
-         #:phases
-         (modify-phases %standard-phases
-           (delete 'configure)
-           (replace 'build
-             (lambda* (#:key inputs #:allow-other-keys)
-               ;; Find required fonts
-               (setenv "TFMFONTS"
-                       (string-append (assoc-ref inputs "texlive-fonts-cm")
-                                      "/share/texmf-dist/fonts/tfm/public/cm:"
-                                      (assoc-ref inputs "texlive-fonts-latex")
-                                      "/share/texmf-dist/fonts/tfm/public/latex-fonts:"
-                                      (assoc-ref inputs "texlive-fonts-knuth-lib")
-                                      "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
+       (substitute-keyword-arguments (package-arguments template)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (replace 'build
+               (lambda _
+                 (let ((cwd (getcwd)))
+                   ;; Remove generated files.
+                   (for-each delete-file
+                             (find-files "tex/generic/ruhyphen/"
+                                         "^cyry.*.tex$"))
+                   (substitute* "source/generic/ruhyphen/Makefile"
+                     (("./mkcyryo") (string-append cwd "/source/generic/ruhyphen/mkcyryo")))
+                   (with-directory-excursion "tex/generic/ruhyphen"
+                     (invoke "make" "-f"
+                             (string-append cwd "/source/generic/ruhyphen/Makefile"))))))))))
+      (native-inputs
+       `(("coreutils" ,coreutils)
+         ("gawk" ,gawk)
+         ("sed" ,sed)
+         ("grep" ,grep)
+         ("perl" ,perl)))
+      (home-page "https://www.ctan.org/pkg/ruhyphen")
+      (synopsis "Hyphenation patterns for Russian")
+      (description "The package provides a collection of Russian hyphenation
+patterns supporting a number of Cyrillic font encodings, including T2,
+UCY (Omega Unicode Cyrillic), LCY, LWN (OT2), and koi8-r.")
+      (license license:lppl))))
+
+(define-public texlive-kpathsea
+  (package
+    (inherit (simple-texlive-package
+              "texlive-kpathsea"
+              (list "/web2c/amiga-pl.tcx"
+                    "/web2c/cp1250cs.tcx"
+                    "/web2c/cp1250pl.tcx"
+                    "/web2c/cp1250t1.tcx"
+                    "/web2c/cp227.tcx"
+                    "/web2c/cp852-cs.tcx"
+                    "/web2c/cp852-pl.tcx"
+                    "/web2c/cp8bit.tcx"
+                    "/web2c/empty.tcx"
+                    "/web2c/fmtutil.cnf"
+                    "/web2c/il1-t1.tcx"
+                    "/web2c/il2-cs.tcx"
+                    "/web2c/il2-pl.tcx"
+                    "/web2c/il2-t1.tcx"
+                    "/web2c/kam-cs.tcx"
+                    "/web2c/kam-t1.tcx"
+                    "/web2c/macce-pl.tcx"
+                    "/web2c/macce-t1.tcx"
+                    "/web2c/maz-pl.tcx"
+                    "/web2c/mktex.cnf"
+                    "/web2c/mktex.opt"
+                    "/web2c/mktexdir"
+                    "/web2c/mktexdir.opt"
+                    "/web2c/mktexnam"
+                    "/web2c/mktexnam.opt"
+                    "/web2c/mktexupd"
+                    "/web2c/natural.tcx"
+                    "/web2c/tcvn-t5.tcx"
+                    "/web2c/viscii-t5.tcx")
+              (base32
+               "0ajfp9kr330lcm2ymr3kl9zn6y2xjkrzpa0c0azc4qdm5jllawb9")
+              #:trivial? #t))
+    (home-page "https://www.tug.org/texlive/")
+    (synopsis "Files related to the path searching library for TeX")
+    (description "Kpathsea is a library and utility programs which provide
+path searching facilities for TeX file types, including the self-locating
+feature required for movable installations, layered on top of a general search
+mechanism.  This package provides supporting files.")
+    (license license:lgpl3+)))
+
+(define-public texlive-latexconfig
+  (package
+    (inherit (simple-texlive-package
+              "texlive-latexconfig"
+              (list "/tex/latex/latexconfig/")
+              (base32
+               "1wa7yhdpnz1nyidwgli68fyr33jn951bnniqrih5lj98k09rqc3h")
+              #:trivial? #t))
+    (home-page "https://www.tug.org/")
+    (synopsis "Configuration files for LaTeX-related formats")
+    (description "The package provides configuration files for LaTeX-related
+formats.")
+    (license license:lppl)))
+
+(define-public texlive-latex-base
+  (package
+    (name "texlive-latex-base")
+    (version (number->string %texlive-revision))
+    (source (texlive-origin
+             name version
+             (list "/doc/latex/base/"
+                   "/source/latex/base/"
+                   ;; Almost all files in /tex/latex/base are generated, but
+                   ;; these are not:
+                   "/tex/latex/base/idx.tex"
+                   "/tex/latex/base/lablst.tex"
+                   "/tex/latex/base/lppl.tex"
+                   "/tex/latex/base/ltnews.cls"
+                   "/tex/latex/base/ltxcheck.tex"
+                   "/tex/latex/base/ltxguide.cls"
+                   "/tex/latex/base/minimal.cls"
+                   "/tex/latex/base/sample2e.tex"
+                   "/tex/latex/base/small2e.tex"
+                   "/tex/latex/base/source2e.tex"
+                   "/tex/latex/base/testpage.tex"
+                   "/tex/latex/base/texsys.cfg")
+             (base32
+              "0f8d41wk1gb7i6xq1a10drwhhayc50pg9nwzjkrqnxrv0pcc08w5")))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (ice-9 match)
+                  (srfi srfi-26))
+       #:tests? #f                      ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'build
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Find required fonts
+             (setenv "TFMFONTS"
+                     (string-join
+                      (map (match-lambda
+                             ((pkg-name . dir)
+                              (string-append
+                               (assoc-ref inputs pkg-name)
+                               "/share/texmf-dist/fonts/tfm/public"
+                               dir)))
+                           '(("texlive-etex" . "/etex")
+                             ("texlive-fonts-cm" . "/cm")
+                             ("texlive-fonts-latex" . "/latex-fonts")
+                             ("texlive-fonts-knuth-lib" . "/knuth-lib")))
+                      ":"))
+             (let ((cwd (getcwd)))
                (setenv "TEXINPUTS"
                        (string-append
-                        (getcwd) ":"
-                        (getcwd) "/build:"
+                        cwd "//:"
+                        cwd "/source/latex/base//:"
+                        cwd "/build:"
                         (string-join
                          (map (match-lambda ((_ . dir) dir)) inputs)
-                         "//:")))
+                         "//:"))))
 
-               ;; Create an empty texsys.cfg, because latex.ltx wants to include
-               ;; it.  This file must exist and it's fine if it's empty.
-               (with-output-to-file "texsys.cfg"
-                 (lambda _ (format #t "%")))
-
-               (mkdir "build")
+             ;; This is the actual build step.
+             (mkdir "build")
+             (invoke "tex" "-ini" "-interaction=scrollmode"
+                     "-output-directory=build" "unpack.ins")
+
+             ;; XXX: We can't build all formats at this point, nor are they
+             ;; part of the LaTeX base, so we disable them.  Actually, we
+             ;; should be running this all in a profile hook, so that only
+             ;; selected formats and hyphenation patterns are included, but it
+             ;; takes long and TeX Live isn't designed to be modular like
+             ;; that.  Everything operates on a shared directory, which we
+             ;; would only have at profile generation time.
+             (let ((disabled-formats
+                    '("aleph aleph" "lamed aleph" "uptex uptex" "euptex euptex"
+                      "eptex eptex" "ptex ptex" "pdfxmltex pdftex" "platex eptex"
+                      "csplain pdftex" "mf mf-nowin" "mex pdftex" "pdfmex pdftex"
+                      "cont-en xetex" "cont-en pdftex" "pdfcsplain xetex"
+                      "pdfcsplain pdftex" "pdfcsplain luatex" "cslatex pdftex"
+                      "mptopdf pdftex" "uplatex euptex" "jadetex pdftex"
+                      "amstex pdftex" "pdfcslatex pdftex" "lollipop tex"
+                      "xmltex pdftex" "pdfjadetex pdftex" "eplain pdftex"
+                      "texsis pdftex" "mltex pdftex" "utf8mex pdftex")))
                (mkdir "web2c")
-               (invoke "luatex" "-ini" "-interaction=batchmode"
-                       "-output-directory=build" "unpack.ins")
-               (invoke "tex" "-ini" "-interaction=batchmode"
-                       "-output-directory=web2c" "tex.ini")
-               ;; LaTeX, pdfetex/pdftex, and XeTeX require e-TeX, which
-               ;; is enabled only in extended mode (activated with a
-               ;; leading asterisk).  We should not use luatex here,
-               ;; because that would make the generated format files
-               ;; incompatible with any other TeX engine.
-               (for-each (lambda (format)
-                           (invoke "latex" "-ini" "-interaction=batchmode"
-                                   "-output-directory=web2c"
-                                   "-translate-file=cp227.tcx"
-                                   (string-append "*" format ".ini")))
-                         '("latex"
-                           "pdflatex"
-                           "pdfetex"))
-               (for-each (lambda (format)
-                           (invoke format "-ini" "-interaction=batchmode"
-                                   "-output-directory=web2c"
-                                   (string-append "*" format ".ini")))
-                         '("xetex"
-                           "xelatex"))
-               (for-each (lambda (format)
-                           (invoke "luatex" "-ini" "-interaction=batchmode"
-                                   "-output-directory=web2c"
-                                   (string-append format ".ini")))
-                         '("dviluatex" "dvilualatex" "luatex" "lualatex"))
-               #t))
-           (replace 'install
-             (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let* ((out (assoc-ref outputs "out"))
-                      (target (string-append
-                               out "/share/texmf-dist/tex/latex/base"))
-                      (web2c (string-append
-                              out "/share/texmf-dist/web2c"))
-                      (support-files (assoc-ref inputs "texlive-latex-base-support-files")))
-                 (mkdir-p target)
-                 (mkdir-p web2c)
-                 (for-each delete-file (find-files "." "\\.(log|aux)$"))
-                 (for-each (cut install-file <> target)
-                           (find-files "build" ".*"))
-                 (for-each (cut install-file <> web2c)
-                           (find-files "web2c" ".*"))
-                 ;; pdftex is really just the same as pdfetex, but since it
-                 ;; doesn't have its own format file, we need to copy it.
-                 (copy-file "web2c/pdfetex.fmt"
-                            (string-append web2c "/pdftex.fmt"))
-                 ;; "source" is missing the support files as per doc/latex/base/manifest.txt.
-                 ;; FIXME: We are probably not packaging this right.
-                 (for-each (lambda (file)
-                             (install-file
-                              (string-append support-files "/" file)
-                              target))
-                           '("ltxguide.cls" "ltnews.cls" "minimal.cls" "idx.tex"
-                             "lablst.tex" "testpage.tex" "ltxcheck.tex"))
-                 ;; Install configurations
-                 (copy-recursively
-                  (assoc-ref inputs "texlive-latex-latexconfig")
-                  (string-append out "/share/texmf-dist/tex/latex/latexconfig"))
-                 (copy-recursively
-                  (assoc-ref inputs "texlive-generic-config")
-                  (string-append out "/share/texmf-dist/tex/generic/config"))
-                 (copy-recursively
-                  (assoc-ref inputs "texlive-generic-hyphen")
-                  (string-append out "/share/texmf-dist/tex/generic/hyphen"))
-                 (copy-recursively
-                  (assoc-ref inputs "texlive-generic-ruhyphen")
-                  (string-append out "/share/texmf-dist/tex/generic/ruhyphen"))
-                 (copy-recursively
-                  (assoc-ref inputs "texlive-generic-ukrhyph")
-                  (string-append out "/share/texmf-dist/tex/generic/ukrhyph"))
-                 #t))))))
-      (native-inputs
-       `(("texlive-bin" ,texlive-bin)
-         ("texlive-generic-unicode-data" ,texlive-generic-unicode-data)
-         ("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl)
-         ("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files)
-         ("texlive-latex-latexconfig"
-          ,(texlive-dir "tex/latex/latexconfig/"
-                        "1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf"))
-         ("texlive-generic-hyphen"
-          ,(texlive-dir "tex/generic/hyphen/"
-                        "0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd"))
-         ("texlive-generic-ruhyphen"
-          ,(texlive-dir "tex/generic/ruhyphen/"
-                        "14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd"))
-         ("texlive-generic-ukrhyph"
-          ,(texlive-dir "tex/generic/ukrhyph/"
-                        "1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv"))
-         ("texlive-generic-config"
-          ,(texlive-dir "tex/generic/config/"
-                        "1v90iihy112q93zdpblpdk8zv8rf99fgslsg06s1sxm27zjm9nap"))
-         ("texlive-latex-base-support-files"
-          ,(origin
-             (method svn-fetch)
-             (uri (svn-reference
-                   (url (string-append "svn://www.tug.org/texlive/tags/"
-                                       %texlive-tag "/Master/texmf-dist/"
-                                       "/tex/latex/base"))
-                   (revision %texlive-revision)))
-             (file-name (string-append name "-" version "-checkout"))
-             (sha256
-              (base32
-               "18wy8dlcw8adl6jzqwbg54pdwlhs8hilnfvqbw6ikj6y3zhqkj7q"))))
-         ("texlive-tex-plain" ,texlive-tex-plain)
-         ("texlive-fonts-cm" ,texlive-fonts-cm)
-         ("texlive-fonts-latex" ,texlive-fonts-latex)
-         ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)))
-      (propagated-inputs
-       `(("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8)))
-      (home-page "https://www.ctan.org/pkg/latex-base")
-      (synopsis "Base sources of LaTeX")
-      (description
-       "This bundle comprises the source of LaTeX itself, together with several
+               (install-file (string-append
+                              (assoc-ref inputs "texlive-kpathsea")
+                              "/share/texmf-dist/web2c/fmtutil.cnf")
+                             "web2c")
+               (make-file-writable "web2c/fmtutil.cnf")
+               (substitute* "web2c/fmtutil.cnf"
+                 (((string-append "^(" (string-join disabled-formats "|") ")") m)
+                  (string-append "#! " m))))
+             (invoke "fmtutil-sys" "--all"
+                     "--fmtdir=web2c"
+                     (string-append "--cnffile=web2c/fmtutil.cnf"))
+             ;; We don't actually want to install it.
+             (delete-file "web2c/fmtutil.cnf")
+             #t))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (root (string-append out "/share/texmf-dist"))
+                    (target (string-append root "/tex/latex/base"))
+                    (web2c (string-append root "/web2c"))
+                    (makeindex (string-append root "/makeindex/latex")))
+               (for-each delete-file (find-files "." "\\.(log|aux)$"))
+
+               ;; The usedir directive in docstrip.ins is ignored, so these
+               ;; two files end up in the wrong place.  Move them.
+               (mkdir-p makeindex)
+               (for-each (lambda (file)
+                           (install-file file makeindex)
+                           (delete-file file))
+                         '("build/gglo.ist"
+                           "build/gind.ist"))
+               (for-each (cut install-file <> target)
+                         (find-files "build" ".*"))
+               (for-each (cut install-file <> web2c)
+                         (find-files "web2c" ".*"))
+               #t))))))
+    (native-inputs
+     `(("texlive-bin" ,texlive-bin)
+       ("texlive-tex-ini-files" ,texlive-tex-ini-files)
+       ("texlive-tex-plain" ,texlive-tex-plain)
+       ("texlive-kpathsea" ,texlive-kpathsea)
+       ("texlive-fonts-cm" ,texlive-fonts-cm)
+       ("texlive-fonts-latex" ,texlive-fonts-latex)
+       ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)
+       ("texlive-luatexconfig"
+        ,(texlive-origin
+          "texlive-luatexconfig" (number->string %texlive-revision)
+          (list "/tex/generic/config/luatex-unicode-letters.tex"
+                "/tex/generic/config/luatexiniconfig.tex"
+                "/web2c/texmfcnf.lua")
+          (base32
+           "0cs67a8wwh4s5p5gn8l49jyccgy7glw8mfq5klgn3dfsl2fdlhk7")))))
+    (propagated-inputs
+     `(("texlive-dehyph-exptl" ,texlive-dehyph-exptl)
+       ("texlive-etex" ,texlive-etex)
+       ("texlive-hyph-utf8" ,texlive-hyph-utf8)
+       ("texlive-hyphen-base" ,texlive-hyphen-base)
+       ("texlive-hyphen-afrikaans" ,texlive-hyphen-afrikaans)
+       ("texlive-hyphen-ancientgreek" ,texlive-hyphen-ancientgreek)
+       ("texlive-hyphen-armenian" ,texlive-hyphen-armenian)
+       ("texlive-hyphen-basque" ,texlive-hyphen-basque)
+       ("texlive-hyphen-belarusian" ,texlive-hyphen-belarusian)
+       ("texlive-hyphen-bulgarian" ,texlive-hyphen-bulgarian)
+       ("texlive-hyphen-catalan" ,texlive-hyphen-catalan)
+       ("texlive-hyphen-chinese" ,texlive-hyphen-chinese)
+       ("texlive-hyphen-churchslavonic" ,texlive-hyphen-churchslavonic)
+       ("texlive-hyphen-coptic" ,texlive-hyphen-coptic)
+       ("texlive-hyphen-croatian" ,texlive-hyphen-croatian)
+       ("texlive-hyphen-czech" ,texlive-hyphen-czech)
+       ("texlive-hyphen-danish" ,texlive-hyphen-danish)
+       ("texlive-hyphen-dutch" ,texlive-hyphen-dutch)
+       ("texlive-hyphen-english" ,texlive-hyphen-english)
+       ("texlive-hyphen-esperanto" ,texlive-hyphen-esperanto)
+       ("texlive-hyphen-estonian" ,texlive-hyphen-estonian)
+       ("texlive-hyphen-ethiopic" ,texlive-hyphen-ethiopic)
+       ("texlive-hyphen-finnish" ,texlive-hyphen-finnish)
+       ("texlive-hyphen-french" ,texlive-hyphen-french)
+       ("texlive-hyphen-friulan" ,texlive-hyphen-friulan)
+       ("texlive-hyphen-galician" ,texlive-hyphen-galician)
+       ("texlive-hyphen-georgian" ,texlive-hyphen-georgian)
+       ("texlive-hyphen-german" ,texlive-hyphen-german)
+       ("texlive-hyphen-greek" ,texlive-hyphen-greek)
+       ("texlive-hyphen-hungarian" ,texlive-hyphen-hungarian)
+       ("texlive-hyphen-icelandic" ,texlive-hyphen-icelandic)
+       ("texlive-hyphen-indic" ,texlive-hyphen-indic)
+       ("texlive-hyphen-indonesian" ,texlive-hyphen-indonesian)
+       ("texlive-hyphen-interlingua" ,texlive-hyphen-interlingua)
+       ("texlive-hyphen-irish" ,texlive-hyphen-irish)
+       ("texlive-hyphen-italian" ,texlive-hyphen-italian)
+       ("texlive-hyphen-kurmanji" ,texlive-hyphen-kurmanji)
+       ("texlive-hyphen-latin" ,texlive-hyphen-latin)
+       ("texlive-hyphen-latvian" ,texlive-hyphen-latvian)
+       ("texlive-hyphen-lithuanian" ,texlive-hyphen-lithuanian)
+       ("texlive-hyphen-mongolian" ,texlive-hyphen-mongolian)
+       ("texlive-hyphen-norwegian" ,texlive-hyphen-norwegian)
+       ("texlive-hyphen-occitan" ,texlive-hyphen-occitan)
+       ("texlive-hyphen-piedmontese" ,texlive-hyphen-piedmontese)
+       ("texlive-hyphen-polish" ,texlive-hyphen-polish)
+       ("texlive-hyphen-portuguese" ,texlive-hyphen-portuguese)
+       ("texlive-hyphen-romanian" ,texlive-hyphen-romanian)
+       ("texlive-hyphen-romansh" ,texlive-hyphen-romansh)
+       ("texlive-hyphen-russian" ,texlive-hyphen-russian)
+       ("texlive-hyphen-sanskrit" ,texlive-hyphen-sanskrit)
+       ("texlive-hyphen-serbian" ,texlive-hyphen-serbian)
+       ("texlive-hyphen-slovak" ,texlive-hyphen-slovak)
+       ("texlive-hyphen-slovenian" ,texlive-hyphen-slovenian)
+       ("texlive-hyphen-spanish" ,texlive-hyphen-spanish)
+       ("texlive-hyphen-swedish" ,texlive-hyphen-swedish)
+       ("texlive-hyphen-thai" ,texlive-hyphen-thai)
+       ("texlive-hyphen-turkish" ,texlive-hyphen-turkish)
+       ("texlive-hyphen-turkmen" ,texlive-hyphen-turkmen)
+       ("texlive-hyphen-ukrainian" ,texlive-hyphen-ukrainian)
+       ("texlive-hyphen-uppersorbian" ,texlive-hyphen-uppersorbian)
+       ("texlive-hyphen-welsh" ,texlive-hyphen-welsh)
+       ("texlive-unicode-data" ,texlive-unicode-data)
+       ("texlive-ukrhyph" ,texlive-ukrhyph)
+       ("texlive-ruhyphen" ,texlive-ruhyphen)
+       ("texlive-latexconfig" ,texlive-latexconfig)))
+    (home-page "https://www.ctan.org/pkg/latex-base")
+    (synopsis "Base sources of LaTeX")
+    (description
+     "This bundle comprises the source of LaTeX itself, together with several
 packages which are considered \"part of the kernel\".  This bundle, together
 with the required packages, constitutes what every LaTeX distribution should
 contain.")
-      (license license:lppl1.3c+))))
+    (license license:lppl1.3c+)))
 
 (define-public texlive-latex-filecontents
   (package
@@ -2400,32 +2870,15 @@ so that other code can determine that it is running under XeTeX.  The package
 requires the e-TeX extensions to the TeX primitive set.")
     (license license:lppl1.3c+)))
 
-(define-public texlive-generic-epsf
+(define-public texlive-epsf
   (package
-    (name "texlive-generic-epsf")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/generic/epsf"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "14w3j81ympyvg8hkk9i1xgr8a0gfnfsb2ki8qqsk5pa051za1xcy"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/generic/epfs")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-epsf"
+              (list "/doc/generic/epsf/"
+                    "/tex/generic/epsf/")
+              (base32
+               "03jcf0kqh47is965d2590miwj7d5kif3c4mgsnvkyl664jzjkh92")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/epsf")
     (synopsis "Simple macros for EPS inclusion")
     (description
@@ -2437,6 +2890,9 @@ bundle of packages.  (The latex-graphics bundle is also available to Plain TeX
 users, via its Plain TeX version.)")
     (license license:public-domain)))
 
+(define-public texlive-generic-epsf
+  (deprecated-package "texlive-generic-epsf" texlive-epsf))
+
 (define-public texlive-latex-fancyvrb
   (package
     (name "texlive-latex-fancyvrb")
@@ -2463,6 +2919,40 @@ verbatim mode; build \"example\" environments (showing both result and
 verbatim source).")
     (license license:lppl1.0+)))
 
+(define-public texlive-graphics-def
+  (package
+    (inherit (simple-texlive-package
+              "texlive-graphics-def"
+              (list "/doc/latex/graphics-def/README.md"
+                    "/tex/latex/graphics-def/")
+              (base32
+               "0zrbn9cwfnnrrl3b2zsd74ldksp9jwpvjh7z93ild1m75crpb39a")
+              #:trivial? #t))
+    (home-page "https://www.ctan.org/pkg/latex-graphics")
+    (synopsis "Color and graphics option files")
+    (description
+     "This bundle is a combined distribution consisting of @file{dvips.def},
+@file{pdftex.def}, @file{luatex.def}, @file{xetex.def}, @file{dvipdfmx.def},
+and @file{dvisvgm.def} driver option files for the LaTeX graphics and color
+packages.")
+    (license license:lppl1.3c+)))
+
+(define-public texlive-graphics-cfg
+  (package
+    (inherit (simple-texlive-package
+              "texlive-graphics-cfg"
+              (list "/doc/latex/graphics-cfg/README.md"
+                    "/tex/latex/graphics-cfg/")
+              (base32
+               "00n63adb2laf43lzix39xl68aq0k5k80mmrw602w99w5n7f96gsf")
+              #:trivial? #t))
+    (home-page "https://www.ctan.org/pkg/latex-graphics")
+    (synopsis "Sample configuration files for LaTeX color and graphics")
+    (description
+     "This bundle includes @file{color.cfg} and @file{graphics.cfg} files that
+set default \"driver\" options for the color and graphics packages.")
+    (license license:public-domain)))
+
 (define-public texlive-latex-graphics
   (package
     (name "texlive-latex-graphics")
@@ -2475,54 +2965,10 @@ verbatim source).")
                (base32
                 "0nlfhn55ax89rcvpkrl9570671b62kcr4c9l5ch3w5zw9vmi00dz"))))
     (build-system texlive-build-system)
-    (arguments
-     '(#:tex-directory "latex/graphics"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'install-config
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((cfg (assoc-ref inputs "graphics-cfg"))
-                   (target (string-append (assoc-ref outputs "out")
-                                          "/share/texmf-dist/tex/latex/graphics-cfg")))
-               (mkdir-p target)
-               (install-file (string-append cfg "/graphics.cfg") target)
-               (install-file (string-append cfg "/color.cfg")    target)
-               #t)))
-         (add-after 'install 'install-defs
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((def (assoc-ref inputs "graphics-def"))
-                   (target (string-append (assoc-ref outputs "out")
-                                          "/share/texmf-dist/tex/latex/graphics-def")))
-               (mkdir-p target)
-               (copy-recursively def target)
-               #t))))))
-    (native-inputs
-     `(("graphics-cfg"
-        ,(origin
-           (method git-fetch)
-           (uri (git-reference
-                 (url "https://github.com/latex3/graphics-cfg.git")
-                 (commit "19d1238af17df376cd46333b229579b0f7f3a41f")))
-           (file-name (string-append "graphics-cfg-"
-                                     (number->string %texlive-revision)
-                                     "-checkout"))
-           (sha256
-            (base32
-             "12kbgbm52gmmgn8zajb74s8n5rvnxcfdvs3iyj8vcw5vrsw5i6mh"))))
-       ("graphics-def"
-        ,(origin
-           (method svn-fetch)
-           (uri (svn-reference
-                 (url (string-append "svn://www.tug.org/texlive/tags/"
-                                     %texlive-tag "/Master/texmf-dist/"
-                                     "/tex/latex/graphics-def"))
-                 (revision %texlive-revision)))
-           (file-name (string-append "graphics-def-"
-                                     (number->string %texlive-revision)
-                                     "-checkout"))
-           (sha256
-            (base32
-             "17zpcgrfsr29g1dkz9np1qi63kjv7gb12rg979c6dai6qksbr3vq"))))))
+    (arguments '(#:tex-directory "latex/graphics"))
+    (propagated-inputs
+     `(("texlive-graphics-cfg" ,texlive-graphics-cfg)
+       ("texlive-graphics-def" ,texlive-graphics-def)))
     (home-page "https://www.ctan.org/pkg/latex-graphics")
     (synopsis "LaTeX standard graphics bundle")
     (description
@@ -2530,9 +2976,7 @@ verbatim source).")
 graphics (e.g. PostScript) files, and rotation and scaling of text in LaTeX
 documents.  It comprises the packages color, graphics, graphicx, trig, epsfig,
 keyval, and lscape.")
-    ;; The configuration files are released under CC0.
-    (license (list license:lppl1.3c+
-                   license:cc0))))
+    (license license:lppl1.3c+)))
 
 (define-public texlive-latex-xcolor
   (package
@@ -2650,32 +3094,15 @@ rawfonts, showkeys, somedefs, tabularx, theorem, trace, varioref, verbatim,
 xr, and xspace.")
     (license license:lppl1.3+)))
 
-(define-public texlive-latex-url
+(define-public texlive-url
   (package
-    (name "texlive-latex-url")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/latex/url"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "184s2543cwia5l7iibhlkl1ffbncfhjpv5p56zq0c15by5sghlac"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/latex/url")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-url"
+              (list "/doc/latex/url/"
+                    "/tex/latex/url/")
+              (base32
+               "184m40wgnx939ky2hbxnj0v9aak023ldrhgffp0lgyk9wdqpxlqg")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/url")
     (synopsis "Verbatim with URL-sensitive line breaks")
     (description "The command @code{\\url} is a form of verbatim command that
@@ -2690,6 +3117,9 @@ of file names.")
     ;; the latest version is 1.3c.
     (license license:lppl1.3c+)))
 
+(define-public texlive-latex-url
+  (deprecated-package "texlive-latex-url" texlive-url))
+
 (define-public texlive-latex-l3kernel
   (package
     (name "texlive-latex-l3kernel")
@@ -3514,32 +3944,16 @@ without affecting the structure of the list (this works for @code{itemize} and
 @code{enumerate} lists, and numbered lists remain in sequence).")
     (license license:lppl)))
 
-(define-public texlive-latex-filemod
+(define-public texlive-filemod
   (package
-    (name "texlive-latex-filemod")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/latex/filemod"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "0vpxilfw69xv78f03g0j0zw0bw4qcn36whqp8phcq48qk1ax2kr2"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/latex/filemod")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-filemod"
+              (list "/doc/latex/filemod/"
+                    "/tex/latex/filemod/"
+                    "/tex/generic/filemod/")
+              (base32
+               "1snsj7kblkj1ig3x3845lsypz7ab04lf0dcpdh946xakgjnz4fb5")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/filemod")
     (synopsis "Provide file modification times, and compare them")
     (description
@@ -3553,6 +3967,9 @@ mode.  The functionality is provided by purely expandable macros or by faster
 but non-expandable ones.")
     (license license:lppl1.3+)))
 
+(define-public texlive-latex-filemod
+  (deprecated-package "texlive-latex-filemod" texlive-filemod))
+
 (define-public texlive-latex-ifplatform
   (package
     (name "texlive-latex-ifplatform")
@@ -3652,32 +4069,15 @@ package options.  A specialized system for setting @code{PSTricks} keys is
 provided by the @code{pst-xkey} package.")
     (license license:lppl1.3+)))
 
-(define-public texlive-latex-pstool
+(define-public texlive-pstool
   (package
-    (name "texlive-latex-pstool")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/latex/pstool"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "1h816jain8c9nky75kk8pmmwj5b4yf9dpqvdvi2l6jhfj5iqkzr8"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/latex/pstool")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-pstool"
+              (list "/doc/latex/pstool/"
+                    "/tex/latex/pstool/")
+              (base32
+               "12clzcw2cl7g2chr2phgmmiwxw4859cln1gbx1wgp8bl9iw590nc")
+              #:trivial? #t))
     (propagated-inputs
      `(("texlive-latex-bigfoot" ,texlive-latex-bigfoot) ; for suffix
        ("texlive-latex-filemod" ,texlive-latex-filemod)
@@ -3698,32 +4098,18 @@ drastically speeding up compilation time when only a single figure needs
 re-processing.")
     (license license:lppl)))
 
-(define-public texlive-latex-seminar
+(define-public texlive-latex-pstool
+  (deprecated-package "texlive-latex-pstool" texlive-pstool))
+
+(define-public texlive-seminar
   (package
-    (name "texlive-latex-seminar")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/latex/seminar"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "0y4i651b75y6006n03x8n86bsqvjsailvvz9bhzy51dzsznqidq0"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/latex/seminar")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-seminar"
+              (list "/doc/latex/seminar/"
+                    "/tex/latex/seminar/")
+              (base32
+               "1clgw5xy867khzfn8d210rc5hsw5s7r0pznhk84niybvw4zc7r3f")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/seminar")
     (synopsis "Make overhead slides")
     ;; TODO: This package may need fancybox and xcomment at runtime.
@@ -3735,6 +4121,9 @@ recent classes such as powerdot or beamer, both of which are tuned to
 21st-century presentation styles.")
     (license license:lppl1.2+)))
 
+(define-public texlive-latex-seminar
+  (deprecated-package "texlive-latex-seminar" texlive-seminar))
+
 (define-public texlive-latex-trimspaces
   (package
     (name "texlive-latex-trimspaces")
@@ -3802,32 +4191,15 @@ space-stripped macros.")
 to something that's not a float.")
     (license license:lppl)))
 
-(define-public texlive-latex-doi
+(define-public texlive-doi
   (package
-    (name "texlive-latex-doi")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/latex/doi"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "0378rdmrgr2lzbfi4qqy4dfpj5im20diyd8z8b9m4mlg05r7wgnb"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/latex/doi")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-doi"
+              (list "/doc/latex/doi/README"
+                    "/tex/latex/doi/")
+              (base32
+               "17lnnhfmb8g4nh4fnyc9616h8xg3vjrzmlvfmlfqwwlfpma9xnnw")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/doi")
     (synopsis "Create correct hyperlinks for DOI numbers")
     (description
@@ -3840,32 +4212,18 @@ hyperlink to the target of the DOI.")
     ;; Any version of the LPPL.
     (license license:lppl1.3+)))
 
-(define-public texlive-latex-etoolbox
+(define-public texlive-latex-doi
+  (deprecated-package "texlive-latex-doi" texlive-doi))
+
+(define-public texlive-etoolbox
   (package
-    (name "texlive-latex-etoolbox")
-    (version (number->string %texlive-revision))
-    (source (origin
-              (method svn-fetch)
-              (uri (svn-reference
-                    (url (string-append "svn://www.tug.org/texlive/tags/"
-                                        %texlive-tag "/Master/texmf-dist/"
-                                        "/tex/latex/etoolbox"))
-                    (revision %texlive-revision)))
-              (file-name (string-append name "-" version "-checkout"))
-              (sha256
-               (base32
-                "1agmq6bf8wzcd77n20ng8bl4kh69cg5f6sjniii7bcw4llhd3nc8"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((target (string-append (assoc-ref %outputs "out")
-                                      "/share/texmf-dist/tex/latex/etoolbox")))
-           (mkdir-p target)
-           (copy-recursively (assoc-ref %build-inputs "source") target)
-           #t))))
+    (inherit (simple-texlive-package
+              "texlive-etoolbox"
+              (list "/doc/latex/etoolbox/"
+                    "/tex/latex/etoolbox/")
+              (base32
+               "1qg4x5r4ibinl6zy5lq70lv4zcrjsn54n6hwv31k5kl7mwv0mvr3")
+              #:trivial? #t))
     (home-page "https://www.ctan.org/pkg/etoolbox")
     (synopsis "e-TeX tools for LaTeX")
     (description
@@ -3878,6 +4236,9 @@ some LaTeX kernel commands; nevertheless, the package will not modify any part
 of the LaTeX kernel.")
     (license license:lppl1.3+)))
 
+(define-public texlive-latex-etoolbox
+  (deprecated-package "texlive-latex-etoolbox" texlive-etoolbox))
+
 (define-public texlive-latex-fncychap
   (package
     (name "texlive-latex-fncychap")