unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49566] [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: Emit new-style package inputs.
@ 2021-07-15  1:28 Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 1/4] import: egg: " Sarah Morgensen via Guix-patches via
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sarah Morgensen via Guix-patches via @ 2021-07-15  1:28 UTC (permalink / raw)
  To: 49566

Hello Guix,

Together with [0] this should take care of updating all the importers to
new-style package inputs. These are all standalone edits. Tests pass but I did
not manually verify importing.

[0] https://issues.guix.gnu.org/49531

--
Sarah Morgensen (4):
  import: egg: Emit new-style package inputs.
  import: gem: Emit new-style package inputs.
  import: opam: Emit new-style package inputs.
  import: hackage: Emit new-style package inputs.

 guix/import/egg.scm     | 14 ++++++--------
 guix/import/gem.scm     |  8 ++------
 guix/import/hackage.scm | 11 +++++------
 guix/import/opam.scm    | 11 +++++------
 tests/egg.scm           | 27 +++++++--------------------
 tests/gem.scm           | 15 ++++-----------
 tests/hackage.scm       | 18 +++++-------------
 tests/opam.scm          | 10 +++-------
 8 files changed, 37 insertions(+), 77 deletions(-)


base-commit: 8456581375cf03c46005d00907f8fdd1f5615f1e
-- 
2.31.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#49566] [PATCH core-updates 1/4] import: egg: Emit new-style package inputs.
  2021-07-15  1:28 [bug#49566] [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: Emit new-style package inputs Sarah Morgensen via Guix-patches via
@ 2021-07-15  1:40 ` Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 2/4] import: gem: " Sarah Morgensen via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen via Guix-patches via @ 2021-07-15  1:40 UTC (permalink / raw)
  To: 49566

* guix/import/egg.scm (egg->guix-package): Generate dependency list from
a list of symbols.
[egg-parse-dependency]: Return a list of symbols.
[maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'.
* tests/egg.scm (match-chicken-foo): Adjust accordingly.
---
 guix/import/egg.scm | 14 ++++++--------
 tests/egg.scm       | 27 +++++++--------------------
 2 files changed, 13 insertions(+), 28 deletions(-)

diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index 107894ddcf..86b54ff56f 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -246,12 +247,9 @@ not work."
           (let ((name (prettify-name (extract-name name))))
             ;; Dependencies are sometimes specified as symbols and sometimes
             ;; as strings
-            (list (string-append (if system? "" package-name-prefix)
-                                 name)
-                  (list 'unquote
-                        (string->symbol (string-append
-                                         (if system? "" package-name-prefix)
-                                         name))))))
+            (string->symbol (string-append
+                             (if system? "" package-name-prefix)
+                             name))))
 
         (define egg-propagated-inputs
           (let ((dependencies (assoc-ref egg-content 'dependencies)))
@@ -290,7 +288,7 @@ not work."
              '())
             ((inputs ...)
              (list (list input-type
-                         (list 'quasiquote inputs))))))
+                         `(list ,@inputs))))))
 
         (values
          `(package
@@ -318,7 +316,7 @@ not work."
             (license ,egg-licenses))
          (filter (lambda (name)
                    (not (member name '("srfi-4"))))
-                 (map (compose guix-name->egg-name first)
+                 (map (compose guix-name->egg-name symbol->string)
                       (append egg-propagated-inputs
                               egg-native-inputs)))))))
 
diff --git a/tests/egg.scm b/tests/egg.scm
index 0884d8d429..9e45a42443 100644
--- a/tests/egg.scm
+++ b/tests/egg.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,16 +87,9 @@
     ('build-system 'chicken-build-system)
     ('arguments ('quasiquote ('#:egg-name "foo")))
     ('native-inputs
-     ('quasiquote
-      (("chicken-test" ('unquote chicken-test))
-       ("chicken-srfi-1" ('unquote chicken-srfi-1))
-       ("chicken-begin-syntax" ('unquote chicken-begin-syntax)))))
-    ('inputs
-     ('quasiquote
-      (("libgit2" ('unquote libgit2)))))
-    ('propagated-inputs
-     ('quasiquote
-      (("chicken-datatype" ('unquote chicken-datatype)))))
+     ('list 'chicken-test 'chicken-srfi-1 'chicken-begin-syntax))
+    ('inputs ('list 'libgit2))
+    ('propagated-inputs ('list 'chicken-datatype))
     ('home-page "https://wiki.call-cc.org/egg/foo")
     ('synopsis "Example egg")
     ('description #f)
@@ -108,16 +102,9 @@
     ('source (? file-like? source))
     ('build-system 'chicken-build-system)
     ('arguments ('quasiquote ('#:egg-name "bar")))
-    ('native-inputs
-     ('quasiquote
-      (("chicken-test" ('unquote chicken-test))
-       ("chicken-begin-syntax" ('unquote chicken-begin-syntax)))))
-    ('inputs
-     ('quasiquote
-      (("libgit2" ('unquote libgit2)))))
-    ('propagated-inputs
-     ('quasiquote
-      (("chicken-datatype" ('unquote chicken-datatype)))))
+    ('native-inputs ('list 'chicken-test 'chicken-begin-syntax))
+    ('inputs ('list 'libgit2))
+    ('propagated-inputs ('list 'chicken-datatype))
     ('home-page "https://wiki.call-cc.org/egg/bar")
     ('synopsis "Example egg")
     ('description #f)
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#49566] [PATCH core-updates 2/4] import: gem: Emit new-style package inputs.
  2021-07-15  1:28 [bug#49566] [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: Emit new-style package inputs Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 1/4] import: egg: " Sarah Morgensen via Guix-patches via
@ 2021-07-15  1:40 ` Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 3/4] import: opam: " Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 4/4] import: hackage: " Sarah Morgensen via Guix-patches via
  3 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen via Guix-patches via @ 2021-07-15  1:40 UTC (permalink / raw)
  To: 49566

