;;; 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.16.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
- "0236jlb1hxhzqjlmmlxipcycrndiq92c8434iyy7zshh3n4pzqqq"))
+ "0cvjwnl0wkcsyw3kannbdv01s235wrnp11n2s6swzjx95gpichfi"))
(modules '((guix build utils)))
(snippet
`(begin
#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.
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)))))))