;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
;;; 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 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages gcc)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages libevent)
#:use-module (gnu packages linux)
#:use-module (gnu packages perl)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages tls)
#:use-module (gnu packages web))
(define-public node
(package
(name "node")
- (version "8.9.1")
+ (version "9.11.1")
(source (origin
(method url-fetch)
- (uri (string-append "http://nodejs.org/dist/v" version
+ (uri (string-append "https://nodejs.org/dist/v" version
"/node-v" version ".tar.gz"))
(sha256
(base32
- "1qbiz7hgwlirhwpd71c8yzcbwsyi5bjlfp6lxb6v55j6rizinj9j"))
- ;; See https://github.com/nodejs/node/issues/16688
- ;; Remove this next update (>8.9.1).
- (patches
- (search-patches "node-test-http2-server-rst-stream.patch"))))
+ "1vjh9zvw7wkdz6b0l99ya7mqjk0l8lbg9isr1q8rxwp400dhkk32"))
+ (modules '((guix build utils)))
+ (snippet
+ `(begin
+ ;; Remove bundled software.
+ (for-each delete-file-recursively
+ '("deps/cares"
+ "deps/http_parser"
+ "deps/icu-small"
+ "deps/nghttp2"
+ "deps/openssl"
+ "deps/uv"
+ "deps/zlib"))
+ (substitute* "Makefile"
+ ;; Remove references to bundled software.
+ (("deps/http_parser/http_parser.gyp") "")
+ (("deps/uv/include/\\*.h") "")
+ (("deps/uv/uv.gyp") "")
+ (("deps/zlib/zlib.gyp") ""))
+ #t))))
(build-system gnu-build-system)
(arguments
;; TODO: Purge the bundled copies from the source.
- '(#:configure-flags '("--shared-openssl"
- "--shared-zlib"
- "--shared-libuv"
- "--shared-cares"
+ '(#:configure-flags '("--shared-cares"
"--shared-http-parser"
- "--without-snapshot")
+ "--shared-libuv"
+ "--shared-nghttp2"
+ "--shared-openssl"
+ "--shared-zlib"
+ "--without-snapshot"
+ "--with-intl=system-icu")
#:phases
(modify-phases %standard-phases
(add-before 'configure 'patch-files
(lambda* (#:key inputs #:allow-other-keys)
+
+ ;; This phase is inherited by Node LTS, which does not have all
+ ;; the files listed here. Use this helper for convenience.
+ (define (delete-if-exists file)
+ (if (file-exists? file)
+ (delete-file file)
+ '()))
+
;; Fix hardcoded /bin/sh references.
(substitute* '("lib/child_process.js"
"lib/internal/v8_prof_polyfill.js"
(("'/usr/bin/env'")
(string-append "'" (which "env") "'")))
+ ;; FIXME: These tests depend on being able to install eslint.
+ ;; See https://github.com/nodejs/node/issues/17098.
+ (for-each delete-if-exists
+ '("test/parallel/test-eslint-alphabetize-errors.js"
+ "test/parallel/test-eslint-buffer-constructor.js"
+ "test/parallel/test-eslint-documented-errors.js"
+ "test/parallel/test-eslint-inspector-check.js"))
- ;; test-make-doc needs doc-only target, which is inhibited below
- (for-each delete-file
- '("test/doctool/test-make-doc.js"))
- ;; FIXME: This test seems to depends on files that are not
- ;; available in the bundled v8. See
- ;; https://github.com/nodejs/node/issues/13344
- (for-each delete-file
- '("test/addons-napi/test_general/testInstanceOf.js"))
;; 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
+ (for-each delete-if-exists
'("test/async-hooks/test-ttywrap.readstream.js"
"test/parallel/test-util-inspect.js"
"test/parallel/test-v8-serdes.js"
"test/parallel/test-dns-resolveany.js"
"test/parallel/test-cluster-master-error.js"
"test/parallel/test-cluster-master-kill.js"
+ "test/parallel/test-net-listen-after-destroying-stdin.js"
"test/parallel/test-npm-install.js"
- "test/parallel/test-regress-GH-746.js"
"test/sequential/test-child-process-emfile.js"
"test/sequential/test-benchmark-child-process.js"
"test/sequential/test-http-regr-gh-2928.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-if-exists
+ '("test/parallel/test-tls-passphrase.js"
+ "test/parallel/test-tls-server-verify.js"))
#t))
(replace 'configure
;; Node's configure script is actually a python script, so we can't
;; Node's configure script expects the CC environment variable to
;; be set.
(setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
- (zero? (apply system*
- (string-append (assoc-ref inputs "python")
- "/bin/python")
- "configure" flags)))))
- (add-before 'check 'skip-check-doc-only
- (lambda _
- (substitute* "Makefile"
- ;; requires js-yaml, which is not part of the distribution,
- ;; and falls back to using npm to download it
- (("\\$\\(MAKE\\) doc-only" all)
- (string-append "#" all)))
- #t))
+ (apply invoke
+ (string-append (assoc-ref inputs "python")
+ "/bin/python")
+ "configure" flags))))
(add-after 'patch-shebangs 'patch-npm-shebang
(lambda* (#:key outputs #:allow-other-keys)
(let* ((bindir (string-append (assoc-ref outputs "out")
(native-inputs
`(("python" ,python-2)
("perl" ,perl)
+ ("pkg-config" ,pkg-config)
("procps" ,procps)
("util-linux" ,util-linux)
("which" ,which)))
(inputs
`(("c-ares" ,c-ares)
("http-parser" ,http-parser)
- ("libuv" ,libuv)
+ ("icu4c" ,icu4c)
+ ("libuv" ,libuv-1.19)
+ ("nghttp2" ,nghttp2 "lib")
("openssl" ,openssl)
("zlib" ,zlib)))
(synopsis "Evented I/O for V8 JavaScript")
event-driven, non-blocking I/O model that makes it lightweight and efficient,
perfect for data-intensive real-time applications that run across distributed
devices.")
- (home-page "http://nodejs.org/")
+ (home-page "https://nodejs.org/")
(license expat)
(properties '((timeout . 3600))))) ; 1 h
+
+(define-public node-lts
+ (package
+ (inherit node)
+ (name "node-lts")
+ (version "8.12.0")
+ (source (origin
+ (inherit (package-source node))
+ (uri (string-append "https://nodejs.org/dist/v" version
+ "/node-v" version ".tar.xz"))
+ (sha256
+ (base32
+ "16j1rrxkhmvpcw689ndw1raql1gz4jqn7n82z55zn63c05cgz7as"))))))