Archived
1
0
Fork 0

gnu: texlive-texmf: Improve package style.

* gnu/packages/tex.scm (texlive-texmf)[version]: Inherit from TEXLIVE-BIN.
[source]: Use autonomous origin instead of relying on another layer.
[inputs]: Remove labels.  Sort alphabetically.
[arguments]: Use G-expressions.  Remove trailing #T from phases.
(texlive-texmf-src): Remove variable.
This commit is contained in:
Nicolas Goaziou 2023-05-28 16:48:30 +02:00
parent f4dadc5b49
commit dddb774ec4
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -194,13 +194,6 @@ use."
(sha256 (base32 (sha256 (base32
"171kg1n9zapw3d2g47d8l0cywa99bl9m54xkqvp9625ks22z78s6")))) "171kg1n9zapw3d2g47d8l0cywa99bl9m54xkqvp9625ks22z78s6"))))
(define texlive-texmf-src
(origin
(method url-fetch)
(uri "ftp://tug.org/historic/systems/texlive/2021/texlive-20210325-texmf.tar.xz")
(sha256 (base32
"070gczcm1h9rx29w2f02xd3nhd84c4k28nfmm8qgp69yq8vd84pz"))))
(define-public texlive-bin (define-public texlive-bin
(package (package
(name "texlive-bin") (name "texlive-bin")
@ -8658,18 +8651,26 @@ documents as well as DVI output.")
(define texlive-texmf (define texlive-texmf
(package (package
(name "texlive-texmf") (name "texlive-texmf")
(version "20210325") (version (package-version texlive-bin))
(source texlive-texmf-src) (source (origin
(method url-fetch)
(uri (string-append "ftp://tug.org/historic/systems/texlive/"
(string-take version 4)
"/texlive-" version "-texmf.tar.xz"))
(sha256
(base32
"070gczcm1h9rx29w2f02xd3nhd84c4k28nfmm8qgp69yq8vd84pz"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(inputs (inputs
`(("texlive-bin" ,texlive-bin) (list lua
("lua" ,lua) perl
("perl" ,perl) python
("python" ,python) ruby
("ruby" ,ruby) tcsh
("tcsh" ,tcsh))) texlive-bin))
(arguments (arguments
`(#:modules ((guix build gnu-build-system) (list
#:modules '((guix build gnu-build-system)
(guix build utils) (guix build utils)
(srfi srfi-26)) (srfi srfi-26))
@ -8678,30 +8679,28 @@ documents as well as DVI output.")
#:substitutable? #f #:substitutable? #f
#:phases #:phases
(modify-phases (map (cut assq <> %standard-phases) #~(modify-phases (map (cut assq <> %standard-phases)
'(set-paths unpack patch-source-shebangs)) '(set-paths unpack patch-source-shebangs))
(add-after 'unpack 'unset-environment-variables (add-after 'unpack 'unset-environment-variables
(lambda _ (lambda _
(unsetenv "TEXMF") (unsetenv "TEXMF")
(unsetenv "TEXMFCNF") (unsetenv "TEXMFCNF")))
#t))
(add-after 'patch-source-shebangs 'install (add-after 'patch-source-shebangs 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((share (string-append (assoc-ref outputs "out") "/share"))) (let ((share (string-append #$output "/share")))
(mkdir-p share) (mkdir-p share)
(invoke "mv" "texmf-dist" share)))) (invoke "mv" "texmf-dist" share))))
(add-after 'install 'texmf-config (add-after 'install 'texmf-config
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (let* ((share (string-append #$output "/share"))
(share (string-append out "/share"))
(texmfroot (string-append share "/texmf-dist/web2c")) (texmfroot (string-append share "/texmf-dist/web2c"))
(texmfcnf (string-append texmfroot "/texmf.cnf")) (texmfcnf (string-append texmfroot "/texmf.cnf"))
(fmtutilcnf (string-append texmfroot "/fmtutil.cnf")) (fmtutilcnf (string-append texmfroot "/fmtutil.cnf"))
(texlive-bin (assoc-ref inputs "texlive-bin")) (texlive-bin #$(this-package-input "texlive-bin"))
(texbin (string-append texlive-bin "/bin")) (texbin (string-append texlive-bin "/bin"))
(tlpkg (string-append texlive-bin "/share/tlpkg"))) (tlpkg (string-append texlive-bin "/share/tlpkg")))
;; LuaJIT is not ported to powerpc64* yet. ;; LuaJIT is not ported to powerpc64* yet.
(if ,(target-ppc64le?) (if #$(target-ppc64le?)
(substitute* fmtutilcnf (substitute* fmtutilcnf
(("^(luajittex|luajithbtex|mfluajit)" m) (("^(luajittex|luajithbtex|mfluajit)" m)
(string-append "#! " m)))) (string-append "#! " m))))
@ -8714,7 +8713,7 @@ documents as well as DVI output.")
(("!!\\$TEXMFLOCAL") "$TEXMFLOCAL")) (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
;; Register paths in texmfcnf.lua, needed for context. ;; Register paths in texmfcnf.lua, needed for context.
(substitute* (string-append texmfroot "/texmfcnf.lua") (substitute* (string-append texmfroot "/texmfcnf.lua")
(("selfautodir:") out) (("selfautodir:") #$output)
(("selfautoparent:") (string-append share "/"))) (("selfautoparent:") (string-append share "/")))
;; Set path to TeXLive Perl modules ;; Set path to TeXLive Perl modules
(setenv "PERL5LIB" (setenv "PERL5LIB"