From 81a87222a1c26fca9fd642213129184ea0fb5185 Mon Sep 17 00:00:00 2001 From: Sarah Morgensen Date: Wed, 14 Jul 2021 18:40:37 -0700 Subject: [PATCH] import: hackage: Emit new-style package inputs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- guix/import/hackage.scm | 11 +++++------ tests/hackage.scm | 22 ++++++---------------- 2 files changed, 11 insertions(+), 22 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 ;;; Copyright © 2019 Robert Vollmert ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; 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 53972fc643..073e35ad05 100644 --- a/tests/hackage.scm +++ b/tests/hackage.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2015 Federico Beffa ;;; Copyright © 2019 Robert Vollmert ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; 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 @@ -419,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?))