gnu: texlive-latex-base: Simplify.

* gnu/packages/tex.scm (texlive-latex-base)[source]: Use TEXLIVE-ORIGIN.
[arguments]: Simplify build phase by running fmtutil-sys; adjust install
phase.
[native-inputs]: Remove texlive-generic-unicode-data,
texlive-generic-dehyph-exptl, texlive-generic-tex-ini-files,
texlive-latex-latexconfig, texlive-generic-hyphen, texlive-generic-ruhyphen,
texlive-generic-ukrhyph, texlive-generic-config, and
texlive-latex-base-support-files; add texlive-tex-ini-files, texlive-kpathsea,
and texlive-luatexconfig.
[propagated-inputs]: Add texlive-etex, texlive-hyph-utf8, texlive-hyphen-base,
texlive-hyphen-afrikaans, texlive-hyphen-ancientgreek,
texlive-hyphen-armenian, texlive-hyphen-basque, texlive-hyphen-belarusian,
texlive-hyphen-bulgarian, texlive-hyphen-catalan, texlive-hyphen-chinese,
texlive-hyphen-churchslavonic, texlive-hyphen-coptic, texlive-hyphen-croatian,
texlive-hyphen-czech, texlive-hyphen-danish, texlive-hyphen-dutch,
texlive-hyphen-english, texlive-hyphen-esperanto, texlive-hyphen-estonian,
texlive-hyphen-ethiopic, texlive-hyphen-finnish, texlive-hyphen-french,
texlive-hyphen-friulan, texlive-hyphen-galician, texlive-hyphen-georgian,
texlive-hyphen-german, texlive-hyphen-greek, texlive-hyphen-hungarian,
texlive-hyphen-icelandic, texlive-hyphen-indic, texlive-hyphen-indonesian,
texlive-hyphen-interlingua, texlive-hyphen-irish, texlive-hyphen-italian,
texlive-hyphen-kurmanji, texlive-hyphen-latin, texlive-hyphen-latvian,
texlive-hyphen-lithuanian, texlive-hyphen-mongolian, texlive-hyphen-norwegian,
texlive-hyphen-occitan, texlive-hyphen-piedmontese, texlive-hyphen-polish,
texlive-hyphen-portuguese, texlive-hyphen-romanian, texlive-hyphen-romansh,
texlive-hyphen-russian, texlive-hyphen-sanskrit, texlive-hyphen-serbian,
texlive-hyphen-slovak, texlive-hyphen-slovenian, texlive-hyphen-spanish,
texlive-hyphen-swedish, texlive-hyphen-thai, texlive-hyphen-turkish,
texlive-hyphen-turkmen, texlive-hyphen-ukrainian, texlive-hyphen-uppersorbian,
texlive-hyphen-welsh, texlive-unicode-data, texlive-ukrhyph, texlive-ruhyphen,
and texlive-latexconfig.
This commit is contained in:
Ricardo Wurmus 2019-07-15 19:09:55 +02:00
parent b93d9dac24
commit e976d3618d
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -2611,186 +2611,214 @@ (define-public texlive-latexconfig
(license license:lppl))) (license license:lppl)))
(define-public texlive-latex-base (define-public texlive-latex-base
(let ((texlive-dir (package
(lambda (dir hash) (name "texlive-latex-base")
(origin (version (number->string %texlive-revision))
(method svn-fetch) (source (texlive-origin
(uri (svn-reference name version
(url (string-append "svn://www.tug.org/texlive/tags/" (list "/doc/latex/base/"
%texlive-tag "/Master/texmf-dist/" "/source/latex/base/"
dir)) ;; Almost all files in /tex/latex/base are generated, but
(revision %texlive-revision))) ;; these are not:
(file-name (string-append "texlive-generic-" "/tex/latex/base/idx.tex"
(last (string-split "/tex/latex/base/lablst.tex"
(string-drop-right dir 1) #\/)) "/tex/latex/base/lppl.tex"
"-" (number->string %texlive-revision) "/tex/latex/base/ltnews.cls"
"-checkout")) "/tex/latex/base/ltxcheck.tex"
(sha256 (base32 hash)))))) "/tex/latex/base/ltxguide.cls"
(package "/tex/latex/base/minimal.cls"
(name "texlive-latex-base") "/tex/latex/base/sample2e.tex"
(version (number->string %texlive-revision)) "/tex/latex/base/small2e.tex"
(source (origin "/tex/latex/base/source2e.tex"
(method svn-fetch) "/tex/latex/base/testpage.tex"
(uri (texlive-ref "latex" "base")) "/tex/latex/base/texsys.cfg")
(file-name (string-append name "-" version "-checkout")) (base32
(sha256 "0f8d41wk1gb7i6xq1a10drwhhayc50pg9nwzjkrqnxrv0pcc08w5")))
(base32 (build-system gnu-build-system)
"17bqrzzjz16k52sc7ydl4vw7ddy2z3g0p1xsk2c35h1ynq9h3wwm")))) (arguments
(build-system gnu-build-system) `(#:modules ((guix build gnu-build-system)
(arguments (guix build utils)
`(#:modules ((guix build gnu-build-system) (ice-9 match)
(guix build utils) (srfi srfi-26))
(ice-9 match) #:tests? #f ; no tests
(srfi srfi-1) #:phases
(srfi srfi-26)) (modify-phases %standard-phases
#:tests? #f ; no tests (delete 'configure)
#:phases (replace 'build
(modify-phases %standard-phases (lambda* (#:key inputs #:allow-other-keys)
(delete 'configure) ;; Find required fonts
(replace 'build (setenv "TFMFONTS"
(lambda* (#:key inputs #:allow-other-keys) (string-join
;; Find required fonts (map (match-lambda
(setenv "TFMFONTS" ((pkg-name . dir)
(string-append (assoc-ref inputs "texlive-fonts-cm") (string-append
"/share/texmf-dist/fonts/tfm/public/cm:" (assoc-ref inputs pkg-name)
(assoc-ref inputs "texlive-fonts-latex") "/share/texmf-dist/fonts/tfm/public"
"/share/texmf-dist/fonts/tfm/public/latex-fonts:" dir)))
(assoc-ref inputs "texlive-fonts-knuth-lib") '(("texlive-etex" . "/etex")
"/share/texmf-dist/fonts/tfm/public/knuth-lib")) ("texlive-fonts-cm" . "/cm")
("texlive-fonts-latex" . "/latex-fonts")
("texlive-fonts-knuth-lib" . "/knuth-lib")))
":"))
(let ((cwd (getcwd)))
(setenv "TEXINPUTS" (setenv "TEXINPUTS"
(string-append (string-append
(getcwd) ":" cwd "//:"
(getcwd) "/build:" cwd "/source/latex/base//:"
cwd "/build:"
(string-join (string-join
(map (match-lambda ((_ . dir) dir)) inputs) (map (match-lambda ((_ . dir) dir)) inputs)
"//:"))) "//:"))))
;; Create an empty texsys.cfg, because latex.ltx wants to include ;; This is the actual build step.
;; it. This file must exist and it's fine if it's empty. (mkdir "build")
(with-output-to-file "texsys.cfg" (invoke "tex" "-ini" "-interaction=scrollmode"
(lambda _ (format #t "%"))) "-output-directory=build" "unpack.ins")
(mkdir "build") ;; 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") (mkdir "web2c")
(invoke "luatex" "-ini" "-interaction=batchmode" (install-file (string-append
"-output-directory=build" "unpack.ins") (assoc-ref inputs "texlive-kpathsea")
(invoke "tex" "-ini" "-interaction=batchmode" "/share/texmf-dist/web2c/fmtutil.cnf")
"-output-directory=web2c" "tex.ini") "web2c")
;; LaTeX, pdfetex/pdftex, and XeTeX require e-TeX, which (make-file-writable "web2c/fmtutil.cnf")
;; is enabled only in extended mode (activated with a (substitute* "web2c/fmtutil.cnf"
;; leading asterisk). We should not use luatex here, (((string-append "^(" (string-join disabled-formats "|") ")") m)
;; because that would make the generated format files (string-append "#! " m))))
;; incompatible with any other TeX engine. (invoke "fmtutil-sys" "--all"
(for-each (lambda (format) "--fmtdir=web2c"
(invoke "latex" "-ini" "-interaction=batchmode" (string-append "--cnffile=web2c/fmtutil.cnf"))
"-output-directory=web2c" ;; We don't actually want to install it.
"-translate-file=cp227.tcx" (delete-file "web2c/fmtutil.cnf")
(string-append "*" format ".ini"))) #t))
'("latex" (replace 'install
"pdflatex" (lambda* (#:key inputs outputs #:allow-other-keys)
"pdfetex")) (let* ((out (assoc-ref outputs "out"))
(for-each (lambda (format) (root (string-append out "/share/texmf-dist"))
(invoke format "-ini" "-interaction=batchmode" (target (string-append root "/tex/latex/base"))
"-output-directory=web2c" (web2c (string-append root "/web2c"))
(string-append "*" format ".ini"))) (makeindex (string-append root "/makeindex/latex")))
'("xetex" (for-each delete-file (find-files "." "\\.(log|aux)$"))
"xelatex"))
(for-each (lambda (format) ;; The usedir directive in docstrip.ins is ignored, so these
(invoke "luatex" "-ini" "-interaction=batchmode" ;; two files end up in the wrong place. Move them.
"-output-directory=web2c" (mkdir-p makeindex)
(string-append format ".ini"))) (for-each (lambda (file)
'("dviluatex" "dvilualatex" "luatex" "lualatex")) (install-file file makeindex)
#t)) (delete-file file))
(replace 'install '("build/gglo.ist"
(lambda* (#:key inputs outputs #:allow-other-keys) "build/gind.ist"))
(let* ((out (assoc-ref outputs "out")) (for-each (cut install-file <> target)
(target (string-append (find-files "build" ".*"))
out "/share/texmf-dist/tex/latex/base")) (for-each (cut install-file <> web2c)
(web2c (string-append (find-files "web2c" ".*"))
out "/share/texmf-dist/web2c")) #t))))))
(support-files (assoc-ref inputs "texlive-latex-base-support-files"))) (native-inputs
(mkdir-p target) `(("texlive-bin" ,texlive-bin)
(mkdir-p web2c) ("texlive-tex-ini-files" ,texlive-tex-ini-files)
(for-each delete-file (find-files "." "\\.(log|aux)$")) ("texlive-tex-plain" ,texlive-tex-plain)
(for-each (cut install-file <> target) ("texlive-kpathsea" ,texlive-kpathsea)
(find-files "build" ".*")) ("texlive-fonts-cm" ,texlive-fonts-cm)
(for-each (cut install-file <> web2c) ("texlive-fonts-latex" ,texlive-fonts-latex)
(find-files "web2c" ".*")) ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)
;; pdftex is really just the same as pdfetex, but since it ("texlive-luatexconfig"
;; doesn't have its own format file, we need to copy it. ,(texlive-origin
(copy-file "web2c/pdfetex.fmt" "texlive-luatexconfig" (number->string %texlive-revision)
(string-append web2c "/pdftex.fmt")) (list "/tex/generic/config/luatex-unicode-letters.tex"
;; "source" is missing the support files as per doc/latex/base/manifest.txt. "/tex/generic/config/luatexiniconfig.tex"
;; FIXME: We are probably not packaging this right. "/web2c/texmfcnf.lua")
(for-each (lambda (file) (base32
(install-file "0cs67a8wwh4s5p5gn8l49jyccgy7glw8mfq5klgn3dfsl2fdlhk7")))))
(string-append support-files "/" file) (propagated-inputs
target)) `(("texlive-dehyph-exptl" ,texlive-dehyph-exptl)
'("ltxguide.cls" "ltnews.cls" "minimal.cls" "idx.tex" ("texlive-etex" ,texlive-etex)
"lablst.tex" "testpage.tex" "ltxcheck.tex")) ("texlive-hyph-utf8" ,texlive-hyph-utf8)
;; Install configurations ("texlive-hyphen-base" ,texlive-hyphen-base)
(copy-recursively ("texlive-hyphen-afrikaans" ,texlive-hyphen-afrikaans)
(assoc-ref inputs "texlive-latex-latexconfig") ("texlive-hyphen-ancientgreek" ,texlive-hyphen-ancientgreek)
(string-append out "/share/texmf-dist/tex/latex/latexconfig")) ("texlive-hyphen-armenian" ,texlive-hyphen-armenian)
(copy-recursively ("texlive-hyphen-basque" ,texlive-hyphen-basque)
(assoc-ref inputs "texlive-generic-config") ("texlive-hyphen-belarusian" ,texlive-hyphen-belarusian)
(string-append out "/share/texmf-dist/tex/generic/config")) ("texlive-hyphen-bulgarian" ,texlive-hyphen-bulgarian)
(copy-recursively ("texlive-hyphen-catalan" ,texlive-hyphen-catalan)
(assoc-ref inputs "texlive-generic-hyphen") ("texlive-hyphen-chinese" ,texlive-hyphen-chinese)
(string-append out "/share/texmf-dist/tex/generic/hyphen")) ("texlive-hyphen-churchslavonic" ,texlive-hyphen-churchslavonic)
(copy-recursively ("texlive-hyphen-coptic" ,texlive-hyphen-coptic)
(assoc-ref inputs "texlive-generic-ruhyphen") ("texlive-hyphen-croatian" ,texlive-hyphen-croatian)
(string-append out "/share/texmf-dist/tex/generic/ruhyphen")) ("texlive-hyphen-czech" ,texlive-hyphen-czech)
(copy-recursively ("texlive-hyphen-danish" ,texlive-hyphen-danish)
(assoc-ref inputs "texlive-generic-ukrhyph") ("texlive-hyphen-dutch" ,texlive-hyphen-dutch)
(string-append out "/share/texmf-dist/tex/generic/ukrhyph")) ("texlive-hyphen-english" ,texlive-hyphen-english)
#t)))))) ("texlive-hyphen-esperanto" ,texlive-hyphen-esperanto)
(native-inputs ("texlive-hyphen-estonian" ,texlive-hyphen-estonian)
`(("texlive-bin" ,texlive-bin) ("texlive-hyphen-ethiopic" ,texlive-hyphen-ethiopic)
("texlive-generic-unicode-data" ,texlive-generic-unicode-data) ("texlive-hyphen-finnish" ,texlive-hyphen-finnish)
("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl) ("texlive-hyphen-french" ,texlive-hyphen-french)
("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files) ("texlive-hyphen-friulan" ,texlive-hyphen-friulan)
("texlive-latex-latexconfig" ("texlive-hyphen-galician" ,texlive-hyphen-galician)
,(texlive-dir "tex/latex/latexconfig/" ("texlive-hyphen-georgian" ,texlive-hyphen-georgian)
"1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf")) ("texlive-hyphen-german" ,texlive-hyphen-german)
("texlive-generic-hyphen" ("texlive-hyphen-greek" ,texlive-hyphen-greek)
,(texlive-dir "tex/generic/hyphen/" ("texlive-hyphen-hungarian" ,texlive-hyphen-hungarian)
"0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd")) ("texlive-hyphen-icelandic" ,texlive-hyphen-icelandic)
("texlive-generic-ruhyphen" ("texlive-hyphen-indic" ,texlive-hyphen-indic)
,(texlive-dir "tex/generic/ruhyphen/" ("texlive-hyphen-indonesian" ,texlive-hyphen-indonesian)
"14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd")) ("texlive-hyphen-interlingua" ,texlive-hyphen-interlingua)
("texlive-generic-ukrhyph" ("texlive-hyphen-irish" ,texlive-hyphen-irish)
,(texlive-dir "tex/generic/ukrhyph/" ("texlive-hyphen-italian" ,texlive-hyphen-italian)
"1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv")) ("texlive-hyphen-kurmanji" ,texlive-hyphen-kurmanji)
("texlive-generic-config" ("texlive-hyphen-latin" ,texlive-hyphen-latin)
,(texlive-dir "tex/generic/config/" ("texlive-hyphen-latvian" ,texlive-hyphen-latvian)
"1v90iihy112q93zdpblpdk8zv8rf99fgslsg06s1sxm27zjm9nap")) ("texlive-hyphen-lithuanian" ,texlive-hyphen-lithuanian)
("texlive-latex-base-support-files" ("texlive-hyphen-mongolian" ,texlive-hyphen-mongolian)
,(origin ("texlive-hyphen-norwegian" ,texlive-hyphen-norwegian)
(method svn-fetch) ("texlive-hyphen-occitan" ,texlive-hyphen-occitan)
(uri (svn-reference ("texlive-hyphen-piedmontese" ,texlive-hyphen-piedmontese)
(url (string-append "svn://www.tug.org/texlive/tags/" ("texlive-hyphen-polish" ,texlive-hyphen-polish)
%texlive-tag "/Master/texmf-dist/" ("texlive-hyphen-portuguese" ,texlive-hyphen-portuguese)
"/tex/latex/base")) ("texlive-hyphen-romanian" ,texlive-hyphen-romanian)
(revision %texlive-revision))) ("texlive-hyphen-romansh" ,texlive-hyphen-romansh)
(file-name (string-append name "-" version "-checkout")) ("texlive-hyphen-russian" ,texlive-hyphen-russian)
(sha256 ("texlive-hyphen-sanskrit" ,texlive-hyphen-sanskrit)
(base32 ("texlive-hyphen-serbian" ,texlive-hyphen-serbian)
"18wy8dlcw8adl6jzqwbg54pdwlhs8hilnfvqbw6ikj6y3zhqkj7q")))) ("texlive-hyphen-slovak" ,texlive-hyphen-slovak)
("texlive-tex-plain" ,texlive-tex-plain) ("texlive-hyphen-slovenian" ,texlive-hyphen-slovenian)
("texlive-fonts-cm" ,texlive-fonts-cm) ("texlive-hyphen-spanish" ,texlive-hyphen-spanish)
("texlive-fonts-latex" ,texlive-fonts-latex) ("texlive-hyphen-swedish" ,texlive-hyphen-swedish)
("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib))) ("texlive-hyphen-thai" ,texlive-hyphen-thai)
(propagated-inputs ("texlive-hyphen-turkish" ,texlive-hyphen-turkish)
`(("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8))) ("texlive-hyphen-turkmen" ,texlive-hyphen-turkmen)
(home-page "https://www.ctan.org/pkg/latex-base") ("texlive-hyphen-ukrainian" ,texlive-hyphen-ukrainian)
(synopsis "Base sources of LaTeX") ("texlive-hyphen-uppersorbian" ,texlive-hyphen-uppersorbian)
(description ("texlive-hyphen-welsh" ,texlive-hyphen-welsh)
"This bundle comprises the source of LaTeX itself, together with several ("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 packages which are considered \"part of the kernel\". This bundle, together
with the required packages, constitutes what every LaTeX distribution should with the required packages, constitutes what every LaTeX distribution should
contain.") contain.")
(license license:lppl1.3c+)))) (license license:lppl1.3c+)))
(define-public texlive-latex-filecontents (define-public texlive-latex-filecontents
(package (package