summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <[email protected]>2024-05-28 21:19:59 +0200
committerLudovic Courtès <[email protected]>2024-08-31 10:45:20 +0200
commitdb0517f3232669381c595d7139695df842c081f0 (patch)
tree5b032d68da2efb18d7e922d43f28761dd3439058
parentb385b88638e411c69bf48057611dd82dc203aa64 (diff)
gnu: texlive-context: Fix "context" call.
* gnu/packages/tex.scm (texlive-context)[arguments]<#:phases>: Add a phase to locate "texmfcnf.lua" and another one to make "bin/context" effectively executable. Remove meaningless symlinks, too. Change-Id: Ie0df56da0b3a439cc53e4b15b0506907681ed13b
-rw-r--r--gnu/packages/tex.scm27
1 files changed, 20 insertions, 7 deletions
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index ae2aeb0c70..57e82ba23d 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -58768,17 +58768,30 @@ a counter to be reset when another is incremented) and
(build-system texlive-build-system)
(arguments
(list
- #:link-scripts #~(list "context.lua" "mtxrun.lua")
+ #:link-scripts #~(list "mtxrun.lua")
#:phases
#~(modify-phases %standard-phases
- (add-after 'link-scripts 'add-symlinks
+ (add-after 'unpack 'locate-texmfcnf.lua
+ ;; Out of the box, "mtxrun" first looks for "texmfcnf.lua" in
+ ;; "~/texmf", then in TEXMFCNF. The latter is set within
+ ;; TEXLIVE-LIBKPATHSEA; it cannot contain the configuration file
+ ;; provided by TEXLIVE-LUATEX. Point to the right file instead.
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((texmfcnf.lua
+ (search-input-file inputs
+ "share/texmf-dist/web2c/texmfcnf.lua")))
+ (substitute* (find-files "." "\\.lua$")
+ (("kpse\\.default_texmfcnf\\(\\)")
+ (format #f "\"~a\"" (dirname texmfcnf.lua)))))))
+ (add-after 'unpack 'create-context-wrapper
+ ;; Create a "context" script for convenience.
(lambda _
+ (mkdir-p (string-append #$output "/bin"))
(with-directory-excursion (string-append #$output "/bin")
- (symlink "../share/texmf-dist/scripts/context/lua/context.lua"
- "context.lua")
- (symlink "../share/texmf-dist/scripts/context/lua/mtxrun.lua"
- "mtxrun.lua")
- (symlink "mtxrun" "luametatex")))))))
+ (call-with-output-file "context"
+ (lambda (port)
+ (format port "#!/bin/sh~%mtxrun --script context \"$@\"")))
+ (chmod "context" #o755)))))))
(propagated-inputs
(list texlive-amsfonts
texlive-lm