@@ 84271,7 84271,21 @@ configuration of its own fixed names, using @file{.mld} files.")
(outputs '("out" "doc"))
(build-system texlive-build-system)
(arguments
- (list #:link-scripts #~(list "latexminted.py")))
+ (list
+ #:link-scripts #~(list "latexminted.py")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'link-scripts 'wrap-latexminted
+ ;; `latexminted' relies on SELFAUTOLOC to locate `kpsewhich', but
+ ;; this variable is bogus in Guix because binaries are scattered
+ ;; across multiple directories. This phase sets SELFAUTOLOC to
+ ;; the specific directory containing `kpsewhich'.
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; XXX: Use `wrap-program' rather than `wrap-script' because
+ ;; with the latter, ".whl" files are not properly recognized.
+ (wrap-program (search-input-file outputs "bin/latexminted")
+ `("SELFAUTOLOC" =
+ (,(dirname (search-input-file inputs "bin/kpsewhich"))))))))))
(inputs (list python))
(propagated-inputs
(list texlive-catchfile