import: hackage: Emit new-style package inputs.

* 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)
(match-ghc-foo-import): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Sarah Morgensen 2021-07-14 18:40:37 -07:00 committed by Ludovic Courtès
parent 3d5a36c457
commit 81a87222a1
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 11 additions and 22 deletions

View file

@ -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 @@ (define hackage-native-dependencies
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 @@ (define (maybe-inputs input-type inputs)
'())
((inputs ...)
(list (list input-type
(list 'quasiquote inputs))))))
`(list ,@inputs))))))
(define (maybe-arguments)
(match (append (if (not include-test-dependencies?)
'(#:tests? #f)

View file

@ -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 @@ (define-package-matcher match-ghc-foo
('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 @@ (define-package-matcher match-ghc-foo-6
('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 @@ (define-package-matcher match-ghc-foo-revision
('base32
(? string? hash)))))
('build-system 'haskell-build-system)
('inputs
('quasiquote
(("ghc-http" ('unquote 'ghc-http)))))
('inputs ('list 'ghc-http))
('arguments
('quasiquote
('#:cabal-revision
@ -419,9 +411,7 @@ (define-package-matcher match-ghc-foo-import
('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?))