guix: texlive importer: Fix build system and arguments for meta-packages.

* guix/import/texlive.scm (tlpdb->package): Meta packages should use trivial
build system and an appropriate builder.
* tests/texlive.scm ("texlive->guix-package, meta-package"):
("texlive->guix-package, translate dependencies"): Update tests.
This commit is contained in:
Nicolas Goaziou 2023-06-09 10:09:21 +02:00
parent 5f51601bd9
commit 0224a8f400
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D
2 changed files with 30 additions and 23 deletions

View file

@ -342,24 +342,30 @@ (define (tlpdb->package name version package-database)
,@(if (assoc-ref data 'docfiles)
'((outputs '("out" "doc")))
'())
(build-system texlive-build-system)
(build-system ,(if meta-package?
'trivial-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))))))
'())
,@(cond
(meta-package? '((arguments (list #:builder #~(mkdir #$output)))))
((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))))
formats)
=>
(lambda (formats)
`((arguments
(list #:create-formats #~(list ,@(reverse formats)))))))
(else '()))
;; 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))

View file

@ -157,11 +157,7 @@ (define %fake-tlpdb
(shortdesc . "A sophisticated typesetting engine")
(longdesc . "TeX is a typesetting system that incorporates...")
(depend "cm" "hyphen-base" "tex.ARCH")
(docfiles
"texmf-dist/doc/man/man1/initex.1"
"texmf-dist/doc/man/man1/initex.man1.pdf"
"texmf-dist/doc/man/man1/tex.1"
"texmf-dist/doc/man/man1/tex.man1.pdf")
(docfiles "texmf-dist/doc/man/man1/tex.1")
(catalogue-license . "knuth"))
("texsis"
. ((name
@ -495,7 +491,9 @@ (define %fake-tlpdb
('name "texlive-collection-texworks")
('version _)
('source #f)
('build-system 'texlive-build-system)
('build-system 'trivial-build-system)
('arguments
('list '#:builder ('gexp ('mkdir ('ungexp 'output)))))
('propagated-inputs
('list 'texlive-collection-basic 'texlive-texworks))
('home-page "https://www.tug.org/texlive/")
@ -598,7 +596,9 @@ (define %fake-tlpdb
('name "texlive-collection-basic")
('version _)
('source _)
('build-system 'texlive-build-system)
('build-system 'trivial-build-system)
('arguments
('list '#:builder ('gexp ('mkdir ('ungexp 'output)))))
('propagated-inputs
('list 'texlive-amsfonts 'texlive-hyphen-complete))
('home-page (? string?))
@ -631,6 +631,7 @@ (define %fake-tlpdb
('name "texlive-tex")
('version _)
('source _)
('outputs _)
('build-system 'texlive-build-system)
('propagated-inputs
('list 'texlive-cm 'texlive-hyphen-base))