guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

13/13: gnu: node: Add node-14.14


From: guix-commits
Subject: 13/13: gnu: node: Add node-14.14
Date: Fri, 23 Oct 2020 18:14:48 -0400 (EDT)

jlicht pushed a commit to branch wip-node-14
in repository guix.

commit 916db33c9c94a960b67d0c0ab590a4b85850d391
Author: Jelle Licht <jlicht@fsfe.org>
AuthorDate: Fri Oct 23 22:56:58 2020 +0200

    gnu: node: Add node-14.14
    
    * gnu/packages/node.scm (node-14.14): New package.
---
 gnu/packages/node.scm | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 136 insertions(+)

diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 8d59df6..d8c8b7e 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -599,6 +599,142 @@ definition into a C output.")
 compiled and linked with the embedder's program (like @code{Node.js}).")
     (license license:expat)))
 
+(define-public node-14.14
+  (package
+    (inherit node)
+    (version "14.14.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://nodejs.org/dist/v"; version
+                                  "/node-v" version ".tar.xz"))
+              (sha256
+               (base32
+                "1rphkl3lqg0rzgg0r58bfv1hjw3rg96qvqcilk2927kbpps3bs84"))
+              (modules '((guix build utils)))
+              (snippet
+               `(begin
+                  ;; Remove bundled software, where possible
+                  (for-each delete-file-recursively
+                            '("deps/cares"
+                              "deps/icu-small"
+                              "deps/nghttp2"
+                              "deps/openssl"
+                              "deps/zlib"))
+                  (substitute* "Makefile"
+                    ;; Remove references to bundled software.
+                    (("deps/uv/uv.gyp") "")
+                    (("deps/zlib/zlib.gyp") ""))
+                  #t))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments node)
+       ((#:configure-flags configure-flags)
+        ''("--shared-cares"
+           "--shared-libuv"
+           "--shared-nghttp2"
+           "--shared-openssl"
+           "--shared-zlib"
+           "--shared-brotli"
+           "--with-intl=system-icu"))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'configure
+             ;; Node's configure script is actually a python script, so we 
can't
+             ;; run it with bash.
+             (lambda* (#:key outputs (configure-flags '()) inputs
+                       #:allow-other-keys)
+               (let* ((prefix (assoc-ref outputs "out"))
+                      (flags (cons (string-append "--prefix=" prefix)
+                                   configure-flags)))
+                 (format #t "build directory: ~s~%" (getcwd))
+                 (format #t "configure flags: ~s~%" flags)
+                 ;; Node's configure script expects the CC environment 
variable to
+                 ;; be set.
+                 (setenv "CC" (string-append (assoc-ref inputs "gcc") 
"/bin/gcc"))
+                 (apply invoke
+                        (string-append (assoc-ref inputs "python")
+                                       "/bin/python3")
+                        "configure" flags))))
+           (replace 'patch-files
+             (lambda* (#:key inputs #:allow-other-keys)
+               ;; Fix hardcoded /bin/sh references.
+               (substitute* '("lib/child_process.js"
+                              "lib/internal/v8_prof_polyfill.js"
+                              
"test/parallel/test-child-process-spawnsync-shell.js"
+                              "test/parallel/test-stdio-closed.js"
+                              "test/sequential/test-child-process-emfile.js")
+                 (("'/bin/sh'")
+                  (string-append "'" (which "sh") "'")))
+
+               ;; Fix hardcoded /usr/bin/env references.
+               (substitute* 
'("test/parallel/test-child-process-default-options.js"
+                              "test/parallel/test-child-process-env.js"
+                              "test/parallel/test-child-process-exec-env.js")
+                 (("'/usr/bin/env'")
+                  (string-append "'" (which "env") "'")))
+
+               ;; FIXME: These tests fail in the build container, but they 
don't
+               ;; seem to be indicative of real problems in practice.
+               (for-each delete-file
+                         '("test/parallel/test-cluster-master-error.js"
+                           "test/parallel/test-cluster-master-kill.js"))
+
+               ;; This requires a DNS resolver.
+               (for-each delete-file
+                         '("test/parallel/test-dns.js"
+                           "test/parallel/test-dns-lookupService-promises.js"))
+
+               ;; TODO: why does this fail. It seems to _almost_ pass, but it 
parses 1 byte?
+               (delete-file 
"test/parallel/test-http-server-destroy-socket-on-client-error.js")
+
+               ;; TODO: this seems to fail because of spawning processes?
+               (delete-file "test/parallel/test-fs-write-sigxfsz.js")
+
+               ;; FIXME: This test fails randomly:
+               ;; https://github.com/nodejs/node/issues/31213
+               (delete-file 
"test/parallel/test-net-listen-after-destroying-stdin.js")
+
+               ;; FIXME: These tests fail on armhf-linux:
+               ;; https://github.com/nodejs/node/issues/31970
+               ,@(if (string-prefix? "arm" (%current-system))
+                     '((for-each delete-file
+                                 '("test/parallel/test-zlib.js"
+                                   "test/parallel/test-zlib-brotli.js"
+                                   "test/parallel/test-zlib-brotli-flush.js"
+                                   
"test/parallel/test-zlib-brotli-from-brotli.js"
+                                   
"test/parallel/test-zlib-brotli-from-string.js"
+                                   
"test/parallel/test-zlib-convenience-methods.js"
+                                   
"test/parallel/test-zlib-random-byte-pipes.js"
+                                   
"test/parallel/test-zlib-write-after-flush.js")))
+                     '())
+
+               ;; These tests have an expiry date: they depend on the validity 
of
+               ;; TLS certificates that are bundled with the source.  We want 
this
+               ;; package to be reproducible forever, so remove those.
+               ;; TODO: Regenerate certs instead.
+               (for-each delete-file
+                         '("test/parallel/test-tls-passphrase.js"
+                           "test/parallel/test-tls-server-verify.js"))
+
+               ;; Replace pre-generated llhttp sources
+               (let ((llhttp (assoc-ref inputs "llhttp")))
+                 (copy-file (string-append llhttp "/src/llhttp.c")
+                            "deps/llhttp/src/llhttp.c")
+                 (copy-file (string-append llhttp "/include/llhttp.h")
+                            "deps/llhttp/include/llhttp.h"))
+               #t))))))
+    (inputs
+     `(("c-ares" ,c-ares)
+       ("icu4c" ,icu4c-67)
+       ("libuv" ,libuv-node)
+       ("llhttp" ,llhttp-bootstrap)
+       ("google-brotli" ,google-brotli)
+       ("nghttp2" ,nghttp2-1.41 "lib")
+       ("openssl" ,openssl)
+       ("zlib" ,zlib)))
+    (native-inputs
+     (alist-replace "python" (list python-3)
+                    (package-native-inputs node)))))
+
 (define-public libnode
   (package
     (inherit node)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]