| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | (define-module (gnu packages node)
|
| 24 | #:use-module ((guix licenses) #:select (expat))
|
| 25 | #:use-module (guix packages)
|
| 26 | #:use-module (guix derivations)
|
| 27 | #:use-module (guix download)
|
| 28 | #:use-module (guix build-system gnu)
|
| 29 | #:use-module (gnu packages)
|
| 30 | #:use-module (gnu packages adns)
|
| 31 | #:use-module (gnu packages base)
|
| 32 | #:use-module (gnu packages compression)
|
| 33 | #:use-module (gnu packages gcc)
|
| 34 | #:use-module (gnu packages libevent)
|
| 35 | #:use-module (gnu packages linux)
|
| 36 | #:use-module (gnu packages perl)
|
| 37 | #:use-module (gnu packages python)
|
| 38 | #:use-module (gnu packages tls)
|
| 39 | #:use-module (gnu packages web))
|
| 40 |
|
| 41 | (define-public node
|
| 42 | (package
|
| 43 | (name "node")
|
| 44 | (version "8.9.1")
|
| 45 | (source (origin
|
| 46 | (method url-fetch)
|
| 47 | (uri (string-append "http://nodejs.org/dist/v" version
|
| 48 | "/node-v" version ".tar.gz"))
|
| 49 | (sha256
|
| 50 | (base32
|
| 51 | "1qbiz7hgwlirhwpd71c8yzcbwsyi5bjlfp6lxb6v55j6rizinj9j"))
|
| 52 | |
| 53 | |
| 54 | (patches
|
| 55 | (search-patches "node-test-http2-server-rst-stream.patch"))))
|
| 56 | (build-system gnu-build-system)
|
| 57 | (arguments
|
| 58 | |
| 59 | '(#:configure-flags '("--shared-openssl"
|
| 60 | "--shared-zlib"
|
| 61 | "--shared-libuv"
|
| 62 | "--shared-cares"
|
| 63 | "--shared-http-parser"
|
| 64 | "--without-snapshot")
|
| 65 | #:phases
|
| 66 | (modify-phases %standard-phases
|
| 67 | (add-before 'configure 'patch-files
|
| 68 | (lambda* (#:key inputs #:allow-other-keys)
|
| 69 | |
| 70 | (substitute* '("lib/child_process.js"
|
| 71 | "lib/internal/v8_prof_polyfill.js"
|
| 72 | "test/parallel/test-child-process-spawnsync-shell.js"
|
| 73 | "test/parallel/test-stdio-closed.js")
|
| 74 | (("'/bin/sh'")
|
| 75 | (string-append "'" (which "sh") "'")))
|
| 76 |
|
| 77 | |
| 78 | (substitute* '("test/parallel/test-child-process-default-options.js"
|
| 79 | "test/parallel/test-child-process-env.js"
|
| 80 | "test/parallel/test-child-process-exec-env.js")
|
| 81 | (("'/usr/bin/env'")
|
| 82 | (string-append "'" (which "env") "'")))
|
| 83 |
|
| 84 |
|
| 85 | |
| 86 | (for-each delete-file
|
| 87 | '("test/doctool/test-make-doc.js"))
|
| 88 | |
| 89 | |
| 90 | |
| 91 | (for-each delete-file
|
| 92 | '("test/addons-napi/test_general/testInstanceOf.js"))
|
| 93 | |
| 94 | |
| 95 | (for-each delete-file
|
| 96 | '("test/async-hooks/test-ttywrap.readstream.js"
|
| 97 | "test/parallel/test-util-inspect.js"
|
| 98 | "test/parallel/test-v8-serdes.js"
|
| 99 | "test/parallel/test-dgram-membership.js"
|
| 100 | "test/parallel/test-dns-cancel-reverse-lookup.js"
|
| 101 | "test/parallel/test-dns-resolveany.js"
|
| 102 | "test/parallel/test-cluster-master-error.js"
|
| 103 | "test/parallel/test-cluster-master-kill.js"
|
| 104 | "test/parallel/test-npm-install.js"
|
| 105 | "test/parallel/test-regress-GH-746.js"
|
| 106 | "test/sequential/test-child-process-emfile.js"
|
| 107 | "test/sequential/test-benchmark-child-process.js"
|
| 108 | "test/sequential/test-http-regr-gh-2928.js"))
|
| 109 | #t))
|
| 110 | (replace 'configure
|
| 111 | |
| 112 | |
| 113 | (lambda* (#:key outputs (configure-flags '()) inputs
|
| 114 | #:allow-other-keys)
|
| 115 | (let* ((prefix (assoc-ref outputs "out"))
|
| 116 | (flags (cons (string-append "--prefix=" prefix)
|
| 117 | configure-flags)))
|
| 118 | (format #t "build directory: ~s~%" (getcwd))
|
| 119 | (format #t "configure flags: ~s~%" flags)
|
| 120 | |
| 121 | |
| 122 | (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
|
| 123 | (zero? (apply system*
|
| 124 | (string-append (assoc-ref inputs "python")
|
| 125 | "/bin/python")
|
| 126 | "configure" flags)))))
|
| 127 | (add-before 'check 'skip-check-doc-only
|
| 128 | (lambda _
|
| 129 | (substitute* "Makefile"
|
| 130 | |
| 131 | |
| 132 | (("\\$\\(MAKE\\) doc-only" all)
|
| 133 | (string-append "#" all)))
|
| 134 | #t))
|
| 135 | (add-after 'patch-shebangs 'patch-npm-shebang
|
| 136 | (lambda* (#:key outputs #:allow-other-keys)
|
| 137 | (let* ((bindir (string-append (assoc-ref outputs "out")
|
| 138 | "/bin"))
|
| 139 | (npm (string-append bindir "/npm"))
|
| 140 | (target (readlink npm)))
|
| 141 | (with-directory-excursion bindir
|
| 142 | (patch-shebang target (list bindir))
|
| 143 | #t)))))))
|
| 144 | (native-inputs
|
| 145 | `(("python" ,python-2)
|
| 146 | ("perl" ,perl)
|
| 147 | ("procps" ,procps)
|
| 148 | ("util-linux" ,util-linux)
|
| 149 | ("which" ,which)))
|
| 150 | (native-search-paths
|
| 151 | (list (search-path-specification
|
| 152 | (variable "NODE_PATH")
|
| 153 | (files '("lib/node_modules")))))
|
| 154 | (inputs
|
| 155 | `(("c-ares" ,c-ares)
|
| 156 | ("http-parser" ,http-parser)
|
| 157 | ("libuv" ,libuv)
|
| 158 | ("openssl" ,openssl)
|
| 159 | ("zlib" ,zlib)))
|
| 160 | (synopsis "Evented I/O for V8 JavaScript")
|
| 161 | (description "Node.js is a platform built on Chrome's JavaScript runtime
|
| 162 | for easily building fast, scalable network applications. Node.js uses an
|
| 163 | event-driven, non-blocking I/O model that makes it lightweight and efficient,
|
| 164 | perfect for data-intensive real-time applications that run across distributed
|
| 165 | devices.")
|
| 166 | (home-page "http://nodejs.org/")
|
| 167 | (license expat)
|
| 168 | (properties '((timeout . 3600))))) |