summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2024-06-22 11:19:55 +0200
committerChristopher Baines <mail@cbaines.net>2024-07-11 10:25:21 +0100
commit42dbd9b591424dba3d87607ba55c06cb36b261b3 (patch)
tree18cdb334d1b8de730f84f61bec9941606f901e5f
parent6168d3b685470ed0d7344d8150b8be42e449e2f4 (diff)
downloadguix-patches-42dbd9b591424dba3d87607ba55c06cb36b261b3.tar
guix-patches-42dbd9b591424dba3d87607ba55c06cb36b261b3.tar.gz
guix: import texlive: Add UPSTREAM-NAME property when necessary.
* guix/import/texlive.scm (tlpdb->package): Add UPSTREAM-NAME property when necessary. * tests/texlive.scm ("texlive->guix-package, with upstream-name property"): Add new test. Change-Id: I134a065cbe0a7f0ff4d72b0929dba4e4d46cfaeb
-rw-r--r--guix/import/texlive.scm4
-rw-r--r--tests/texlive.scm35
2 files changed, 39 insertions, 0 deletions
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index e4e0654b78..6d04cc25ee 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -703,6 +703,10 @@ at VERSION."
,@(if (assoc-ref data 'docfiles)
'((outputs '("out" "doc")))
'())
+ ,@(if (string= upstream-name
+ (string-drop name (string-length "texlive-")))
+ '()
+ `((properties '((upstream-name . ,upstream-name)))))
;; Build system.
;;
;; Use trivial build system only when the package contains no files,
diff --git a/tests/texlive.scm b/tests/texlive.scm
index 0e21c2e9b0..8e7e596962 100644
--- a/tests/texlive.scm
+++ b/tests/texlive.scm
@@ -191,6 +191,9 @@
(shortdesc . "x86_64-linux files of pax")
(binfiles
"bin/x86_64-linux/pdfannotextractor"))
+ ("r_und_s"
+ (name . "r_und_s")
+ (runfiles "texmf-dist/tex/latex/r_und_s/r_und_s.sty"))
("stricttex"
. ((name
. "stricttex")
@@ -952,4 +955,36 @@ completely compatible with Plain TeX.")
(format #t "~s~%" result)
(pk 'fail result #f)))))))
+(test-assert "texlive->guix-package, with upstream-name property"
+ ;; 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 "r_und_s"
+ #:version "0"
+ #:database %fake-tlpdb)))
+ (match result
+ (('package
+ ('name "texlive-r-und-s")
+ ('version _)
+ ('source _)
+ ('properties _)
+ ('build-system 'texlive-build-system)
+ ('home-page _)
+ ('synopsis _)
+ ('description _)
+ ('license _))
+ #true)
+ (_
+ (begin
+ (format #t "~s~%" result)
+ (pk 'fail result #f)))))))
+
(test-end "texlive")