* guix/import/gem.scm (make-gem-sexp): Wrap inputs in 'list' instead of
'quasiquote'.
* tests/gem.scm ("gem->guix-package")
("gem-recursive-import"): Adjust accordingly.
---
 guix/import/gem.scm |  8 ++------
 tests/gem.scm       | 15 ++++-----------
 2 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 418d716be6..0e5bb7e635 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2020, 2021 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.
 ;;;
@@ -110,12 +111,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
      ,@(if (null? dependencies)
            '()
            `((propagated-inputs
-              (,'quasiquote
-               ,(map (lambda (name)
-                       `(,name
-                         (,'unquote
-                          ,(string->symbol name))))
-                     dependencies)))))
+              (list ,@(map string->symbol dependencies)))))
      (synopsis ,synopsis)
      (description ,description)
      (home-page ,home-page)
diff --git a/tests/gem.scm b/tests/gem.scm
index 751bba656f..c8fe15398e 100644
--- a/tests/gem.scm
+++ b/tests/gem.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -93,10 +94,7 @@
                      ('base32
                       "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk"))))
          ('build-system 'ruby-build-system)
-         ('propagated-inputs
-          ('quasiquote
-           (("bundler" ('unquote 'bundler))
-            ("ruby-bar" ('unquote 'ruby-bar)))))
+         ('propagated-inputs ('list 'bundler 'ruby-bar))
          ('synopsis "A cool gem")
          ('description "This package provides a cool gem")
          ('home-page "https://example.com")
@@ -132,9 +130,7 @@
                   ('base32
                    "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk"))))
               ('build-system 'ruby-build-system)
