Message ID | 20211213060107.129223-6-philip@philipmcgrath.com |
---|---|
State | Accepted |
Headers | show |
Series | guix: node-build-system: Support compiling add-ons with node-gyp. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
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)