diff options
author | Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | 2016-05-17 15:17:54 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2016-12-17 15:56:48 +0100 |
commit | ad68f7fa58daeff542d2fba19f65928c1af5799b (patch) | |
tree | 1241ab3f74e8ee060f0b5f6cb2b1bd2e65c27aaf | |
parent | bfa0c752bc19810f7b4908c3d0f4a1dd7832c1b6 (diff) | |
download | patches-ad68f7fa58daeff542d2fba19f65928c1af5799b.tar patches-ad68f7fa58daeff542d2fba19f65928c1af5799b.tar.gz |
import cran: description->package: Also return package dependencies.
* guix/import/cran.scm (description->package): Return package
dependencies in addition to generated package expression.
-rw-r--r-- | guix/import/cran.scm | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm index c98ab88aec..313e26b03d 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -23,6 +23,7 @@ #:use-module ((ice-9 rdelim) #:select (read-string)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (ice-9 receive) #:use-module (guix http-client) #:use-module (guix hash) #:use-module (guix store) @@ -179,33 +180,36 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (_ #f))) (tarball (with-store store (download-to-store store source-url))) (sysdepends (map string-downcase (listify meta "SystemRequirements"))) - (propagate (map guix-name (lset-union equal? - (listify meta "Imports") - (listify meta "LinkingTo") - (delete "R" - (listify meta "Depends")))))) - `(package - (name ,(guix-name name)) - (version ,version) - (source (origin - (method url-fetch) - (uri (,(procedure-name uri-helper) ,name version)) - (sha256 - (base32 - ,(bytevector->nix-base32-string (file-sha256 tarball)))))) - ,@(if (not (equal? (string-append "r-" name) - (guix-name name))) - `((properties ,`(,'quasiquote ((,'upstream-name . ,name))))) - '()) - (build-system r-build-system) - ,@(maybe-inputs sysdepends) - ,@(maybe-inputs propagate 'propagated-inputs) - (home-page ,(if (string-null? home-page) - (string-append base-url name) - home-page)) - (synopsis ,synopsis) - (description ,(beautify-description (assoc-ref meta "Description"))) - (license ,license)))) + (propagate (lset-union equal? + (listify meta "Imports") + (listify meta "LinkingTo") + (delete "R" + (listify meta "Depends"))))) + (values + `(package + (name ,(guix-name name)) + (version ,version) + (source (origin + (method url-fetch) + (uri (,(procedure-name uri-helper) ,name version)) + (sha256 + (base32 + ,(bytevector->nix-base32-string (file-sha256 tarball)))))) + ,@(if (not (equal? (string-append "r-" name) + (guix-name name))) + `((properties ,`(,'quasiquote ((,'upstream-name . ,name))))) + '()) + (build-system r-build-system) + ,@(maybe-inputs sysdepends) + ,@(maybe-inputs (map guix-name propagate) 'propagated-inputs) + (home-page ,(if (string-null? home-page) + (string-append base-url name) + home-page)) + (synopsis ,synopsis) + (description ,(beautify-description (or (assoc-ref meta "Description") + ""))) + (license ,license)) + propagate))) (define* (cran->guix-package package-name #:optional (repo 'cran)) "Fetch the metadata for PACKAGE-NAME from REPO and return the `package' |