From 47913ab45276ff45ab47687e1b67b5bc103089df Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 4 Jun 2023 13:15:27 +0200 Subject: guix: Let texlive importer suggest format creation. * guix/import/texlive.scm (tlpdb): Store "execute" entries. (tlpdb->package): Add #:CREATE-FORMATS argument when there is an AddFormat execute action. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, with TeX format"): ("texlive->guix-package, execute but no TeX format"): New tests. --- guix/import/texlive.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm index da58c8d13f..36c6f3efb1 100644 --- a/guix/import/texlive.scm +++ b/guix/import/texlive.scm @@ -156,7 +156,8 @@ (srcfiles . list) (runfiles . list) (docfiles . list) - (depend . simple-list))) + (depend . simple-list) + (execute . simple-list))) (record (lambda* (key value alist #:optional (type 'string)) (let ((new @@ -319,6 +320,23 @@ of those files are returned that are unexpectedly installed." '((outputs '("out" "doc"))) '()) (build-system texlive-build-system) + ;; Translate AddFormat execute actions into a `#:create-formats' + ;; argument. + ,@(or (and-let* + ((actions (assoc-ref data 'execute)) + (formats + (delete-duplicates + (filter-map (lambda (action) + (match (string-split action #\space) + (("AddFormat" name . _) + (string-drop name + (string-length "name="))) + (  #f))) + actions))) + ((not (null? formats)))) + `((arguments + (list #:create-formats #~(list ,@(reverse formats)))))) + '()) ;; Texlive build system generates font metrics whenever a font ;; metrics file has the same base name as a Metafont file. ,@(or (and-let* ((runfiles (assoc-ref data 'runfiles)) -- cgit 1.4.1