Commit | Line | Data |
---|---|---|
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) | |
27 | #:use-module (guix packages) | |
28 | #:use-module (guix derivations) | |
29 | #:use-module (guix download) | |
30 | #:use-module (guix build gnu-build-system) | |
31 | #:use-module (guix build-system gnu)) | |
32 | ||
33 | (define-public node | |
34 | (package | |
35 | (name "node") | |
36 | (version "0.10.29") | |
37 | (source (origin | |
38 | (method url-fetch) | |
39 | (uri (string-append "http://nodejs.org/dist/v" version | |
40 | "/node-v" version ".tar.gz")) | |
41 | (sha256 | |
42 | (base32 | |
43 | "0pdib215ldypc149ad03wlfj0i8fwdfydd4q2hd7ry35yw0rsds7")))) | |
44 | (native-inputs `(("python" ,python-2) | |
45 | ("perl" ,perl) | |
46 | ("gcc" ,gcc-4.9) | |
47 | ("util-linux" ,util-linux))) | |
48 | (build-system gnu-build-system) | |
49 | (arguments | |
50 | `(#:phases | |
51 | (alist-replace | |
52 | 'configure | |
53 | ;; Node's configure script is actually a python script, so we can't | |
54 | ;; run it with bash. | |
55 | (lambda* (#:key outputs (configure-flags '()) inputs | |
56 | #:allow-other-keys) | |
57 | (let* ((prefix (assoc-ref outputs "out")) | |
58 | (flags `(,(string-append "--prefix=" prefix) | |
59 | ,@configure-flags))) | |
60 | (format #t "build directory: ~s~%" (getcwd)) | |
61 | (format #t "configure flags: ~s~%" flags) | |
62 | ;; Node's configure script expects the CC environment variable to | |
63 | ;; be set. | |
64 | (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) | |
65 | (zero? (apply system* | |
66 | (string-append (assoc-ref inputs "python") | |
67 | "/bin/python") | |
68 | "./configure" flags)))) | |
69 | %standard-phases))) | |
70 | (synopsis "Evented I/O for V8 javascript") | |
71 | (description "Node.js is a platform built on Chrome's JavaScript runtime | |
72 | for easily building fast, scalable network applications. Node.js uses an | |
73 | event-driven, non-blocking I/O model that makes it lightweight and efficient, | |
74 | perfect for data-intensive real-time applications that run across distributed | |
75 | devices.") | |
76 | (license expat) | |
77 | (home-page "http://nodejs.org/"))) |