gnu: r-maldiquant: Move to (gnu packages cran).
[jackhill/guix/guix.git] / gnu / packages / node.scm
index 753d2cc..f0b989b 100644 (file)
@@ -5,7 +5,8 @@
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Mike Gerwitz <mtg@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages node)
   #:use-module ((guix licenses) #:select (expat))
+  #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (guix packages)
   #:use-module (guix derivations)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages adns)
 (define-public node
   (package
     (name "node")
-    (version "10.17.0")
+    (version "10.20.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://nodejs.org/dist/v" version
                                   "/node-v" version ".tar.xz"))
               (sha256
                (base32
-                "13n5cvb340ba7vwm8il7bjrmpz89h6cibhk9rc3kq9ymdgbnf9j1"))
+                "0cvjwnl0wkcsyw3kannbdv01s235wrnp11n2s6swzjx95gpichfi"))
               (modules '((guix build utils)))
               (snippet
                `(begin
@@ -74,8 +77,7 @@
                   #t))))
     (build-system gnu-build-system)
     (arguments
-     ;; TODO: Purge the bundled copies from the source.
-     '(#:configure-flags '("--shared-cares"
+     `(#:configure-flags '("--shared-cares"
                            "--shared-http-parser"
                            "--shared-libuv"
                            "--shared-nghttp2"
              ;; This requires a DNS resolver.
              (delete-file "test/parallel/test-dns.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.
@@ -178,4 +198,35 @@ perfect for data-intensive real-time applications that run across distributed
 devices.")
     (home-page "https://nodejs.org/")
     (license expat)
-    (properties '((timeout . 3600))))) ; 1 h
+    (properties '((max-silent-time . 7200)     ;2h, needed on ARM
+                  (timeout . 21600)))))        ;6h
+
+;; TODO: Make this the default node on core-updates.  This cannot be done on
+;; master since this version of node requires a newer nghttp2 library at link
+;; time.
+(define-public node-10.22
+  (package
+    (inherit node)
+    (version "10.22.0")
+    (source (origin
+              (inherit (package-source node))
+              (uri (string-append "https://nodejs.org/dist/v" version
+                                  "/node-v" version ".tar.xz"))
+              (sha256
+               (base32
+                "1nz18fa550li10r0kzsm28c2rvvq61nq8bqdygip0rmvbi2paxg0"))))
+    (inputs
+     (alist-replace "nghttp2" (list nghttp2-1.41 "lib")
+                    (package-inputs node)))))
+
+(define-public libnode
+  (package
+    (inherit node)
+    (name "libnode")
+    (arguments
+     (substitute-keyword-arguments (package-arguments node)
+       ((#:configure-flags flags ''())
+        `(cons* "--shared" "--without-npm" ,flags))
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
+           (delete 'patch-npm-shebang)))))))