1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
5 ;;; Copyright © 2016, 2021 Ludovic Courtès <ludo@gnu.org>
6 ;;; Copyright © 2017 Mike Gerwitz <mtg@gnu.org>
7 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
9 ;;; Copyright © 2020, 2021 Pierre Langlois <pierre.langlois@gmx.com>
10 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
12 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages node)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module ((guix build utils) #:select (alist-replace))
32 #:use-module (guix packages)
33 #:use-module (guix derivations)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix utils)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system node)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages adns)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages gcc)
45 #:use-module (gnu packages icu4c)
46 #:use-module (gnu packages libevent)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages node-xyz)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages web)
54 #:use-module (ice-9 match)
55 #:use-module (srfi srfi-26))
63 (uri (string-append "https://nodejs.org/dist/v" version
64 "/node-v" version ".tar.xz"))
67 "1k1srdis23782hnd1ymgczs78x9gqhv77v0am7yb54gqcspp70hm"))
68 (modules '((guix build utils)))
71 ;; Patch for compatibility with ICU 68 and newer, which
72 ;; removed the public TRUE and FALSE macros.
73 (substitute* '("deps/v8/src/objects/intl-objects.cc"
74 "deps/v8/src/runtime/runtime-intl.cc")
78 ;; Remove bundled software.
79 (for-each delete-file-recursively
87 (substitute* "Makefile"
88 ;; Remove references to bundled software.
89 (("deps/http_parser/http_parser.gyp") "")
90 (("deps/uv/include/\\*.h") "")
91 (("deps/uv/uv.gyp") "")
92 (("deps/zlib/zlib.gyp") ""))
94 (build-system gnu-build-system)
96 `(#:configure-flags '("--shared-cares"
97 "--shared-http-parser"
103 "--with-intl=system-icu")
104 ;; Run only the CI tests. The default test target requires additional
105 ;; add-ons from NPM that are not distributed with the source.
106 #:test-target "test-ci-js"
108 (modify-phases %standard-phases
109 (add-before 'configure 'patch-files
110 (lambda* (#:key inputs #:allow-other-keys)
111 ;; Fix hardcoded /bin/sh references.
112 (substitute* '("lib/child_process.js"
113 "lib/internal/v8_prof_polyfill.js"
114 "test/parallel/test-child-process-spawnsync-shell.js"
115 "test/parallel/test-stdio-closed.js"
116 "test/sequential/test-child-process-emfile.js")
118 (string-append "'" (assoc-ref inputs "bash") "/bin/sh'")))
120 ;; Fix hardcoded /usr/bin/env references.
121 (substitute* '("test/parallel/test-child-process-default-options.js"
122 "test/parallel/test-child-process-env.js"
123 "test/parallel/test-child-process-exec-env.js")
125 (string-append "'" (assoc-ref inputs "coreutils")
128 ;; FIXME: These tests fail in the build container, but they don't
129 ;; seem to be indicative of real problems in practice.
130 (for-each delete-file
131 '("test/parallel/test-cluster-master-error.js"
132 "test/parallel/test-cluster-master-kill.js"
133 ;; See also <https://github.com/nodejs/node/issues/25903>.
134 "test/sequential/test-performance.js"))
136 ;; This requires a DNS resolver.
137 (delete-file "test/parallel/test-dns.js")
139 ;; FIXME: This test fails randomly:
140 ;; https://github.com/nodejs/node/issues/31213
141 (delete-file "test/parallel/test-net-listen-after-destroying-stdin.js")
143 ;; FIXME: These tests fail on armhf-linux:
144 ;; https://github.com/nodejs/node/issues/31970
145 ,@(if (string-prefix? "arm" (%current-system))
146 '((for-each delete-file
147 '("test/parallel/test-zlib.js"
148 "test/parallel/test-zlib-brotli.js"
149 "test/parallel/test-zlib-brotli-flush.js"
150 "test/parallel/test-zlib-brotli-from-brotli.js"
151 "test/parallel/test-zlib-brotli-from-string.js"
152 "test/parallel/test-zlib-convenience-methods.js"
153 "test/parallel/test-zlib-random-byte-pipes.js"
154 "test/parallel/test-zlib-write-after-flush.js")))
157 ;; These tests have an expiry date: they depend on the validity of
158 ;; TLS certificates that are bundled with the source. We want this
159 ;; package to be reproducible forever, so remove those.
160 ;; TODO: Regenerate certs instead.
161 (for-each delete-file
162 '("test/parallel/test-tls-passphrase.js"
163 "test/parallel/test-tls-server-verify.js"))))
164 (add-before 'configure 'set-bootstrap-host-rpath
165 (lambda* (#:key native-inputs inputs #:allow-other-keys)
166 (let* ((inputs (or native-inputs inputs))
167 (c-ares (assoc-ref inputs "c-ares"))
168 (http-parser (assoc-ref inputs "http-parser"))
169 (icu4c (assoc-ref inputs "icu4c"))
170 (nghttp2 (assoc-ref inputs "nghttp2"))
171 (openssl (assoc-ref inputs "openssl"))
172 (libuv (assoc-ref inputs "libuv"))
173 (zlib (assoc-ref inputs "zlib")))
174 (substitute* "deps/v8/gypfiles/v8.gyp"
175 (("'target_name': 'torque'," target)
176 (string-append target
177 "'ldflags': ['-Wl,-rpath="
187 ;; Node's configure script is actually a python script, so we can't
189 (lambda* (#:key outputs (configure-flags '()) native-inputs inputs
191 (let* ((prefix (assoc-ref outputs "out"))
192 (xflags ,(if (%current-target-system)
193 `'("--cross-compiling"
196 (match (%current-target-system)
197 ((? (cut string-prefix? "arm" <>))
199 ((? (cut string-prefix? "aarch64" <>))
201 ((? (cut string-prefix? "i686" <>))
203 ((? (cut string-prefix? "x86_64" <>))
205 ((? (cut string-prefix? "powerpc64" <>))
209 (flags (cons (string-append "--prefix=" prefix)
210 (append xflags configure-flags))))
211 (format #t "build directory: ~s~%" (getcwd))
212 (format #t "configure flags: ~s~%" flags)
213 ;; Node's configure script expects the CC environment variable to
215 (setenv "CC_host" "gcc")
216 (setenv "CXX_host" "g++")
217 (setenv "CC" ,(cc-for-target))
218 (setenv "CXX" ,(cxx-for-target))
219 (setenv "PKG_CONFIG" ,(pkg-config-for-target))
221 (search-input-file (or native-inputs inputs)
223 "configure" flags))))
224 (add-after 'patch-shebangs 'patch-npm-shebang
225 (lambda* (#:key outputs #:allow-other-keys)
226 (let* ((bindir (string-append (assoc-ref outputs "out")
228 (npm (string-append bindir "/npm"))
229 (target (readlink npm)))
230 (with-directory-excursion bindir
231 (patch-shebang target (list bindir))))))
232 (add-after 'install 'patch-node-shebang
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let* ((bindir (string-append (assoc-ref outputs "out")
236 (npx (readlink (string-append bindir "/npx"))))
237 (with-directory-excursion bindir
238 (patch-shebang npx (list bindir)))))))))
240 `(;; Runtime dependencies for binaries used as a bootstrap.
242 ("http-parser" ,http-parser)
245 ("nghttp2" ,nghttp2 "lib")
248 ;; Regular build-time dependencies.
250 ("pkg-config" ,pkg-config)
253 ("util-linux" ,util-linux)))
255 (list (search-path-specification
256 (variable "NODE_PATH")
257 (files '("lib/node_modules")))))
260 ("coreutils" ,coreutils)
262 ("http-parser" ,http-parser)
265 ("nghttp2" ,nghttp2 "lib")
268 (synopsis "Evented I/O for V8 JavaScript")
269 (description "Node.js is a platform built on Chrome's JavaScript runtime
270 for easily building fast, scalable network applications. Node.js uses an
271 event-driven, non-blocking I/O model that makes it lightweight and efficient,
272 perfect for data-intensive real-time applications that run across distributed
274 (home-page "https://nodejs.org/")
275 (license license:expat)
276 (properties '((max-silent-time . 7200) ;2h, needed on ARM
277 (timeout . 21600) ;6h
278 (cpe-name . "node.js")))))
280 ;; This should be the latest version of node that still builds without
281 ;; depending on llhttp.
282 (define-public node-bootstrap
283 (hidden-package node))
285 ;; Duplicate of node-semver
286 (define-public node-semver-bootstrap
293 (url "https://github.com/npm/node-semver")
294 (commit (string-append "v" version))))
295 (file-name (git-file-name name version))
298 "06biknqb05r9xsmcflm3ygh50pjvdk84x6r79w43kmck4fn3qn5p"))))
299 (build-system node-build-system)
301 `(#:node ,node-bootstrap
304 (modify-phases %standard-phases
305 (delete 'configure))))
306 (home-page "https://github.com/npm/node-semver")
307 (properties '((hidden? . #t)))
308 (synopsis "Parses semantic versions strings")
310 "@code{node-semver} is a JavaScript implementation of the
311 @uref{https://semver.org/, SemVer.org} specification.")
312 (license license:isc)))
314 (define-public node-ms-bootstrap
322 (url "https://github.com/vercel/ms.git")
324 (file-name (git-file-name name version))
327 "1pjxzbi4j8pinlsc7yxvfrh0b47kb2dc4lfc2rjq4wx5bdwl33fj"))))
328 (build-system node-build-system)
330 `(#:node ,node-bootstrap
333 (modify-phases %standard-phases
334 (delete 'configure))))
335 (home-page "https://github.com/zeit/ms#readme")
336 (properties '((hidden? . #t)))
337 (synopsis "Tiny millisecond conversion utility")
338 (description "Use this package to easily convert various time
339 formats to milliseconds.")
340 (license license:expat)))
342 (define-public node-binary-search-bootstrap
344 (name "node-binary-search")
350 (url "https://github.com/darkskyapp/binary-search.git")
351 (commit (string-append "v" version))))
352 (file-name (git-file-name name version))
355 "1xr2msdc143cd3xwgq7n3rhzy7j8wrnaidxl0r6l6b6g3mpbpjig"))))
356 (build-system node-build-system)
358 `(#:node ,node-bootstrap
361 (modify-phases %standard-phases
362 (delete 'configure))))
363 (home-page "https://github.com/darkskyapp/binary-search#readme")
364 (properties '((hidden? . #t)))
365 (synopsis "Tiny binary search function with comparators")
366 (description "This package is a binary search function for Node.js.")
367 (license license:cc0)))
369 (define-public node-debug-bootstrap
377 (url "https://github.com/visionmedia/debug.git")
379 (file-name (git-file-name name version))
382 "08g52r1d4yqcsfdfb7n5if33d4cghaq75gx5n9hj6m6fd8jfp2pi"))))
383 (build-system node-build-system)
385 `(#:node ,node-bootstrap
388 (modify-phases %standard-phases
389 (delete 'configure))))
390 (inputs `(("node-ms" ,node-ms-bootstrap)))
391 (home-page "https://github.com/visionmedia/debug#readme")
392 (properties '((hidden? . #t)))
393 (synopsis "Small debugging utility")
394 (description "This package contains a tiny JavaScript debugging
395 utility modelled after Node.js core's debugging technique. It works in
396 Node.js and web browsers.")
397 (license license:expat)))
399 (define-public node-llparse-builder-bootstrap
401 (name "node-llparse-builder")
407 (url "https://github.com/indutny/llparse-builder.git")
408 (commit (string-append "v" version))))
409 (file-name (git-file-name name version))
412 "0r82iiwqsb73k2fxw7842rjjiixllxpyc6yl9cq4ma6ybkf6xmzm"))
413 (modules '((guix build utils)))
416 ;; FIXME: Unneeded runtime dependency.
417 ;; https://github.com/indutny/llparse-builder/pull/2
418 (substitute* "package.json"
419 (("\"@types/debug.*,") ""))
420 ;; Fix imports for esbuild.
421 ;; https://github.com/evanw/esbuild/issues/477
422 (substitute* '("src/node/invoke.ts"
424 "src/node/consume.ts"
430 "src/loop-checker/index.ts"
431 "src/loop-checker/lattice.ts"
433 "src/span-allocator.ts")
434 (("\\* as assert") "assert")
435 (("\\* as debugAPI") "debugAPI"))
437 (build-system node-build-system)
439 `(#:node ,node-bootstrap
442 (modify-phases %standard-phases
445 (lambda* (#:key inputs #:allow-other-keys)
446 (let ((esbuild (search-input-file inputs "/bin/esbuild")))
449 "--outfile=lib/builder.js"
451 "src/builder.ts")))))))
453 `(("node-binary-search" ,node-binary-search-bootstrap)
454 ("node-debug" ,node-debug-bootstrap)))
456 `(("esbuild" ,esbuild)))
457 (home-page "https://github.com/indutny/llparse-builder#readme")
458 (properties '((hidden? . #t)))
459 (synopsis "Graph builder for consumption by llparse")
460 (description "This package builds graphs for consumption by llparse.")
461 (license license:expat)))
463 (define-public node-llparse-frontend-bootstrap
465 (name "node-llparse-frontend")
471 (url "https://github.com/indutny/llparse-frontend.git")
472 (commit (string-append "v" version))))
473 (file-name (git-file-name name version))
475 (base32 "1rm9g4ifyip30svm5cgnf0gx7d45jgh4mpf2hkd092xhngmfvicc"))
476 (modules '((guix build utils)))
479 ;; Fix imports for esbuild.
480 ;; https://github.com/evanw/esbuild/issues/477
481 (substitute* '("src/frontend.ts"
482 "src/code/field-value.ts"
483 "src/container/index.ts"
484 "src/container/wrap.ts"
485 "src/node/sequence.ts"
487 "src/node/table-lookup.ts"
489 (("\\* as assert") "assert")
490 (("\\* as debugAPI") "debugAPI"))
492 (build-system node-build-system)
494 `(#:node ,node-bootstrap
497 (modify-phases %standard-phases
500 (lambda* (#:key inputs #:allow-other-keys)
501 (let ((esbuild (search-input-file inputs "/bin/esbuild")))
504 "--outfile=lib/frontend.js"
506 "src/frontend.ts")))))))
508 `(("node-debug" ,node-debug-bootstrap)
509 ("node-llparse-builder" ,node-llparse-builder-bootstrap)))
511 `(("esbuild" ,esbuild)))
512 (home-page "https://github.com/indutny/llparse-frontend#readme")
513 (properties '((hidden? . #t)))
514 (synopsis "Frontend for the llparse compiler")
515 (description "This package is a frontend for the llparse compiler.")
516 (license license:expat)))
518 (define-public node-llparse-bootstrap
520 (name "node-llparse")
526 (url "https://github.com/indutny/llparse.git")
527 (commit (string-append "v" version))))
528 (file-name (git-file-name name version))
531 "10da273iy2if88hp79cwms6c8qpsl1fkgzll6gmqyx5yxv5mkyp6"))
532 (modules '((guix build utils)))
535 ;; Fix imports for esbuild.
536 ;; https://github.com/evanw/esbuild/issues/477
537 (substitute* '("src/compiler/index.ts"
538 "src/implementation/c/node/base.ts"
539 "src/implementation/c/node/table-lookup.ts"
540 "src/implementation/c/compilation.ts"
541 "src/implementation/c/helpers/match-sequence.ts"
542 "src/implementation/c/code/mul-add.ts")
543 (("\\* as assert") "assert")
544 (("\\* as debugAPI") "debugAPI"))
546 (build-system node-build-system)
548 `(#:node ,node-bootstrap
551 (modify-phases %standard-phases
554 (lambda* (#:key inputs #:allow-other-keys)
555 (let ((esbuild (search-input-file inputs "/bin/esbuild")))
558 "--outfile=lib/api.js"
562 `(("node-debug" ,node-debug-bootstrap)
563 ("node-llparse-frontend" ,node-llparse-frontend-bootstrap)))
565 `(("esbuild" ,esbuild)))
566 (home-page "https://github.com/nodejs/llparse#readme")
567 (properties '((hidden? . #t)))
568 (synopsis "Compile incremental parsers to C code")
569 (description "This package offers an API for compiling an incremental
570 parser definition into a C output.")
571 (license license:expat)))
573 (define-public llhttp-bootstrap
580 (url "https://github.com/nodejs/llhttp.git")
581 (commit (string-append "v" version))))
582 (file-name (git-file-name name version))
585 "115mwyds9655p76lhglxg2blc1ksgrix6zhigaxnc2q6syy3pa6x"))
586 (patches (search-patches "llhttp-bootstrap-CVE-2020-8287.patch"))
587 (modules '((guix build utils)))
590 ;; Fix imports for esbuild.
591 ;; https://github.com/evanw/esbuild/issues/477
592 (substitute* "src/llhttp/http.ts"
593 (("\\* as assert") "assert"))
594 (substitute* "Makefile"
595 (("npx ts-node bin/generate.ts")
596 "node bin/generate.js"))
598 (build-system gnu-build-system)
600 `(#:tests? #f ; no tests
601 #:make-flags (list (string-append "CLANG=" ,(cc-for-target))
602 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
605 (modify-phases %standard-phases
607 (lambda* (#:key inputs native-inputs #:allow-other-keys)
608 (let ((esbuild (search-input-file (or native-inputs inputs)
612 "--outfile=bin/generate.js"
613 "--bundle" "bin/generate.ts"))))
614 (add-before 'install 'create-install-directories
615 (lambda* (#:key outputs #:allow-other-keys)
616 (let ((out (assoc-ref outputs "out")))
617 (for-each (lambda (dir)
618 (mkdir-p (string-append out dir)))
619 (list "/lib" "/include" "/src"))
621 (add-after 'install 'install-src
622 (lambda* (#:key outputs #:allow-other-keys)
623 (let* ((out (assoc-ref outputs "out"))
624 (src-dir (string-append out "/src")))
625 (install-file "build/c/llhttp.c" src-dir)
626 (install-file "src/native/api.c" src-dir)
627 (install-file "src/native/http.c" src-dir)
630 `(("esbuild" ,esbuild)
631 ("node" ,node-bootstrap)
632 ("node-semver" ,node-semver-bootstrap)
633 ("node-llparse-bootstrap" ,node-llparse-bootstrap)))
634 (home-page "https://github.com/nodejs/llhttp")
635 (properties '((hidden? . #t)))
636 (synopsis "Parser for HTTP messages")
637 (description "This is a rewrite of
638 @url{https://github.com/nodejs/http-parser, http-parser} using
639 @url{https://github.com/nodejs/llparse, llparse} to generate the C
641 (license license:expat)))
643 (define-public node-lts
649 (uri (string-append "https://nodejs.org/dist/v" version
650 "/node-v" version ".tar.xz"))
653 "1vc9rypkgr5i5y946jnyr9jjpydxvm74p1s17rg2zayzvlddg89z"))
654 (modules '((guix build utils)))
657 ;; Remove bundled software, where possible
658 (for-each delete-file-recursively
664 (substitute* "Makefile"
665 ;; Remove references to bundled software.
666 (("deps/uv/uv.gyp") "")
667 (("deps/zlib/zlib.gyp") ""))
670 (substitute-keyword-arguments (package-arguments node)
671 ((#:configure-flags configure-flags)
678 "--with-intl=system-icu"))
680 `(modify-phases ,phases
681 (replace 'set-bootstrap-host-rpath
682 (lambda* (#:key native-inputs inputs #:allow-other-keys)
683 (let* ((inputs (or native-inputs inputs))
684 (c-ares (assoc-ref inputs "c-ares"))
685 (brotli (assoc-ref inputs "brotli"))
686 (icu4c (assoc-ref inputs "icu4c"))
687 (nghttp2 (assoc-ref inputs "nghttp2"))
688 (openssl (assoc-ref inputs "openssl"))
689 (libuv (assoc-ref inputs "libuv"))
690 (zlib (assoc-ref inputs "zlib"))
691 (host-binaries '("torque"
692 "bytecode_builtins_list_generator"
693 "gen-regexp-special-case"
696 (substitute* '("node.gyp" "tools/v8_gypfiles/v8.gyp")
697 (((string-append "'target_name': '("
698 (string-join host-binaries "|")
701 (string-append target
702 "'ldflags': ['-Wl,-rpath="
712 ;; Node's configure script is actually a python script, so we can't
714 (lambda* (#:key outputs (configure-flags '()) native-inputs inputs
716 (let* ((prefix (assoc-ref outputs "out"))
717 (xflags ,(if (%current-target-system)
718 `'("--cross-compiling"
721 (match (%current-target-system)
722 ((? (cut string-prefix? "arm" <>))
724 ((? (cut string-prefix? "aarch64" <>))
726 ((? (cut string-prefix? "i686" <>))
728 ((? (cut string-prefix? "x86_64" <>))
730 ((? (cut string-prefix? "powerpc64" <>))
735 (string-append "--prefix=" prefix)
736 (append xflags configure-flags))))
737 (format #t "build directory: ~s~%" (getcwd))
738 (format #t "configure flags: ~s~%" flags)
739 ;; Node's configure script expects the CC environment variable to
741 (setenv "CC_host" "gcc")
742 (setenv "CXX_host" "g++")
743 (setenv "CC" ,(cc-for-target))
744 (setenv "CXX" ,(cxx-for-target))
745 (setenv "PKG_CONFIG" ,(pkg-config-for-target))
747 (search-input-file (or native-inputs inputs)
749 "configure" flags))))
750 (replace 'patch-files
751 (lambda* (#:key inputs #:allow-other-keys)
752 ;; Fix hardcoded /bin/sh references.
753 (substitute* '("lib/child_process.js"
754 "lib/internal/v8_prof_polyfill.js"
755 "test/parallel/test-child-process-spawnsync-shell.js"
756 "test/parallel/test-fs-write-sigxfsz.js"
757 "test/parallel/test-stdio-closed.js"
758 "test/sequential/test-child-process-emfile.js")
760 (string-append "'" (assoc-ref inputs "bash") "/bin/sh'")))
762 ;; Fix hardcoded /usr/bin/env references.
763 (substitute* '("test/parallel/test-child-process-default-options.js"
764 "test/parallel/test-child-process-env.js"
765 "test/parallel/test-child-process-exec-env.js")
767 (string-append "'" (assoc-ref inputs "coreutils")
770 ;; FIXME: These tests fail in the build container, but they don't
771 ;; seem to be indicative of real problems in practice.
772 (for-each delete-file
773 '("test/parallel/test-cluster-master-error.js"
774 "test/parallel/test-cluster-master-kill.js"))
776 ;; These require a DNS resolver.
777 (for-each delete-file
778 '("test/parallel/test-dns.js"
779 "test/parallel/test-dns-lookupService-promises.js"))
781 ;; These tests require networking.
782 (delete-file "test/parallel/test-https-agent-unref-socket.js")
784 ;; FIXME: This test fails randomly:
785 ;; https://github.com/nodejs/node/issues/31213
786 (delete-file "test/parallel/test-net-listen-after-destroying-stdin.js")
788 ;; FIXME: These tests fail on armhf-linux:
789 ;; https://github.com/nodejs/node/issues/31970
790 ,@(if (target-arm32?)
791 '((for-each delete-file
792 '("test/parallel/test-zlib.js"
793 "test/parallel/test-zlib-brotli.js"
794 "test/parallel/test-zlib-brotli-flush.js"
795 "test/parallel/test-zlib-brotli-from-brotli.js"
796 "test/parallel/test-zlib-brotli-from-string.js"
797 "test/parallel/test-zlib-convenience-methods.js"
798 "test/parallel/test-zlib-random-byte-pipes.js"
799 "test/parallel/test-zlib-write-after-flush.js")))
802 ;; These tests have an expiry date: they depend on the validity of
803 ;; TLS certificates that are bundled with the source. We want this
804 ;; package to be reproducible forever, so remove those.
805 ;; TODO: Regenerate certs instead.
806 (for-each delete-file
807 '("test/parallel/test-tls-passphrase.js"
808 "test/parallel/test-tls-server-verify.js"))
810 ;; Replace pre-generated llhttp sources
811 (let ((llhttp (assoc-ref inputs "llhttp")))
812 (copy-file (string-append llhttp "/src/llhttp.c")
813 "deps/llhttp/src/llhttp.c")
814 (copy-file (string-append llhttp "/src/api.c")
815 "deps/llhttp/src/api.c")
816 (copy-file (string-append llhttp "/src/http.c")
817 "deps/llhttp/src/http.c")
818 (copy-file (string-append llhttp "/include/llhttp.h")
819 "deps/llhttp/include/llhttp.h"))))))))
821 `(;; Runtime dependencies for binaries used as a bootstrap.
822 ("c-ares" ,c-ares-for-node)
825 ("libuv" ,libuv-for-node)
826 ("nghttp2" ,nghttp2 "lib")
829 ;; Regular build-time dependencies.
831 ("pkg-config" ,pkg-config)
834 ("util-linux" ,util-linux)))
837 ("coreutils" ,coreutils)
838 ("c-ares" ,c-ares-for-node)
840 ("libuv" ,libuv-for-node)
841 ("llhttp" ,llhttp-bootstrap)
843 ("nghttp2" ,nghttp2 "lib")
847 (define-public libnode
848 (package/inherit node
851 (substitute-keyword-arguments (package-arguments node)
852 ((#:configure-flags flags ''())
853 `(cons* "--shared" "--without-npm" ,flags))
854 ((#:phases phases '%standard-phases)
855 `(modify-phases ,phases
856 (delete 'patch-npm-shebang)
857 (delete 'patch-node-shebang)))))))