summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2023-05-27 21:39:26 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2023-07-18 18:12:47 +0200
commitd62b35bbe922b94baffe1ffcf810ad5f29669e5d (patch)
tree516c15b1d212ab96782fe6d31f9212bab28ecc46 /tests
parent293abb4c4e72617de2e83ccb271fce4792988492 (diff)
downloadguix-d62b35bbe922b94baffe1ffcf810ad5f29669e5d.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/texlive.scm39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/texlive.scm b/tests/texlive.scm
index 704c86e24a..4172262fb2 100644
--- a/tests/texlive.scm
+++ b/tests/texlive.scm
@@ -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")