From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Re: [PATCH] gnu: Add node. Date: Mon, 30 Jun 2014 18:37:41 -0400 Message-ID: <877g3yc9ca.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> References: <87oaxaghuf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kCt-0000DA-CC for guix-devel@gnu.org; Mon, 30 Jun 2014 18:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1kCn-0003AJ-Qp for guix-devel@gnu.org; Mon, 30 Jun 2014 18:37:51 -0400 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:51625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kCn-00039t-HV for guix-devel@gnu.org; Mon, 30 Jun 2014 18:37:45 -0400 Received: by mail-qa0-f44.google.com with SMTP id hw13so7018936qab.3 for ; Mon, 30 Jun 2014 15:37:43 -0700 (PDT) In-Reply-To: <87oaxaghuf.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Cyrill Schenkel , Guix-devel Cyrill Schenkel writes: > From 3ac30b57db1e57e1c80077df7ee645838deb04fd Mon Sep 17 00:00:00 2001 > From: Cyrill Schenkel > Date: Tue, 1 Jul 2014 00:18:41 +0200 > Subject: [PATCH] gnu: Add node. > Awesome! Thinking out loud: I would like to learn how to use Guix as a tool for web application packaging and deployment automation. > * 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 =3D \ > 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 =3D \ > 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 =C2=A9 2014 Cyrill Schenkel > +;;; > +;;; 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 . > + > +(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.") No period at the end. > + (description "Node.js is a platform built on Chrome's JavaScript run= time > +for easily building fast, scalable network applications. Node.js uses an > +event-driven, non-blocking I/O model that makes it lightweight and effic= ient, > +perfect for data-intensive real-time applications that run across distri= buted > +devices.") Two spaces after a period. > + (license expat) > + (home-page "http://nodejs.org/"))) > diff --git a/gnu/packages/patches/node-configure.patch b/gnu/packages/pat= ches/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=3D"" > ++ > ++for i in $@ > ++do > ++ if echo $i | grep "\\-\\-prefix.*" > /dev/null > ++ then > ++ ARGS=3D"$ARGS $i" > ++ fi > ++done > ++ > ++export CC=3Dgcc > ++ > ++python < + import optparse > + import os > + import pprint > +@@ -714,3 +728,4 @@ > + gyp_args +=3D args > +=20 > + subprocess.call(gyp_args) > ++EOF > --=20 > 2.0.0 > > Looks good to me! Let's see what Ludovic thinks. --=20 David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate