unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add node.
@ 2014-06-30 22:20 Cyrill Schenkel
  2014-06-30 22:36 ` Eric Bavier
  2014-06-30 22:37 ` David Thompson
  0 siblings, 2 replies; 5+ messages in thread
From: Cyrill Schenkel @ 2014-06-30 22:20 UTC (permalink / raw)
  To: Guix-devel

From 3ac30b57db1e57e1c80077df7ee645838deb04fd Mon Sep 17 00:00:00 2001
From: Cyrill Schenkel <cyrill.schenkel@gmail.com>
Date: Tue, 1 Jul 2014 00:18:41 +0200
Subject: [PATCH] gnu: Add node.

* gnu-system.am (GNU_SYSTEM_MODULES, dist_patch_DATA): Add new patch and package.
* gnu/packages/patches/node-configure.patch: New file.
* gnu/packages/node.scm: New file.
---
 gnu-system.am                             |  2 ++
 gnu/packages/node.scm                     | 56 +++++++++++++++++++++++++++++++
 gnu/packages/patches/node-configure.patch | 34 +++++++++++++++++++
 3 files changed, 92 insertions(+)
 create mode 100644 gnu/packages/node.scm
 create mode 100644 gnu/packages/patches/node-configure.patch

diff --git a/gnu-system.am b/gnu-system.am
index 793ee4c..c38896b 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -171,6 +171,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/ncurses.scm			\
   gnu/packages/netpbm.scm			\
   gnu/packages/nettle.scm			\
+  gnu/packages/node.scm				\
   gnu/packages/noweb.scm			\
   gnu/packages/ocaml.scm			\
   gnu/packages/ocrad.scm			\
@@ -339,6 +340,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/mit-krb5-init-fix.patch			\
   gnu/packages/patches/mpc123-initialize-ao.patch		\
   gnu/packages/patches/module-init-tools-moduledir.patch	\
+  gnu/packages/patches/node-configure.patch			\
   gnu/packages/patches/patchelf-page-size.patch			\
   gnu/packages/patches/patchutils-xfail-gendiff-tests.patch	\
   gnu/packages/patches/perl-no-sys-dirs.patch			\
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
new file mode 100644
index 0000000..be7afa6
--- /dev/null
+++ b/gnu/packages/node.scm
@@ -0,0 +1,56 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
+;;;
+;;; 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 (gnu packages)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages linux)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build gnu-build-system)
+  #:use-module (guix build-system gnu))
+
+(define-public node
+  (package
+    (name "node")
+    (version "0.10.29")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://nodejs.org/dist/v" version
+                                  "/node-v" version ".tar.gz"))
+              (sha256
+               (base32
+                "0pdib215ldypc149ad03wlfj0i8fwdfydd4q2hd7ry35yw0rsds7"))
+              (patches (list (search-patch "node-configure.patch")))))
+    (native-inputs `(("python" ,python-2)
+                     ("perl" ,perl)
+                     ("gcc" ,gcc-4.9)
+                     ("util-linux" ,util-linux)))
+    (build-system gnu-build-system)
+    (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.")
+    (license expat)
+    (home-page "http://nodejs.org/")))
diff --git a/gnu/packages/patches/node-configure.patch b/gnu/packages/patches/node-configure.patch
new file mode 100644
index 0000000..6351766
--- /dev/null
+++ b/gnu/packages/patches/node-configure.patch
@@ -0,0 +1,34 @@
+By default the `gnu-build-system' tries to run the configure script with
+bash. This doesn't work because the node configure script is written in
+python.
+
+This patch is a small hack which redirects the original content of the
+configure script to python in a bash compatible manner.
+
+--- node-v0.10.29/configure.orig	2014-06-09 19:04:36.000000000 +0200
++++ node-v0.10.29/configure	2014-06-30 21:56:40.044559261 +0200
+@@ -1,4 +1,18 @@
+-#!/usr/bin/env python
++#!/bin/bash
++
++ARGS=""
++
++for i in $@
++do
++    if echo $i | grep "\\-\\-prefix.*" > /dev/null
++    then
++	ARGS="$ARGS $i"
++    fi
++done
++
++export CC=gcc
++
++python <<EOF - $ARGS
+ import optparse
+ import os
+ import pprint
+@@ -714,3 +728,4 @@
+ gyp_args += args
+ 
+ subprocess.call(gyp_args)
++EOF
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-01  8:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30 22:20 [PATCH] gnu: Add node Cyrill Schenkel
2014-06-30 22:36 ` Eric Bavier
2014-06-30 22:37 ` David Thompson
2014-07-01  6:59   ` Cyrill Schenkel
2014-07-01  8:34     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).