GNU bug report logs - #77231
[PATCH javascript-team 0/6] Improve importer and build-system.

Previous Next

Package: guix-patches;

Reported by: Nicolas Graves <ngraves <at> ngraves.fr>

Date: Mon, 24 Mar 2025 07:21:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 77231 <at> debbugs.gnu.org
Cc: jelle.licht <at> fsfe.org, Nicolas Graves <ngraves <at> ngraves.fr>
Subject: [bug#77231] [PATCH 6/6] import: npm-binary: Filter out npm-ignored-inputs.
Date: Mon, 24 Mar 2025 08:29:17 +0100
* guix/import/npm-binary.scm (npm-keep-input?): Add variable.
(npm-package->package-sexp): Use npm-keep-input? to filter out
unwanted inputs.
---
 guix/import/npm-binary.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/guix/import/npm-binary.scm b/guix/import/npm-binary.scm
index 01079c2814..fed063f55d 100644
--- a/guix/import/npm-binary.scm
+++ b/guix/import/npm-binary.scm
@@ -24,6 +24,7 @@ (define-module (guix import npm-binary)
   #:use-module (gcrypt hash)
   #:use-module (gnu packages)
   #:use-module (guix base32)
+  #:use-module ((guix build node-build-system) #:select (npm-ignored-inputs))
   #:use-module (guix http-client)
   #:use-module (guix import json)
   #:use-module (guix import utils)
@@ -201,6 +202,16 @@ (define (package-revision->symbol package)
          (name (npm-name->name npm-name)))
     (name+version->symbol name version)))
 
+(define (npm-keep-input? input)
+  "If INPUT is not among `npm-ignored-inputs', return it.  Else return #f."
+  (match npm-ignored-inputs
+    (((ignored ...) (prefixes ...) . ())
+     (let ((name (versioned-package-name input)))
+       (and (not (or (member name ignored)
+                     (any (cut string-prefix? <> name) prefixes)))
+            input)))
+    (_ #f)))
+
 (define (npm-package->package-sexp npm-package)
   "Return the `package' s-expression for an NPM-PACKAGE."
   (define resolve-spec
@@ -218,6 +229,9 @@ (define resolve-spec
                            home-page
                            (string-append %default-page "/" (uri-encode name))))
             (synopsis description)
+            (dependencies (filter-map npm-keep-input? dependencies))
+            (dev-dependencies (filter-map npm-keep-input? dev-dependencies))
+            (peer-dependencies (filter-map npm-keep-input? peer-dependencies))
             (resolved-deps (map resolve-spec
                                 (append dependencies peer-dependencies)))
             (peer-names (map versioned-package-name peer-dependencies))
-- 
2.48.1





This bug report was last modified 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.