diff mbox series

[bug#49531,core-updates,3/4] import: crate: Emit new-style package inputs.

Message ID ce265e07cfa82c00e65d65296089d3a00b451c08.1626067919.git.iskarian@mgsn.dev
State New
Headers show
Series import: {utils, go, crate}: Emit new-style package inputs. | expand

Commit Message

Sarah Morgensen July 12, 2021, 5:48 a.m. UTC
* guix/import/crate.scm (maybe-cargo-development-inputs)
(maybe-cargo-inputs): Wrap PACKAGE-INPUTS in unquoted 'list'.
* tests/crate.scm ("crate->guix-package")
("cargo-recursive-import")
("cargo-recursive-import-hoors-existing-packages"): Adjust accordingly.
---
 guix/import/crate.scm |  5 +++--
 tests/crate.scm       | 30 +++++++++++-------------------
 2 files changed, 14 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 287ffd2536..9c3bdfb9ab 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -3,6 +3,7 @@ 
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -137,14 +138,14 @@  record or #f if it was not found."
     (()
      '())
     ((package-inputs ...)
-     `(#:cargo-inputs ,package-inputs))))
+     `(#:cargo-inputs (,'unquote (list ,@package-inputs))))))
 
 (define (maybe-cargo-development-inputs package-names)
   (match (package-names->package-inputs package-names)
     (()
      '())
     ((package-inputs ...)
-     `(#:cargo-development-inputs ,package-inputs))))
+     `(#:cargo-development-inputs (,'unquote (list ,@package-inputs))))))
 
 (define (maybe-arguments arguments)
   (match arguments
diff --git a/tests/crate.scm b/tests/crate.scm
index b6c3a7ee2e..50b46aa871 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -3,6 +3,7 @@ 
 ;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -374,7 +375,7 @@ 
                        ('quasiquote
                         (#:skip-build? #t
                          #:cargo-inputs
-                         (("rust-leaf-alice" ('unquote 'rust-leaf-alice-0.7))))))
+                         ('unquote (list rust-leaf-alice)))))
                       (home-page "http://example.com")
                       (synopsis "summary")
                       (description "summary")
@@ -494,8 +495,7 @@ 
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-leaf-bob"
-                                 ('unquote rust-leaf-bob-3))))))
+                               ('unquote (list rust-leaf-bob)))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
@@ -517,12 +517,9 @@ 
                 (arguments
                  ('quasiquote (#:skip-build? #t
                                #:cargo-inputs
-                               (("rust-intermediate-b"
-                                 ('unquote rust-intermediate-b-1))
-                                ("rust-leaf-alice"
-                                 ('unquote 'rust-leaf-alice-0.7))
-                                ("rust-leaf-bob"
-                                 ('unquote rust-leaf-bob-3))))))
+                               ('unquote (list rust-intermediate-b
+                                               rust-leaf-alice
+                                               rust-leaf-bob)))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
@@ -543,14 +540,10 @@ 
                 (build-system cargo-build-system)
                 (arguments
                  ('quasiquote (#:cargo-inputs
-                               (("rust-intermediate-a"
-                                 ('unquote rust-intermediate-a-1))
-                                ("rust-intermediate-b"
-                                 ('unquote rust-intermediate-b-1))
-                                ("rust-leaf-alice"
-                                 ('unquote 'rust-leaf-alice-0.7))
-                                ("rust-leaf-bob"
-                                 ('unquote rust-leaf-bob-3))))))
+                               ('unquote (list rust-intermediate-a
+                                               rust-intermediate-b
+                                               rust-leaf-alice
+                                               rust-leaf-bob)))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")
@@ -651,8 +644,7 @@ 
                 (build-system cargo-build-system)
                 (arguments
                  ('quasiquote (#:cargo-inputs
-                               (("rust-docopt"
-                                 ('unquote 'rust-docopt-0.8))))))
+                               ('unquote (list rust-docopt)))))
                 (home-page "http://example.com")
                 (synopsis "summary")
                 (description "summary")