[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#51838] [PATCH v5 05/45] guix: node-build-system: Add delete-lockfil
From: |
Philip McGrath |
Subject: |
[bug#51838] [PATCH v5 05/45] guix: node-build-system: Add delete-lockfiles phase. |
Date: |
Thu, 16 Dec 2021 21:02:45 -0500 |
* guix/build/node-build-system.scm (delete-lockfiles): New function.
Remove 'package-lock.json', 'yarn.lock', and 'npm-shrinkwrap.json',
if they exist. Because these files specify both exact dependency
versions and integrity hashes, they only cause problems for Guix.
(%standard-phases): Add 'delete-lockfiles' after 'patch-dependencies'.
---
guix/build/node-build-system.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm
index 70a367618e..dcaa719f40 100644
--- a/guix/build/node-build-system.scm
+++ b/guix/build/node-build-system.scm
@@ -96,6 +96,17 @@ (define (resolve-dependencies package-meta meta-key)
(write-json package-meta out))))
#t)
+(define* (delete-lockfiles #:key inputs #:allow-other-keys)
+ "Delete 'package-lock.json', 'yarn.lock', and 'npm-shrinkwrap.json', if they
+exist."
+ (for-each (lambda (pth)
+ (when (file-exists? pth)
+ (delete-file pth)))
+ '("package-lock.json"
+ "yarn.lock"
+ "npm-shrinkwrap.json"))
+ #t)
+
(define* (configure #:key outputs inputs #:allow-other-keys)
(let ((npm (string-append (assoc-ref inputs "node") "/bin/npm")))
(invoke npm "--offline" "--ignore-scripts" "install")
@@ -146,6 +157,7 @@ (define %standard-phases
(modify-phases gnu:%standard-phases
(add-after 'unpack 'set-home set-home)
(add-before 'configure 'patch-dependencies patch-dependencies)
+ (add-after 'patch-dependencies 'delete-lockfiles delete-lockfiles)
(replace 'configure configure)
(replace 'build build)
(replace 'check check)
--
2.32.0
- [bug#51838] [PATCH v4 39/45] gnu: Add node-serialport-parser-regex., (continued)
- [bug#51838] [PATCH v4 39/45] gnu: Add node-serialport-parser-regex., Philip McGrath, 2021/12/13
- [bug#51838] [PATCH v4 41/45] gnu: Add node-serialport-parser-inter-byte-timeout., Philip McGrath, 2021/12/13
- [bug#51838] [PATCH v4 40/45] gnu: Add node-serialport-parser-ready., Philip McGrath, 2021/12/13
- [bug#51838] [PATCH v4 43/45] gnu: Add node-serialport-parser-byte-length., Philip McGrath, 2021/12/13
- [bug#51838] [PATCH v4 45/45] gnu: Add node-serialport., Philip McGrath, 2021/12/13
- [bug#51838] [PATCH v4 42/45] gnu: Add node-serialport-parser-cctalk., Philip McGrath, 2021/12/13
- [bug#51838] [PATCH v4 44/45] gnu: Add node-serialport-stream., Philip McGrath, 2021/12/13
- [bug#51838] [PATCH v5 00/45] guix: node-build-system: Support compiling add-ons with node-gyp., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 01/45] gnu: node: Avoid duplicating build phases., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 02/45] gnu: node: Update to 10.24.1 for bootstrapping., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 05/45] guix: node-build-system: Add delete-lockfiles phase.,
Philip McGrath <=
- [bug#51838] [PATCH v5 03/45] gnu: node: Patch shebangs in node_modules., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 11/45] gnu: node-debug-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 04/45] gnu: node: Add an npmrc file to set nodedir., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 10/45] gnu: node-binary-search-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 06/45] guix: node-build-system: Refactor patch-dependencies phase., Philip McGrath, 2021/12/16
- [bug#51838] [PATCH v5 06/45] guix: node-build-system: Refactor patch-dependencies phase., Liliana Marie Prikler, 2021/12/16
- [bug#51838] [PATCH v5 06/45] guix: node-build-system: Refactor patch-dependencies phase., Philip McGrath, 2021/12/18
- [bug#51838] [PATCH v5 06/45] guix: node-build-system: Refactor patch-dependencies phase., Liliana Marie Prikler, 2021/12/18
- [bug#51838] [PATCH v5 06/45] guix: node-build-system: Refactor patch-dependencies phase., Timothy Sample, 2021/12/18
- [bug#51838] [PATCH v5 06/45] guix: node-build-system: Refactor patch-dependencies phase., Philip McGrath, 2021/12/20