import/cran: Transform external package names to Guix names.

* guix/import/cran.scm (transform-sysname): New procedure.
(description->package): Use it on inputs that are derived from "sysdepends".
This commit is contained in:
Ricardo Wurmus 2022-09-28 22:04:01 +02:00
parent 9d86052c22
commit e761ed7384
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 9 additions and 1 deletions

View File

@ -367,6 +367,14 @@ empty list when the FIELD cannot be found."
"xcode"
"xquartz"))
(define (transform-sysname sysname)
"Return a Guix package name for the common package name SYSNAME."
(match sysname
("java" "openjdk")
("fftw3" "fftw")
("tcl/tk" "tcl")
(_ sysname)))
(define cran-guix-name (cut guix-name "r-" <>))
(define (tarball-needs-fortran? tarball)
@ -561,7 +569,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
`((properties ,`(,'quasiquote ((,'upstream-name . ,name)))))
'())
(build-system r-build-system)
,@(maybe-inputs sysdepends)
,@(maybe-inputs (map transform-sysname sysdepends))
,@(maybe-inputs (map cran-guix-name propagate) 'propagated-inputs)
,@(maybe-inputs
`(,@(if (needs-fortran? source (not (or git? hg?)))