all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: guix-devel@gnu.org
Subject: [PATCH 3/7] import cran: description->package: Also return package dependencies.
Date: Mon, 23 May 2016 17:40:04 +0200	[thread overview]
Message-ID: <1464018008-1767-4-git-send-email-ricardo.wurmus@mdc-berlin.de> (raw)
In-Reply-To: <1464018008-1767-1-git-send-email-ricardo.wurmus@mdc-berlin.de>

* guix/import/cran.scm (description->package): Return package
  dependencies in addition to generated package expression.
---
 guix/import/cran.scm | 58 ++++++++++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 27 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 0be5346..ff9dbd3 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)
@@ -177,33 +178,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'
-- 
2.7.3

  parent reply	other threads:[~2016-05-23 15:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 15:40 [PATCH] Add recursive CRAN importer Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 1/7] import cran: Remove more invalid characters from package names Ricardo Wurmus
2016-05-30  8:48   ` Ludovic Courtès
2016-06-14 15:02     ` Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 2/7] import cran: Move guix-name to top-level Ricardo Wurmus
2016-05-30  8:49   ` Ludovic Courtès
2016-05-23 15:40 ` Ricardo Wurmus [this message]
2016-05-30  8:51   ` [PATCH 3/7] import cran: description->package: Also return package dependencies Ludovic Courtès
2016-06-14 15:49     ` Ricardo Wurmus
2016-08-05 16:03       ` Ricardo Wurmus
2016-08-29 15:20         ` Ludovic Courtès
2016-08-31 10:39           ` Ricardo Wurmus
2016-09-01 11:50             ` Ludovic Courtès
2016-05-23 15:40 ` [PATCH 4/7] import cran: Ignore default R packages Ricardo Wurmus
2016-05-30  8:52   ` Ludovic Courtès
2016-05-23 15:40 ` [PATCH 5/7] import cran: Add recursive importer Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 6/7] import cran: Add "recursive" option Ricardo Wurmus
2016-05-30  8:55   ` Ludovic Courtès
2016-06-14 15:30     ` Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 7/7] guix import: Print list of expressions Ricardo Wurmus
2016-05-30  8:56   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464018008-1767-4-git-send-email-ricardo.wurmus@mdc-berlin.de \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.