[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/418: guix: import: Fix multiple licenses output in texlive importer.
From: |
guix-commits |
Subject: |
06/418: guix: import: Fix multiple licenses output in texlive importer. |
Date: |
Mon, 29 May 2023 17:38:43 -0400 (EDT) |
ngz pushed a commit to branch tex-team-next
in repository guix.
commit fc7318df7f80d153f7b65f0f905c900f6724c921
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
AuthorDate: Wed May 17 10:57:23 2023 +0200
guix: import: Fix multiple licenses output in texlive importer.
* guix/import/texlive.scm (string->license): Add missing case and try first
to
split license strings before giving up.
* tests/texlive.scm (%fake-tlpdb): Add test data.
("texlive->guix-package, multiple licenses"): New test.
---
guix/import/texlive.scm | 3 ++-
tests/texlive.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 31abf533c4..33a0e7d1d9 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -109,7 +109,8 @@
("cc-by-nc-nd-2.5" 'non-free)
("cc-by-nc-nd-3" 'non-free)
("cc-by-nc-nd-4" 'non-free)
- ((x) (string->license x))
+ ((? string? x) (string->license (string-split x #\space)))
+ ((x) `(error unknown-license ,x))
((lst ...) `(list ,@(map string->license lst)))
(x `(error unknown-license ,x))))
diff --git a/tests/texlive.scm b/tests/texlive.scm
index 19bb3bda1b..9f4c965139 100644
--- a/tests/texlive.scm
+++ b/tests/texlive.scm
@@ -50,6 +50,18 @@
(runfiles
. ("texmf-dist/tex/latex/12many/12many.sty"))
(catalogue-license . "lppl")))
+ ("chs-physics-report"
+ . ((name . "ch-physics-report")
+ (shortdesc . "Physics lab reports...")
+ (longdesc . "This package may...")
+ (docfiles
+ .
+ ("texmf-dist/doc/latex/chs-physics-report/README.txt"
+ "texmf-dist/doc/latex/chs-physics-report/chs-physics-report.pdf"))
+ (runfiles
+ .
+ ("texmf-dist/tex/latex/chs-physics-report/chs-physics-report.sty"))
+ (catalogue-license . "pd cc-by-sa-3")))
("example"
. ((name . "example")
(shortdesc . "Typeset examples...")
@@ -302,4 +314,40 @@ completely compatible with Plain TeX.")
(format #t "~s~%" result)
(pk 'fail result #f)))))))
+(test-assert "texlive->guix-package, multiple licenses"
+ ;; 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 "chs-physics-report"
+ #:package-database
+ (lambda _ %fake-tlpdb))))
+ (match result
+ (('package
+ ('name "texlive-chs-physics-report")
+ ('version _)
+ ('source ('texlive-origin
+ 'name 'version
+ ('list "doc/latex/chs-physics-report/"
+ "tex/latex/chs-physics-report/")
+ ('base32 (? string? hash))))
+ ('outputs ''("out" "doc"))
+ ('build-system 'texlive-build-system)
+ ('home-page (? string?))
+ ('synopsis (? string?))
+ ('description (? string?))
+ ('license ('list 'public-domain 'cc-by-sa3.0)))
+ #true)
+ (_
+ (begin
+ (format #t "~s~%" result)
+ (pk 'fail result #f)))))))
+
(test-end "texlive")
- branch tex-team-next created (now ecb19e3353), guix-commits, 2023/05/29
- 01/418: guix: texlive-build-system: Improvements on non-trivial packages., guix-commits, 2023/05/29
- 02/418: gnu: Simplify simple-texlive-package for non-trivial packages., guix-commits, 2023/05/29
- 03/418: guix: import: Update texlive importer according to new build system., guix-commits, 2023/05/29
- 04/418: guix: import: Improve home-page generation in texlive importer., guix-commits, 2023/05/29
- 05/418: guix: import: texlive use full file names for generic directories., guix-commits, 2023/05/29
- 06/418: guix: import: Fix multiple licenses output in texlive importer.,
guix-commits <=
- 14/418: gnu: texlive-latex-eqparbox -> texlive-eqparbox., guix-commits, 2023/05/29
- 07/418: gnu: texlive-latex-l3kernel -> texlive-l3kernel., guix-commits, 2023/05/29
- 12/418: gnu: texlive-latex-trimspaces -> texlive-trimspaces., guix-commits, 2023/05/29
- 13/418: gnu: texlive-latex-environ -> texlive-environ., guix-commits, 2023/05/29
- 08/418: gnu: texlive-latex-blindtext -> texlive-blindtext., guix-commits, 2023/05/29
- 09/418: gnu: texlive-latex-dinbrief -> texlive-dinbrief., guix-commits, 2023/05/29
- 16/418: gnu: texlive-latex-expdlist -> texlive-expdlist., guix-commits, 2023/05/29
- 17/418: gnu: Add texlive-minitoc., guix-commits, 2023/05/29
- 20/418: gnu: Add texlive-mfirstuc., guix-commits, 2023/05/29
- 10/418: gnu: Add texlive-everypage., guix-commits, 2023/05/29