all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 351e9887ee2ba84e64df32eeeea2d56eedf79ff4 7765 bytes (raw)
name: gnu/packages/node.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages node)
  #:use-module ((guix licenses) #:select (expat))
  #:use-module (guix packages)
  #:use-module (guix derivations)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages adns)
  #:use-module (gnu packages base)
  #:use-module ((gnu packages compression) #:prefix compression:)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages python)
  #:use-module ((gnu packages tls) #:prefix tls:)
  #:use-module (gnu packages valgrind))

(define-public http-parser
  (package
    (name "http-parser")
    (version "2.7.1")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/nodejs/http-parser/archive/v"
                                  version ".tar.gz"))
              (sha256 (base32 "1cw6nf8xy4jhib1w0jd2y0gpqjbdasg8b7pkl2k2vpp54k9rlh3h"))))
    (build-system gnu-build-system)
    (arguments
     '(#:make-flags (list "CC=gcc" (string-append "DESTDIR=" (assoc-ref %outputs "out")))
       #:test-target "test-valgrind"
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)
         (add-before 'build 'patch-makefile
           (lambda* (#:key inputs outputs #:allow-other-keys)
              (substitute* '("Makefile")
                (("/usr/local") ""))))
         (replace 'build
           (lambda* (#:key make-flags #:allow-other-keys)
             (zero? (apply system* "make" "library" make-flags))))
         )))
    (inputs '())
    (native-inputs `(("valgrind" ,valgrind)))
    (home-page "https://github.com/nodejs/http-parser")
    (synopsis "HTTP request/response parser for C")
    (description "HTTP parser is a parser for HTTP messages written in C.  It
parses both requests and responses.  The parser is designed to be used in
performance HTTP applications.  It does not make any syscalls nor allocations,
it does not buffer data, it can be interrupted at anytime.")
    (license expat)))

(define-public node
  (package
    (name "node")
    (version "6.4.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "http://nodejs.org/dist/v" version
                                  "/node-v" version ".tar.gz"))
              (sha256
               (base32
                "1l4p2zgld68c061njx6drxm06685hmp656ijm9i0hnyg30397355"))))
    (build-system gnu-build-system)
    (arguments
     ;; TODO: Package http_parser and add --shared-http-parser.
     '(#:configure-flags '("--shared-openssl"
                           "--shared-zlib"
                           "--shared-libuv"
                           "--shared-cares"
                           "--shared-http-parser"
                           "--without-snapshot")
       #:phases
       (modify-phases %standard-phases
         (add-before 'configure '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-stdio-closed.js")
               (("'/bin/sh'")
                (string-append "'" (which "bash") "'")))

             ;; 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") "'")))

             ;; Having the build fail because of linter errors is insane!
             (substitute* '("Makefile")
               (("	\\$\\(MAKE\\) jslint") "")
               (("	\\$\\(MAKE\\) cpplint\n") ""))

             ;; 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-dgram-membership.js"
                         "test/parallel/test-cluster-master-error.js"
                         "test/parallel/test-cluster-master-kill.js"
                         "test/parallel/test-npm-install.js"
                         "test/sequential/test-child-process-emfile.js"))
             #t))
         (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"))
               (zero? (apply system*
                             (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")
                                           "/bin"))
                    (npm    (string-append bindir "/npm"))
                    (target (readlink npm)))
               (with-directory-excursion bindir
                 (patch-shebang target (list bindir))
                 #t)))))))
    (native-inputs
     `(("python" ,python-2)
       ("perl" ,perl)
       ("procps" ,procps)
       ("util-linux" ,util-linux)
       ("which" ,which)))
    (native-search-paths
     (list (search-path-specification
            (variable "NODE_PATH")
            (files '("lib/node_modules")))))
    (inputs
     `(("libuv" ,libuv)
       ("openssl" ,tls:openssl)
       ("zlib" ,compression:zlib)
       ("http-parser" ,http-parser)
       ("c-ares" ,c-ares)))
    (synopsis "Evented I/O for V8 JavaScript")
    (description "Node.js is a platform built on Chrome's JavaScript runtime
for easily building fast, scalable network applications.  Node.js uses an
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/")
    (license expat)))

debug log:

solving 351e988 ...
found 351e988 in https://yhetil.org/guix/20160827112333.1759-5-jlicht@fsfe.org/
found 7c020e6 in https://yhetil.org/guix/20160827112333.1759-4-jlicht@fsfe.org/
found d1c5e1b in https://yhetil.org/guix/20160827112333.1759-3-jlicht@fsfe.org/
found 545aaaa in https://yhetil.org/guix/20160827112333.1759-2-jlicht@fsfe.org/
found 2b27774 in https://yhetil.org/guix/87fupre7w5.fsf@gmail.com/
found 887ef93 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 887ef930ffcbbd94577ca456641e7906a0d352d4	gnu/packages/node.scm

applying [1/5] https://yhetil.org/guix/87fupre7w5.fsf@gmail.com/
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 887ef93..2b27774 100644


applying [2/5] https://yhetil.org/guix/20160827112333.1759-2-jlicht@fsfe.org/
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 2b27774..545aaaa 100644


applying [3/5] https://yhetil.org/guix/20160827112333.1759-3-jlicht@fsfe.org/
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 545aaaa..d1c5e1b 100644


applying [4/5] https://yhetil.org/guix/20160827112333.1759-4-jlicht@fsfe.org/
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index d1c5e1b..7c020e6 100644


applying [5/5] https://yhetil.org/guix/20160827112333.1759-5-jlicht@fsfe.org/
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 7c020e6..351e988 100644

Checking patch gnu/packages/node.scm...
Applied patch gnu/packages/node.scm cleanly.
Checking patch gnu/packages/node.scm...
Applied patch gnu/packages/node.scm cleanly.
Checking patch gnu/packages/node.scm...
Applied patch gnu/packages/node.scm cleanly.
Checking patch gnu/packages/node.scm...
Applied patch gnu/packages/node.scm cleanly.
Checking patch gnu/packages/node.scm...
Applied patch gnu/packages/node.scm cleanly.

index at:
100644 351e9887ee2ba84e64df32eeeea2d56eedf79ff4	gnu/packages/node.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.