-              ('propagated-inputs
-               ('quasiquote
-                (('"bundler" ('unquote 'bundler)))))
+              ('propagated-inputs ('list 'bundler))
               ('synopsis "Another cool gem")
               ('description "Another cool gem")
               ('home-page "https://example.com")
@@ -165,10 +161,7 @@
                   ('base32
                    "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk"))))
               ('build-system 'ruby-build-system)
-              ('propagated-inputs
-               ('quasiquote
-                (("bundler" ('unquote 'bundler))
-                 ("ruby-bar" ('unquote 'ruby-bar)))))
+              ('propagated-inputs ('list 'bundler 'ruby-bar))
               ('synopsis "A cool gem")
               ('description "This package provides a cool gem")
               ('home-page "https://example.com")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#49566] [PATCH core-updates 3/4] import: opam: Emit new-style package inputs.
  2021-07-15  1:28 [bug#49566] [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: Emit new-style package inputs Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 1/4] import: egg: " Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 2/4] import: gem: " Sarah Morgensen via Guix-patches via
@ 2021-07-15  1:40 ` Sarah Morgensen via Guix-patches via
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 4/4] import: hackage: " Sarah Morgensen via Guix-patches via
  3 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen via Guix-patches via @ 2021-07-15  1:40 UTC (permalink / raw)
  To: 49566

* guix/import/opam.scm (opam->guix-package): Wrap INPUTS and
NATIVE-INPUTS in 'list' instead of 'quasiquote'.
(dependency-list->inputs): Return a list of symbols.
* tests/opam.scm ("opam->guix-package"): Adjust accordingly.
---
 guix/import/opam.scm | 11 +++++------
 tests/opam.scm       | 10 +++-------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 0201376457..1ce8b7e94e 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -269,10 +270,8 @@ path to the repository."
     (map dependency->native-input depends)))
 
 (define (dependency-list->inputs lst)
-  (map
-    (lambda (dependency)
-      (list dependency (list 'unquote (string->symbol dependency))))
-    (ocaml-names->guix-names lst)))
+  (map string->symbol
+       (ocaml-names->guix-names lst)))
 
 (define* (opam-fetch name #:optional (repository (get-opam-repository)))
   (and-let* ((repository repository)
@@ -325,10 +324,10 @@ or #f on failure."
                                           'ocaml-build-system))
                        ,@(if (null? inputs)
                            '()
-                           `((propagated-inputs ,(list 'quasiquote inputs))))
+                           `((propagated-inputs (list ,@inputs))))
                        ,@(if (null? native-inputs)
                            '()
-                           `((native-inputs ,(list 'quasiquote native-inputs))))
+                           `((native-inputs (list ,@native-inputs))))
                        ,@(if (equal? name (guix-name->opam-name (ocaml-name->guix-name name)))
                            '()
                            `((properties
diff --git a/tests/opam.scm b/tests/opam.scm
index f1e3b70cb0..e7f1ff9e39 100644
--- a/tests/opam.scm
+++ b/tests/opam.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -101,13 +102,8 @@ url {
                                ('base32
                                 (? string? hash)))))
                    ('build-system 'ocaml-build-system)
-                   ('propagated-inputs
-                    ('quasiquote
-                     (("ocaml-zarith" ('unquote 'ocaml-zarith)))))
-                   ('native-inputs
-                    ('quasiquote
-                     (("ocaml-alcotest" ('unquote 'ocaml-alcotest))
-                      ("ocamlbuild" ('unquote 'ocamlbuild)))))
+                   ('propagated-inputs ('list 'ocaml-zarith))
+                   ('native-inputs ('list 'ocaml-alcotest 'ocamlbuild))
                    ('home-page "https://example.org/")
                    ('synopsis "Some example package")
                    ('description "This package is just an example.")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#49566] [PATCH core-updates 4/4] import: hackage: Emit new-style package inputs.
  2021-07-15  1:28 [bug#49566] [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: Emit new-style package inputs Sarah Morgensen via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 3/4] import: opam: " Sarah Morgensen via Guix-patches via
@ 2021-07-15  1:40 ` Sarah Morgensen via Guix-patches via
  2021-07-20 21:34   ` bug#49566: [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: " Ludovic Courtès
  3 siblings, 1 reply; 6+ messages in thread
From: Sarah Morgensen via Guix-patches via @ 2021-07-15  1:40 UTC (permalink / raw)
  To: 49566

* guix/import/hackage.scm (hackage-module->sexp)[dependencies]
[native-dependencies]: Make into a list of symbols.
[maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'.
* tests/hackage.scm (match-ghc-foo)
(match-ghc-foo-6)
(match-ghc-foo-revision): Adjust accordingly.
---
 guix/import/hackage.scm | 11 +++++------
 tests/hackage.scm       | 18 +++++-------------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index f94a1e7087..7c6d9d0a22 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -265,14 +266,12 @@ the hash of the Cabal file."
      hackage-dependencies))
 
   (define dependencies
-    (map (lambda (name)
-           (list name (list 'unquote (string->symbol name))))
+    (map string->symbol
          (map hackage-name->package-name
               hackage-dependencies)))
 
   (define native-dependencies
-    (map (lambda (name)
-           (list name (list 'unquote (string->symbol name))))
+    (map string->symbol
          (map hackage-name->package-name
               hackage-native-dependencies)))
   
@@ -282,8 +281,8 @@ the hash of the Cabal file."
        '())
       ((inputs ...)
        (list (list input-type
-                   (list 'quasiquote inputs))))))
-  
+                   `(list ,@inputs))))))
+
   (define (maybe-arguments)
     (match (append (if (not include-test-dependencies?)
                        '(#:tests? #f)
diff --git a/tests/hackage.scm b/tests/hackage.scm
index 66a13d9881..0ecef40b55 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -178,9 +179,7 @@ library
         ('base32
          (? string? hash)))))
     ('build-system 'haskell-build-system)
-    ('inputs
-     ('quasiquote
-      (("ghc-http" ('unquote 'ghc-http)))))
+    ('inputs ('list 'ghc-http))
     ('home-page "http://test.org")
     ('synopsis (? string?))
     ('description (? string?))
@@ -223,13 +222,8 @@ library
         ('base32
          (? string? hash)))))
     ('build-system 'haskell-build-system)
-    ('inputs
-     ('quasiquote
-      (("ghc-b" ('unquote 'ghc-b))
-       ("ghc-http" ('unquote 'ghc-http)))))
-    ('native-inputs
-     ('quasiquote
-      (("ghc-haskell-gi" ('unquote 'ghc-haskell-gi)))))
+    ('inputs ('list 'ghc-b 'ghc-http))
+    ('native-inputs ('list 'ghc-haskell-gi))
     ('home-page "http://test.org")
     ('synopsis (? string?))
     ('description (? string?))
@@ -353,9 +347,7 @@ executable cabal
         ('base32
          (? string? hash)))))
     ('build-system 'haskell-build-system)
-    ('inputs
-     ('quasiquote
-      (("ghc-http" ('unquote 'ghc-http)))))
+    ('inputs ('list 'ghc-http))
     ('arguments
      ('quasiquote
       ('#:cabal-revision
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#49566: [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: Emit new-style package inputs.
  2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 4/4] import: hackage: " Sarah Morgensen via Guix-patches via
@ 2021-07-20 21:34   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2021-07-20 21:34 UTC (permalink / raw)
  To: Sarah Morgensen; +Cc: 49566-done

[-- Attachment #1: Type: text/plain, Size: 146 bytes --]

Applied the whole series.

There was another test needing adjustment (see below) so I added it to
the last patch.

Thank you!

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 472 bytes --]

diff --git a/tests/hackage.scm b/tests/hackage.scm
index dcf9902c97..073e35ad05 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -411,9 +411,7 @@ executable cabal
         ('base32
          (? string? hash)))))
     ('build-system 'haskell-build-system)
-    ('inputs
-     ('quasiquote
-      (("ghc-http" ('unquote 'ghc-http)))))
+    ('inputs ('list 'ghc-http))
     ('home-page "http://test.org")
     ('synopsis (? string?))
     ('description (? string?))

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-20 21:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15  1:28 [bug#49566] [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: Emit new-style package inputs Sarah Morgensen via Guix-patches via
2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 1/4] import: egg: " Sarah Morgensen via Guix-patches via
2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 2/4] import: gem: " Sarah Morgensen via Guix-patches via
2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 3/4] import: opam: " Sarah Morgensen via Guix-patches via
2021-07-15  1:40 ` [bug#49566] [PATCH core-updates 4/4] import: hackage: " Sarah Morgensen via Guix-patches via
2021-07-20 21:34   ` bug#49566: [PATCH core-updates 0/4] import: {egg, gem, opam, hackage}: " Ludovic Courtès

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).