From: Efraim Flashner <efraim@flashner.co.il>
To: 39261@debbugs.gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#39261] [PATCH] guix: import/crate: Move build-dependencies to cargo-inputs.
Date: Fri, 24 Jan 2020 12:38:43 +0200 [thread overview]
Message-ID: <20200124103843.29807-1-efraim@flashner.co.il> (raw)
* guix/import/crate.scm (crate->guix-package): Add definition for
'dev-dependency?' and 'build-dependency?'. Adjust dep-crates to take
normal- and build- dependencies.
---
guix/import/crate.scm | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 57823c3639..0fece81c55 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -86,7 +87,7 @@
crate-dependency?
json->crate-dependency
(id crate-dependency-id "crate_id") ;string
- (kind crate-dependency-kind "kind" ;'normal | 'dev
+ (kind crate-dependency-kind "kind" ;'normal | 'dev | 'build
string->symbol)
(requirement crate-dependency-requirement "req")) ;string
@@ -197,6 +198,12 @@ latest version of CRATE-NAME."
(define (normal-dependency? dependency)
(eq? (crate-dependency-kind dependency) 'normal))
+ (define (dev-dependency? dependency)
+ (eq? (crate-dependency-kind dependency) 'dev))
+
+ (define (build-dependency? dependency)
+ (eq? (crate-dependency-kind dependency) 'build))
+
(define crate
(lookup-crate crate-name))
@@ -212,8 +219,9 @@ latest version of CRATE-NAME."
(and crate version*
(let* ((dependencies (crate-version-dependencies version*))
- (dep-crates (filter normal-dependency? dependencies))
- (dev-dep-crates (remove normal-dependency? dependencies))
+ (dep-crates (append (filter normal-dependency? dependencies)
+ (filter build-dependency? dependencies)))
+ (dev-dep-crates (filter dev-dependency? dependencies))
(cargo-inputs (sort (map crate-dependency-id dep-crates)
string-ci<?))
(cargo-development-inputs
--
2.25.0
next reply other threads:[~2020-01-24 10:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 10:38 Efraim Flashner [this message]
2020-02-04 23:17 ` [bug#39261] [PATCH] guix: import/crate: Move build-dependencies to cargo-inputs Ludovic Courtès
2020-02-05 7:14 ` Efraim Flashner
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200124103843.29807-1-efraim@flashner.co.il \
--to=efraim@flashner.co.il \
--cc=39261@debbugs.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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).