[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#70923] [PATCH v3 10/11] import: egg: Use maybe-*inputs procedures.
From: |
Herman Rimm |
Subject: |
[bug#70923] [PATCH v3 10/11] import: egg: Use maybe-*inputs procedures. |
Date: |
Tue, 24 Sep 2024 22:13:16 +0200 |
* guix/import/egg.scm (maybe-inputs): Delete procedure.
(egg-parse-dependency): Simplify procedure to return strings.
(egg->guix-package): Use maybe-*inputs procedures.
Change-Id: Ib0a3f5b6f02912c847defd02ba7675d80005279b
---
guix/import/egg.scm | 39 +++++++++++----------------------------
1 file changed, 11 insertions(+), 28 deletions(-)
diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index e3bc158475..97d09a7c9d 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -229,23 +230,14 @@ (define* (egg->guix-package name version #:key (file #f)
(source #f)
(else char)))
(maybe-symbol->string name)))
- (define* (egg-parse-dependency name #:key (system? #f))
- (define extract-name
- (match-lambda
- ((name version) name)
- (name name)))
-
- (define (prettify-name name)
+ (define* (egg-parse-dependency dependency #:key (system? #f))
+ (let ((name (match dependency
+ ((name version) name)
+ (name name))))
(if system?
(prettify-system-dependency name)
- (maybe-symbol->string name)))
-
- (let ((name (prettify-name (extract-name name))))
- ;; Dependencies are sometimes specified as symbols and sometimes
- ;; as strings
- (string->symbol (string-append
- (if system? "" package-name-prefix)
- name))))
+ (string-append package-name-prefix
+ (maybe-symbol->string name)))))
(define egg-propagated-inputs
(let ((dependencies (assoc-ref egg-content 'dependencies)))
@@ -277,15 +269,6 @@ (define* (egg->guix-package name version #:key (file #f)
(source #f)
test+build-dependencies))
(() '()))))
- ;; Copied from (guix import hackage).
- (define (maybe-inputs input-type inputs)
- (match inputs
- (()
- '())
- ((inputs ...)
- (list (list input-type
- `(list ,@inputs))))))
-
(values
`(package
(name ,(egg-name->guix-name name))
@@ -303,16 +286,16 @@ (define* (egg->guix-package name version #:key (file #f)
(source #f)
"failed to download tar archive"))))))
(build-system chicken-build-system)
(arguments ,(list 'quasiquote (list #:egg-name name)))
- ,@(maybe-inputs 'native-inputs egg-native-inputs)
- ,@(maybe-inputs 'inputs egg-inputs)
- ,@(maybe-inputs 'propagated-inputs egg-propagated-inputs)
+ ,@(maybe-native-inputs egg-native-inputs)
+ ,@(maybe-inputs egg-inputs)
+ ,@(maybe-propagated-inputs egg-propagated-inputs)
(home-page ,egg-home-page)
(synopsis ,egg-synopsis)
(description #f)
(license ,egg-licenses))
(filter (lambda (name)
(not (member name '("srfi-4"))))
- (map (compose guix-name->egg-name symbol->string)
+ (map guix-name->egg-name
(append egg-propagated-inputs
egg-native-inputs)))))))
--
2.45.2
- [bug#70923] [PATCH v3 00/11] Add (guix import utils) procedures., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 04/11] import: utils: Add 'maybe-upstream-inputs' procedure., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 01/11] build-system: cargo: Accept unlabeled #:cargo-inputs., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 03/11] import: crate: Emit new-style package inputs., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 10/11] import: egg: Use maybe-*inputs procedures.,
Herman Rimm <=
- [bug#70923] [PATCH v3 05/11] import: pypi: Use 'maybe-list-field' procedure., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 06/11] import: elpa: Use maybe-propagated-inputs procedure., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 11/11] import: hexpm: Use (guix import utils) 'maybe-inputs' procedure., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 07/11] import: hackage: Use 'maybe-list-field' procedure., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 08/11] import: cran: Use 'maybe-list-field' procedure., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 02/11] import: utils: Emit new-style package inputs., Herman Rimm, 2024/09/24
- [bug#70923] [PATCH v3 09/11] import: cpan: Use 'maybe-upstream-inputs' procedure., Herman Rimm, 2024/09/24