| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu packages node)
|
| 21 | #:use-module ((guix licenses)
|
| 22 | #:select (expat))
|
| 23 | #:use-module (gnu packages)
|
| 24 | #:use-module (gnu packages perl)
|
| 25 | #:use-module (gnu packages python)
|
| 26 | #:use-module (gnu packages gcc)
|
| 27 | #:use-module (gnu packages linux)
|
| 28 | #:use-module (gnu packages base)
|
| 29 | #:use-module (guix packages)
|
| 30 | #:use-module (guix derivations)
|
| 31 | #:use-module (guix download)
|
| 32 | #:use-module (guix build-system gnu))
|
| 33 |
|
| 34 | (define-public node
|
| 35 | (package
|
| 36 | (name "node")
|
| 37 | (version "0.12.2")
|
| 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 | "0bbp58p3iwsp35c37brkkh6bmjjhwsw2nlr8srz3wqryx6nphzmc"))))
|
| 45 | (native-inputs `(("python" ,python-2)
|
| 46 | ("perl" ,perl)
|
| 47 | ("gcc" ,gcc-4.9)
|
| 48 | ("util-linux" ,util-linux)
|
| 49 | ("which" ,which)))
|
| 50 | (build-system gnu-build-system)
|
| 51 | (arguments
|
| 52 | `(#:phases
|
| 53 | (alist-replace
|
| 54 | 'configure
|
| 55 | |
| 56 | |
| 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 | |
| 65 | |
| 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
|
| 74 | for easily building fast, scalable network applications. Node.js uses an
|
| 75 | event-driven, non-blocking I/O model that makes it lightweight and efficient,
|
| 76 | perfect for data-intensive real-time applications that run across distributed
|
| 77 | devices.")
|
| 78 | (license expat)
|
| 79 | (home-page "http://nodejs.org/")))
|