import cran: description->package: Also return package dependencies.
* guix/import/cran.scm (description->package): Return package dependencies in addition to generated package expression.
This commit is contained in:
parent
bfa0c752bc
commit
ad68f7fa58
1 changed files with 31 additions and 27 deletions
|
@ -23,6 +23,7 @@
|
||||||
#:use-module ((ice-9 rdelim) #:select (read-string))
|
#:use-module ((ice-9 rdelim) #:select (read-string))
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
|
#:use-module (ice-9 receive)
|
||||||
#:use-module (guix http-client)
|
#:use-module (guix http-client)
|
||||||
#:use-module (guix hash)
|
#:use-module (guix hash)
|
||||||
#:use-module (guix store)
|
#:use-module (guix store)
|
||||||
|
@ -179,11 +180,12 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
|
||||||
(_ #f)))
|
(_ #f)))
|
||||||
(tarball (with-store store (download-to-store store source-url)))
|
(tarball (with-store store (download-to-store store source-url)))
|
||||||
(sysdepends (map string-downcase (listify meta "SystemRequirements")))
|
(sysdepends (map string-downcase (listify meta "SystemRequirements")))
|
||||||
(propagate (map guix-name (lset-union equal?
|
(propagate (lset-union equal?
|
||||||
(listify meta "Imports")
|
(listify meta "Imports")
|
||||||
(listify meta "LinkingTo")
|
(listify meta "LinkingTo")
|
||||||
(delete "R"
|
(delete "R"
|
||||||
(listify meta "Depends"))))))
|
(listify meta "Depends")))))
|
||||||
|
(values
|
||||||
`(package
|
`(package
|
||||||
(name ,(guix-name name))
|
(name ,(guix-name name))
|
||||||
(version ,version)
|
(version ,version)
|
||||||
|
@ -199,13 +201,15 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
|
||||||
'())
|
'())
|
||||||
(build-system r-build-system)
|
(build-system r-build-system)
|
||||||
,@(maybe-inputs sysdepends)
|
,@(maybe-inputs sysdepends)
|
||||||
,@(maybe-inputs propagate 'propagated-inputs)
|
,@(maybe-inputs (map guix-name propagate) 'propagated-inputs)
|
||||||
(home-page ,(if (string-null? home-page)
|
(home-page ,(if (string-null? home-page)
|
||||||
(string-append base-url name)
|
(string-append base-url name)
|
||||||
home-page))
|
home-page))
|
||||||
(synopsis ,synopsis)
|
(synopsis ,synopsis)
|
||||||
(description ,(beautify-description (assoc-ref meta "Description")))
|
(description ,(beautify-description (or (assoc-ref meta "Description")
|
||||||
(license ,license))))
|
"")))
|
||||||
|
(license ,license))
|
||||||
|
propagate)))
|
||||||
|
|
||||||
(define* (cran->guix-package package-name #:optional (repo 'cran))
|
(define* (cran->guix-package package-name #:optional (repo 'cran))
|
||||||
"Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
|
"Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
|
||||||
|
|
Reference in a new issue