[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#70923] [PATCH v4 05/11] import: pypi: Use 'maybe-list-field' proced
From: |
Herman Rimm |
Subject: |
[bug#70923] [PATCH v4 05/11] import: pypi: Use 'maybe-list-field' procedure. |
Date: |
Mon, 9 Dec 2024 20:58:09 +0100 |
* guix/import/pypi.scm (maybe-inputs): Delete procedure.
(make-pypi-sexp): Use 'maybe-list-field' and 'maybe-upstream-inputs'
procedures.
---
guix/import/pypi.scm | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 7b9f54a200..a98fdfa604 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -14,6 +14,7 @@
;;; Copyright © 2022 Vivien Kraus <vivien@planete-kraus.eu>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -201,18 +202,6 @@ (define (wheel-url->extracted-directory wheel-url)
((name version _ ...)
(string-append name "-" version ".dist-info"))))
-(define (maybe-inputs package-inputs input-type)
- "Given a list of PACKAGE-INPUTS, tries to generate the 'inputs' field of a
-package definition. INPUT-TYPE, a symbol, is used to populate the name of
-the input field."
- (match package-inputs
- (()
- '())
- ((package-inputs ...)
- `((,input-type (list ,@(map (compose string->symbol
- upstream-input-downstream-name)
- package-inputs)))))))
-
(define %requirement-name-regexp
;; Regexp to match the requirement name in a requirement specification.
@@ -538,10 +527,10 @@ (define* (make-pypi-sexp pypi-package
bytevector->nix-base32-string)))))
,@(maybe-upstream-name name)
(build-system pyproject-build-system)
- ,@(maybe-inputs (upstream-source-propagated-inputs source)
- 'propagated-inputs)
- ,@(maybe-inputs (upstream-source-native-inputs source)
- 'native-inputs)
+ ,@(maybe-upstream-inputs 'propagated-inputs
+ (upstream-source-propagated-inputs source))
+ ,@(maybe-upstream-inputs 'native-inputs
+ (upstream-source-native-inputs source))
(home-page ,(project-info-home-page info))
(synopsis ,(project-info-summary info))
(description ,(and=> (non-empty-string-or-false
--
2.45.2
- [bug#70923] [PATCH v4 03/11] import: crate: Emit new-style package inputs., (continued)
- [bug#70923] [PATCH v4 03/11] import: crate: Emit new-style package inputs., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 04/11] import: utils: Add 'maybe-upstream-inputs' procedure., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 07/11] import: hackage: Use 'maybe-list-field' procedure., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 06/11] import: elpa: Use maybe-propagated-inputs procedure., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 08/11] import: cran: Use 'maybe-list-field' procedure., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 10/11] import: egg: Use maybe-*inputs procedures., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 11/11] import: hexpm: Use (guix import utils) 'maybe-inputs' procedure., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 09/11] import: cpan: Use 'maybe-upstream-inputs' procedure., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 05/11] import: pypi: Use 'maybe-list-field' procedure.,
Herman Rimm <=
- [bug#70923] [PATCH v4 01/11] build-system: cargo: Accept unlabeled #:cargo-inputs., Efraim Flashner, 2024/12/10