[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#51838] [PATCH v2 04/26] gnu: node: Add an npmrc file to set nodedir
From: |
Philip McGrath |
Subject: |
[bug#51838] [PATCH v2 04/26] gnu: node: Add an npmrc file to set nodedir. |
Date: |
Fri, 19 Nov 2021 23:33:44 -0500 |
* gnu/packages/node.scm (node, node-lis)[arguments]: Add a phase
'install-npmrc to create a "built-in" npmrc file that configures
"nodedir" to point to the output store path.
(libnode)[arguments]: Delete the 'install-npmrc phase.
---
gnu/packages/node.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index a57a74fb81..0f67fe79c2 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -250,7 +250,21 @@ (define-public node
(find-files (string-append prefix "/lib/node_modules")
(lambda (file stat)
(executable-file? file))
- #:stat lstat))))))))
+ #:stat lstat)))))
+ (add-after 'install 'install-npmrc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (with-output-to-file
+ ;; Use the config file "primarily for distribution
+ ;; maintainers" rather than "{prefix}/etc/npmrc",
+ ;; especially because node-build-system uses --prefix
+ ;; to install things to their store paths:
+ (string-append out "/lib/node_modules/npm/npmrc")
+ (lambda ()
+ ;; Tell npm (mostly node-gyp) where to find our
+ ;; installed headers so it doesn't try to
+ ;; download them from the internet:
+ (format #t "nodedir=~a\n" out)))))))))
(native-inputs
`(;; Runtime dependencies for binaries used as a bootstrap.
("c-ares" ,c-ares)
@@ -818,4 +832,5 @@ (define-public libnode
`(cons* "--shared" "--without-npm" ,flags))
((#:phases phases '%standard-phases)
`(modify-phases ,phases
+ (delete 'install-npmrc)
(delete 'patch-nested-shebangs)))))))
--
2.32.0
- [bug#51838] [PATCH v2 01/26] gnu: node: Avoid duplicating build phases., (continued)
- [bug#51838] [PATCH v2 03/26] gnu: node: Patch shebangs in node_modules., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 07/26] gnu: node-ms-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Liliana Marie Prikler, 2021/11/20
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Philip McGrath, 2021/11/20
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Liliana Marie Prikler, 2021/11/20
- [bug#51838] [PATCH 00/11] guix: node-build-system: Support compiling add-ons with node-gyp., Timothy Sample, 2021/11/28
- [bug#51838] [PATCH v2 04/26] gnu: node: Add an npmrc file to set nodedir.,
Philip McGrath <=
- [bug#51838] [PATCH v2 11/26] gnu: node-llparse-frontend-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 16/26] gnu: node-irc-colors: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 08/26] gnu: node-binary-search-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 02/26] gnu: node: Update to 10.24.1 for bootstrapping., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 09/26] gnu: node-debug-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 19/26] gnu: Add node-inherits., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 15/26] gnu: node-once: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 13/26] gnu: node-semver: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 10/26] gnu: node-llparse-builder-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 10/26] gnu: node-llparse-builder-bootstrap: Use #:absent-dependencies., Liliana Marie Prikler, 2021/11/20