1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

guix: import: Improve importing texlive meta packages.

* guix/import/texlive.scm (tlpdb->package): Generate more appropriate source,
home page and license fields when importing meta packages, i.e., TeX Live
collections and schemes.
* tests/texlive.scm (%fake-tlpdb): Add test data.
("texlive->guix-package, meta-package"): New test.
This commit is contained in:
Nicolas Goaziou
2023-05-27 21:39:26 +02:00
parent 293abb4c4e
commit d62b35bbe9
2 changed files with 98 additions and 53 deletions

View File

@@ -62,6 +62,11 @@
.
("texmf-dist/tex/latex/chs-physics-report/chs-physics-report.sty"))
(catalogue-license . "pd cc-by-sa-3")))
("collection-texworks"
(name . "collection-texworks")
(shortdesc . "TeXworks editor...")
(longdesc . "See http...")
(depend "texworks" "collection-basic"))
("example"
. ((name . "example")
(shortdesc . "Typeset examples...")
@@ -401,4 +406,38 @@ completely compatible with Plain TeX.")
(format #t "~s~%" result)
(pk 'fail result #f)))))))
(test-assert "texlive->guix-package, meta-package"
;; Replace network resources with sample data.
(mock ((guix build svn) svn-fetch
(lambda* (url revision directory
#:key (svn-command "svn")
(user-name #f)
(password #f)
(recursive? #t))
(mkdir-p directory)
(with-output-to-file (string-append directory "/foo")
(lambda ()
(display "source")))))
(let ((result (texlive->guix-package "collection-texworks"
#:package-database
(lambda _ %fake-tlpdb))))
(match result
(('package
('name "texlive-collection-texworks")
('version _)
('source #f)
('build-system 'texlive-build-system)
('propagated-inputs
('list 'texlive-collection-basic 'texlive-texworks))
('home-page "https://www.tug.org/texlive/")
('synopsis (? string?))
('description (? string?))
('license
('license:fsf-free "https://www.tug.org/texlive/copying.html")))
#true)
(_
(begin
(format #t "~s~%" result)
(pk 'fail result #f)))))))
(test-end "texlive")