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