[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#70923] [PATCH v4 09/11] import: cpan: Use 'maybe-upstream-inputs' p
From: |
Herman Rimm |
Subject: |
[bug#70923] [PATCH v4 09/11] import: cpan: Use 'maybe-upstream-inputs' procedure. |
Date: |
Mon, 9 Dec 2024 20:58:13 +0100 |
* guix/import/cpan.scm (maybe-inputs): Delete procedure.
(cpan-module->sexp): Use 'maybe-upstream-inputs' procedure.
Change-Id: I4fa99da62d81f02c2998ad96f5ea81e27df071cd
---
guix/import/cpan.scm | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 85e5e69098..e26cc85491 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020, 2021, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -37,8 +38,9 @@ (define-module (guix import cpan)
#:use-module (guix utils)
#:use-module (guix base32)
#:use-module ((guix download) #:select (download-to-store url-fetch))
- #:use-module ((guix import utils)
- #:select (factorize-uri recursive-import))
+ #:use-module ((guix import utils) #:select (factorize-uri
+ maybe-upstream-inputs
+ recursive-import))
#:use-module (guix import json)
#:use-module (guix packages)
#:use-module (guix upstream)
@@ -277,15 +279,6 @@ (define (cpan-module->sexp release)
(define version (cpan-release-version release))
(define source-url (cpan-source-url release))
- (define (maybe-inputs input-type inputs)
- (match inputs
- (()
- '())
- ((inputs ...)
- `((,input-type (list ,@(map (compose string->symbol
- upstream-input-downstream-name)
- inputs)))))))
-
(let* ((tarball (with-store store
(download-to-store store source-url)))
(inputs (cpan-module-inputs release))
@@ -300,12 +293,10 @@ (define (cpan-module->sexp release)
(base32
,(bytevector->nix-base32-string (file-sha256
tarball))))))
(build-system perl-build-system)
- ,@(maybe-inputs 'native-inputs
- (filter (upstream-input-type-predicate 'native)
- inputs))
- ,@(maybe-inputs 'propagated-inputs
- (filter (upstream-input-type-predicate
'propagated)
- inputs))
+ ,@(maybe-upstream-inputs 'native-inputs
+ (filter (upstream-input-type-predicate 'native) inputs))
+ ,@(maybe-upstream-inputs 'propagated-inputs
+ (filter (upstream-input-type-predicate 'propagated) inputs))
(home-page ,(cpan-home name))
(synopsis ,(cpan-release-abstract release))
(description fill-in-yourself!)
--
2.45.2
- [bug#70923] [PATCH v4 02/11] import: utils: Emit new-style package inputs., (continued)
- [bug#70923] [PATCH v4 02/11] import: utils: Emit new-style package inputs., Herman Rimm, 2024/12/09
- [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 <=
- [bug#70923] [PATCH v4 05/11] import: pypi: Use 'maybe-list-field' procedure., Herman Rimm, 2024/12/09
- [bug#70923] [PATCH v4 01/11] build-system: cargo: Accept unlabeled #:cargo-inputs., Efraim Flashner, 2024/12/10