From patchwork Mon May 23 15:40:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Wurmus X-Patchwork-Id: 12464 Received: (qmail 109053 invoked by uid 89); 23 May 2016 15:41:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Imports, Hx-languages-length:2822 X-Spam-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 23 May 2016 15:40:54 +0000 Received: from localhost ([::1]:48982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4ryN-0004Iw-Ni for patchwork@sourceware.org; Mon, 23 May 2016 11:40:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4ryC-0004D2-EB for guix-devel@gnu.org; Mon, 23 May 2016 11:40:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4ry7-00035g-7f for guix-devel@gnu.org; Mon, 23 May 2016 11:40:39 -0400 Received: from sinope02.bbbm.mdc-berlin.de ([141.80.25.24]:53745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4ry6-00035Y-Qd for guix-devel@gnu.org; Mon, 23 May 2016 11:40:35 -0400 Received: from localhost (localhost [127.0.0.1]) by sinope02.bbbm.mdc-berlin.de (Postfix) with ESMTP id E5FAE8606C for ; Mon, 23 May 2016 17:40:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mdc-berlin.de; h= content-type:content-type:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received:received; s=mdc; t=1464018028; x=1465832429; bh=dHYmLWQ4kdDTK57UhYGi6VNg1HYD2vaXUq7+lIcr5HY=; b=M6zBpQWuzSJw 89zgLILURzpE8d0BYeWru+JeDchATzeJJkwPoYPYqxhRKjhwWLVIQrGwF5eO1PrG K3puAtTaLWa5dYY8rgVRNDIRaBhvaG/NQw+AOLhGR7eGsL9wydTL2IBcoLa4ut10 kTjMOhVdRm9HTwHov1I2WvEUNoeDIag= X-Virus-Scanned: amavisd-new at mdc-berlin.de Received: from sinope02.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (sinope02.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iC4MGZ5Skq94 for ; Mon, 23 May 2016 17:40:28 +0200 (CEST) Received: from HTCAONE.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sinope02.bbbm.mdc-berlin.de (Postfix) with ESMTPS for ; Mon, 23 May 2016 17:40:28 +0200 (CEST) Received: from localhost (141.80.180.135) by HTCAONE.mdc-berlin.net (141.80.180.125) with Microsoft SMTP Server (TLS) id 14.3.279.2; Mon, 23 May 2016 17:40:28 +0200 From: Ricardo Wurmus To: Subject: [PATCH 3/7] import cran: description->package: Also return package dependencies. Date: Mon, 23 May 2016 17:40:04 +0200 Message-ID: <1464018008-1767-4-git-send-email-ricardo.wurmus@mdc-berlin.de> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1464018008-1767-1-git-send-email-ricardo.wurmus@mdc-berlin.de> References: <1464018008-1767-1-git-send-email-ricardo.wurmus@mdc-berlin.de> MIME-Version: 1.0 X-Originating-IP: [141.80.180.135] X-TM-AS-Product-Ver: SMEX-11.0.0.4255-8.000.1202-22340.007 X-TM-AS-Result: No--6.191200-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 141.80.25.24 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" * 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'