[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
390/418: guix: import: Handle native inputs in texlive importer.
From: |
guix-commits |
Subject: |
390/418: guix: import: Handle native inputs in texlive importer. |
Date: |
Fri, 2 Jun 2023 17:26:00 -0400 (EDT) |
ngz pushed a commit to branch tex-team-next
in repository guix.
commit 0c92b1b5a6a1ab33ff7115f741cdf99ba81f94d7
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
AuthorDate: Fri May 19 23:27:38 2023 +0200
guix: import: Handle native inputs in texlive importer.
* guix/import/texlive.scm (tlpdb->package): Add TEXLIVE-METAFONT as a native
input whenever font metrics are to be generated.
* tests/texlive.scm (%fake-tlpdb): Add test data.
("texlive->guix-package, with METAFONT files"): New test.
---
guix/import/texlive.scm | 15 ++++++++++++++
tests/texlive.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 33a0e7d1d9..fd772d3133 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -315,6 +315,21 @@ of those files are returned that are unexpectedly
installed."
'((outputs '("out" "doc")))
'())
(build-system texlive-build-system)
+ ;; 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))
+ (metrics
+ (filter-map (lambda (f)
+ (and (string-suffix? ".tfm" f)
+ (basename f ".tfm")))
+ runfiles))
+ ((not (null? metrics)))
+ ((any (lambda (f)
+ (and (string-suffix? ".mf" f)
+ (member (basename f ".mf") metrics)))
+ runfiles)))
+ '((native-inputs (list texlive-metafont))))
+ '())
,@(match filtered-depends
(() '())
(inputs
diff --git a/tests/texlive.scm b/tests/texlive.scm
index 9f4c965139..704c86e24a 100644
--- a/tests/texlive.scm
+++ b/tests/texlive.scm
@@ -195,7 +195,24 @@ completely compatible with Plain TeX.")
"texmf-dist/tex/texsis/base/thesis.txs"
"texmf-dist/tex/texsis/base/twin.txs"
"texmf-dist/tex/texsis/config/texsis.ini"))
- (catalogue-license . "lppl")))))
+ (catalogue-license . "lppl")))
+ ("trsym"
+ (name . "trsym")
+ (shortdesc . "Symbols for transformations")
+ (longdesc . "The bundle provides Metafont...")
+ (docfiles "texmf-dist/doc/latex/trsym/README"
+ "texmf-dist/doc/latex/trsym/manifest.txt"
+ "texmf-dist/doc/latex/trsym/trsym.pdf")
+ (srcfiles "texmf-dist/source/latex/trsym/trsym.dtx"
+ "texmf-dist/source/latex/trsym/trsym.ins")
+ (runfiles "texmf-dist/fonts/source/public/trsym/trsy.mf"
+ "texmf-dist/fonts/source/public/trsym/trsy10.mf"
+ "texmf-dist/fonts/source/public/trsym/trsy12.mf"
+ "texmf-dist/fonts/tfm/public/trsym/trsy10.tfm"
+ "texmf-dist/fonts/tfm/public/trsym/trsy12.tfm"
+ "texmf-dist/tex/latex/trsym/trsym.sty"
+ "texmf-dist/tex/latex/trsym/utrsy.fd")
+ (catalogue-license . "lppl"))))
(test-assert "texlive->guix-package, no docfiles"
;; Replace network resources with sample data.
@@ -277,6 +294,40 @@ completely compatible with Plain TeX.")
(format #t "~s~%" result)
(pk 'fail result #f)))))))
+(test-assert "texlive->guix-package, with METAFONT files"
+ ;; 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 "trsym"
+ #:package-database
+ (lambda _ %fake-tlpdb))))
+ (match result
+ (('package
+ ('name _)
+ ('version _)
+ ('source _)
+ ('outputs _)
+ ('build-system _)
+ ('native-inputs
+ ('list 'texlive-metafont))
+ ('home-page (? string?))
+ ('synopsis (? string?))
+ ('description (? string?))
+ ('license _))
+ #true)
+ (_
+ (begin
+ (format #t "~s~%" result)
+ (pk 'fail result #f)))))))
+
(test-assert "texlive->guix-package, with catalogue entry, no inputs"
;; Replace network resources with sample data.
(mock ((guix build svn) svn-fetch
- 372/418: gnu: texlive-qrcode: Remove SIMPLE-TEXLIVE-PACKAGE call., (continued)
- 372/418: gnu: texlive-qrcode: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 373/418: gnu: texlive-unicode-math: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 375/418: gnu: texlive-babel-czech: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 379/418: gnu: texlive-babel-polish: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 381/418: gnu: texlive-breqn: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 382/418: gnu: texlive-datatool: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 383/418: gnu: texlive-lastpage: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 385/418: gnu: texlive-soulutf8: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 386/418: gnu: texlive-totcount: Remove SIMPLE-TEXLIVE-PACKAGE call., guix-commits, 2023/06/02
- 388/418: gnu: simple-texlive-package: Remove it., guix-commits, 2023/06/02
- 390/418: guix: import: Handle native inputs in texlive importer.,
guix-commits <=
- 391/418: gnu: texlive-cm: Fix build., guix-commits, 2023/06/02
- 395/418: gnu: texlive-ec: Fix build., guix-commits, 2023/06/02
- 399/418: gnu: texlive-eurosym: Fix build., guix-commits, 2023/06/02
- 400/418: gnu: texlive-tipa: Fix build., guix-commits, 2023/06/02
- 389/418: guix: texlive-build-system: Generate font metrics., guix-commits, 2023/06/02
- 405/418: gnu: texlive-lh: Fix build., guix-commits, 2023/06/02
- 406/418: gnu: texlive-xypic: Fix build., guix-commits, 2023/06/02
- 407/418: gnu: Add texlive-sansmathfonts., guix-commits, 2023/06/02
- 411/418: guix: import: Fix Creative Common licenses in texlive importer., guix-commits, 2023/06/02
- 413/418: guix: import: Improve importing texlive meta packages., guix-commits, 2023/06/02