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.
This commit is contained in:
parent
c09a05d06c
commit
31cd9a5040
2 changed files with 67 additions and 1 deletions
|
@ -315,6 +315,21 @@ of those files are returned that are unexpectedly installed."
|
||||||
'((outputs '("out" "doc")))
|
'((outputs '("out" "doc")))
|
||||||
'())
|
'())
|
||||||
(build-system texlive-build-system)
|
(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
|
,@(match filtered-depends
|
||||||
(() '())
|
(() '())
|
||||||
(inputs
|
(inputs
|
||||||
|
|
|
@ -195,7 +195,24 @@ completely compatible with Plain TeX.")
|
||||||
"texmf-dist/tex/texsis/base/thesis.txs"
|
"texmf-dist/tex/texsis/base/thesis.txs"
|
||||||
"texmf-dist/tex/texsis/base/twin.txs"
|
"texmf-dist/tex/texsis/base/twin.txs"
|
||||||
"texmf-dist/tex/texsis/config/texsis.ini"))
|
"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"
|
(test-assert "texlive->guix-package, no docfiles"
|
||||||
;; Replace network resources with sample data.
|
;; Replace network resources with sample data.
|
||||||
|
@ -277,6 +294,40 @@ completely compatible with Plain TeX.")
|
||||||
(format #t "~s~%" result)
|
(format #t "~s~%" result)
|
||||||
(pk 'fail result #f)))))))
|
(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"
|
(test-assert "texlive->guix-package, with catalogue entry, no inputs"
|
||||||
;; Replace network resources with sample data.
|
;; Replace network resources with sample data.
|
||||||
(mock ((guix build svn) svn-fetch
|
(mock ((guix build svn) svn-fetch
|
||||||
|
|
Reference in a new issue