gnu: texlive-bin: Unpack the texlive-scripts and texlive-extra inputs early.
This allows the sources to processed normally by the other phases such as patch-source-shebangs. * gnu/packages/tex.scm (texlive-bin)[arguments]: Specify #:modules. [phases]{unpack-texlive-extra, unpack-texlive-scripts}: New phases. {postint}: Move the unpacking of the texlive-extra and texlive-scripts inputs to the above newly added phases. The installation of these extra directories now simply uses copy-recursively.master
parent
ed4b0f78b2
commit
ec14d5f729
|
@ -321,7 +321,12 @@ files from LOCATIONS with expected checksum HASH. CODE is not currently in use.
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("pkg-config" ,pkg-config)))
|
`(("pkg-config" ,pkg-config)))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:out-of-source? #t
|
`(#:modules ((guix build gnu-build-system)
|
||||||
|
(guix build utils)
|
||||||
|
(ice-9 ftw)
|
||||||
|
(srfi srfi-1)
|
||||||
|
(srfi srfi-26))
|
||||||
|
#:out-of-source? #t
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
'("--disable-static"
|
'("--disable-static"
|
||||||
"--disable-native-texlive-build"
|
"--disable-native-texlive-build"
|
||||||
|
@ -388,14 +393,38 @@ files from LOCATIONS with expected checksum HASH. CODE is not currently in use.
|
||||||
(("^\\./omfonts -ofm2opl \\$srcdir/tests/check tests/xcheck \\|\\| exit 1")
|
(("^\\./omfonts -ofm2opl \\$srcdir/tests/check tests/xcheck \\|\\| exit 1")
|
||||||
"./omfonts -ofm2opl $srcdir/tests/check tests/xcheck || exit 77"))
|
"./omfonts -ofm2opl $srcdir/tests/check tests/xcheck || exit 77"))
|
||||||
#t))
|
#t))
|
||||||
|
(add-after 'unpack 'unpack-texlive-extra
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
(mkdir "texlive-extra")
|
||||||
|
(with-directory-excursion "texlive-extra"
|
||||||
|
(apply (assoc-ref %standard-phases 'unpack)
|
||||||
|
(list #:source (assoc-ref inputs "texlive-extra-src"))))))
|
||||||
|
(add-after 'unpack-texlive-extra 'unpack-texlive-scripts
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
(mkdir "texlive-scripts")
|
||||||
|
(with-directory-excursion "texlive-scripts"
|
||||||
|
(apply (assoc-ref %standard-phases 'unpack)
|
||||||
|
(list #:source (assoc-ref inputs "texlive-scripts"))))))
|
||||||
(add-after 'install 'postint
|
(add-after 'install 'postint
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
|
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
|
(patch-source-shebangs (assoc-ref %standard-phases
|
||||||
|
'patch-source-shebangs))
|
||||||
(share (string-append out "/share"))
|
(share (string-append out "/share"))
|
||||||
(texlive-extra (assoc-ref inputs "texlive-extra-src"))
|
(scripts (string-append share
|
||||||
(unpack (assoc-ref %standard-phases 'unpack))
|
"/texmf-dist/scripts/texlive"))
|
||||||
(patch-source-shebangs
|
(source (string-append
|
||||||
(assoc-ref %standard-phases 'patch-source-shebangs)))
|
"../" (first (scandir ".." (cut string-suffix?
|
||||||
|
"source" <>)))))
|
||||||
|
(tl-extra-root (string-append source "/texlive-extra"))
|
||||||
|
(tl-extra-dir (first
|
||||||
|
(scandir tl-extra-root
|
||||||
|
(negate
|
||||||
|
(cut member <> '("." ".."))))))
|
||||||
|
(tlpkg-src (string-append tl-extra-root "/" tl-extra-dir
|
||||||
|
"/tlpkg"))
|
||||||
|
(config.guess (string-append (assoc-ref inputs "config")
|
||||||
|
"/bin/config.guess")))
|
||||||
(substitute* (string-append share "/texmf-dist/web2c/texmf.cnf")
|
(substitute* (string-append share "/texmf-dist/web2c/texmf.cnf")
|
||||||
;; Don't truncate lines.
|
;; Don't truncate lines.
|
||||||
(("^error_line = .*$") "error_line = 254\n")
|
(("^error_line = .*$") "error_line = 254\n")
|
||||||
|
@ -409,18 +438,19 @@ files from LOCATIONS with expected checksum HASH. CODE is not currently in use.
|
||||||
'("latex" "pdflatex" "xelatex" "lualatex")))
|
'("latex" "pdflatex" "xelatex" "lualatex")))
|
||||||
(with-directory-excursion (string-append share "/man/man1/")
|
(with-directory-excursion (string-append share "/man/man1/")
|
||||||
(symlink "luatex.1" "lualatex.1"))
|
(symlink "luatex.1" "lualatex.1"))
|
||||||
;; Unpack texlive-extra and install tlpkg.
|
|
||||||
(mkdir "texlive-extra")
|
;; Install tlpkg.
|
||||||
(with-directory-excursion "texlive-extra"
|
(copy-recursively tlpkg-src (string-append share "/tlpkg"))
|
||||||
(apply unpack (list #:source texlive-extra))
|
|
||||||
(apply patch-source-shebangs (list #:source texlive-extra))
|
;; Install texlive-scripts.
|
||||||
(invoke "mv" "tlpkg" share))
|
(copy-recursively (string-append
|
||||||
(let ((scripts (string-append share "/texmf-dist/scripts/texlive/")))
|
source "/texlive-scripts/source/")
|
||||||
(mkdir-p scripts)
|
scripts)
|
||||||
(copy-recursively (assoc-ref inputs "texlive-scripts") scripts)
|
|
||||||
;; Make sure that fmtutil can find its Perl modules.
|
;; Make sure that fmtutil can find its Perl modules.
|
||||||
(substitute* (string-append scripts "fmtutil.pl")
|
(substitute* (string-append scripts "/fmtutil.pl")
|
||||||
(("\\$TEXMFROOT/") (string-append share "/"))))
|
(("\\$TEXMFROOT/")
|
||||||
|
(string-append share "/")))
|
||||||
|
|
||||||
;; texlua shebangs are not patched by the patch-source-shebangs
|
;; texlua shebangs are not patched by the patch-source-shebangs
|
||||||
;; phase because the texlua executable does not exist at that
|
;; phase because the texlua executable does not exist at that
|
||||||
|
|
Reference in New Issue