gnu: libuv: Update to 1.8.0.
[jackhill/guix/guix.git] / gnu / packages / node.scm
CommitLineData
ed02caff
CS
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
20fbd209 3;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
1eca745b 4;;; Copyright © 2015 David Thompson <davet@gnu.org>
ed02caff
CS
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages node)
1eca745b 22 #:use-module ((guix licenses) #:select (expat))
ed02caff
CS
23 #:use-module (guix packages)
24 #:use-module (guix derivations)
25 #:use-module (guix download)
1eca745b
DT
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages gcc)
30 #:use-module (gnu packages libevent)
31 #:use-module (gnu packages linux)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages tls))
ed02caff
CS
35
36(define-public node
37 (package
38 (name "node")
2d094239 39 (version "0.12.7")
ed02caff
CS
40 (source (origin
41 (method url-fetch)
42 (uri (string-append "http://nodejs.org/dist/v" version
43 "/node-v" version ".tar.gz"))
44 (sha256
45 (base32
2d094239 46 "17gk29zbw58l0sjjfw86acp39pkiblnq0gsq1jdrd70w0pgn8gdj"))))
ed02caff
CS
47 (build-system gnu-build-system)
48 (arguments
1eca745b
DT
49 ;; TODO: Package http_parser and add --shared-http-parser.
50 '(#:configure-flags '("--shared-openssl" "--shared-zlib" "--shared-libuv")
51 #:phases
52 (modify-phases %standard-phases
53 (replace 'configure
54 ;; Node's configure script is actually a python script, so we can't
55 ;; run it with bash.
56 (lambda* (#:key outputs (configure-flags '()) inputs
57 #:allow-other-keys)
58 (let* ((prefix (assoc-ref outputs "out"))
59 (flags (cons (string-append "--prefix=" prefix)
60 configure-flags)))
61 (format #t "build directory: ~s~%" (getcwd))
62 (format #t "configure flags: ~s~%" flags)
63 ;; Node's configure script expects the CC environment variable to
64 ;; be set.
65 (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
66 (zero? (apply system*
67 (string-append (assoc-ref inputs "python")
68 "/bin/python")
69 "./configure" flags))))))))
70 (native-inputs
71 `(("python" ,python-2)
72 ("perl" ,perl)
73 ("gcc" ,gcc-4.9)
74 ("util-linux" ,util-linux)
75 ("which" ,which)))
76 (inputs
77 `(("libuv" ,libuv)
78 ("openssl" ,openssl)
79 ("zlib" ,zlib)))
2d094239 80 (synopsis "Evented I/O for V8 JavaScript")
ed02caff
CS
81 (description "Node.js is a platform built on Chrome's JavaScript runtime
82for easily building fast, scalable network applications. Node.js uses an
83event-driven, non-blocking I/O model that makes it lightweight and efficient,
84perfect for data-intensive real-time applications that run across distributed
85devices.")
1eca745b
DT
86 (home-page "http://nodejs.org/")
87 (license expat)))